Galería de Medios
Archivos de Código
main.py
work.py
#────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
#─██████──────────██████─██████████████─████████████████───██████──████████────────██████████████─████████──████████─
#─██░░██──────────██░░██─██░░░░░░░░░░██─██░░░░░░░░░░░░██───██░░██──██░░░░██────────██░░░░░░░░░░██─██░░░░██──██░░░░██─
#─██░░██──────────██░░██─██░░██████░░██─██░░████████░░██───██░░██──██░░████────────██░░██████░░██─████░░██──██░░████─
#─██░░██──────────██░░██─██░░██──██░░██─██░░██────██░░██───██░░██──██░░██──────────██░░██──██░░██───██░░░░██░░░░██───
#─██░░██──██████──██░░██─██░░██──██░░██─██░░████████░░██───██░░██████░░██──────────██░░██████░░██───████░░░░░░████───
#─██░░██──██░░██──██░░██─██░░██──██░░██─██░░░░░░░░░░░░██───██░░░░░░░░░░██──────────██░░░░░░░░░░██─────████░░████─────
#─██░░██──██░░██──██░░██─██░░██──██░░██─██░░██████░░████───██░░██████░░██──────────██░░██████████───────██░░██───────
#─██░░██████░░██████░░██─██░░██──██░░██─██░░██──██░░██─────██░░██──██░░██──────────██░░██───────────────██░░██───────
#─██░░░░░░░░░░░░░░░░░░██─██░░██████░░██─██░░██──██░░██████─██░░██──██░░████─██████─██░░██───────────────██░░██───────
#─██░░██████░░██████░░██─██░░░░░░░░░░██─██░░██──██░░░░░░██─██░░██──██░░░░██─██░░██─██░░██───────────────██░░██───────
#─██████──██████──██████─██████████████─██████──██████████─██████──████████─██████─██████───────────────██████───────
#────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
import discord
from discord.ext import commands
import random
from main import update_balance, get_balance
class Work(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.command(name='work')
@commands.cooldown(1, 3600, commands.BucketType.user)
async def work(self, ctx):
user_id = ctx.author.id
earnings = random.randint(100, 500)
update_balance(user_id, earnings)
await ctx.send(f'¡Buen trabajo, {ctx.author.mention}! Has ganado **${earnings:,}**.')
@work.error
async def work_error(self, ctx, error):
if isinstance(error, commands.CommandOnCooldown):
seconds = int(error.retry_after)
minutes, seconds = divmod(seconds, 60)
hours, minutes = divmod(minutes, 60)
await ctx.send(f'Estás cansado. Podrás trabajar de nuevo en **{hours}h {minutes}m {seconds}s**.')
async def setup(bot):
await bot.add_cog(Work(bot))
slut.py
#──────────────────────────────────────────────────────────────────────────────────────────────────────
#─██████████████─██████─────────██████──██████─██████████████────────██████████████─████████──████████─
#─██░░░░░░░░░░██─██░░██─────────██░░██──██░░██─██░░░░░░░░░░██────────██░░░░░░░░░░██─██░░░░██──██░░░░██─
#─██░░██████████─██░░██─────────██░░██──██░░██─██████░░██████────────██░░██████░░██─████░░██──██░░████─
#─██░░██─────────██░░██─────────██░░██──██░░██─────██░░██────────────██░░██──██░░██───██░░░░██░░░░██───
#─██░░██████████─██░░██─────────██░░██──██░░██─────██░░██────────────██░░██████░░██───████░░░░░░████───
#─██░░░░░░░░░░██─██░░██─────────██░░██──██░░██─────██░░██────────────██░░░░░░░░░░██─────████░░████─────
#─██████████░░██─██░░██─────────██░░██──██░░██─────██░░██────────────██░░██████████───────██░░██───────
#─────────██░░██─██░░██─────────██░░██──██░░██─────██░░██────────────██░░██───────────────██░░██───────
#─██████████░░██─██░░██████████─██░░██████░░██─────██░░██─────██████─██░░██───────────────██░░██───────
#─██░░░░░░░░░░██─██░░░░░░░░░░██─██░░░░░░░░░░██─────██░░██─────██░░██─██░░██───────────────██░░██───────
#─██████████████─██████████████─██████████████─────██████─────██████─██████───────────────██████───────
#──────────────────────────────────────────────────────────────────────────────────────────────────────
import discord
from discord.ext import commands
import random
from main import update_balance, get_balance
class Slut(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.command(name='slut')
@commands.cooldown(1, 7200, commands.BucketType.user)
async def slut(self, ctx):
user_id = ctx.author.id
outcome = random.choice(['win', 'fail'])
if outcome == 'win':
earnings = random.randint(500, 2000)
update_balance(user_id, earnings)
await ctx.send(f'¡Tuviste suerte, {ctx.author.mention}! Ganaste **${earnings:,}**.')
else:
current_balance = get_balance(user_id)
loss = min(current_balance, random.randint(200, 1000))
if loss > 0:
update_balance(user_id, -loss)
await ctx.send(f'¡Oh no, {ctx.author.mention}! Te descubrieron y perdiste **${loss:,}**.')
else:
await ctx.send(f'{ctx.author.mention}, intentaste pero no tenías nada que perder.')
@slut.error
async def slut_error(self, ctx, error):
if isinstance(error, commands.CommandOnCooldown):
seconds = int(error.retry_after)
minutes, seconds = divmod(seconds, 60)
hours, minutes = divmod(minutes, 60)
await ctx.send(f'Necesitas descansar. Inténtalo de nuevo en **{hours}h {minutes}m {seconds}s**.')
async def setup(bot):
await bot.add_cog(Slut(bot))
rob.py
#─────────────────────────────────────────────────────────────────────────────────────────────
#─████████████████───██████████████─██████████████──────────██████████████─████████──████████─
#─██░░░░░░░░░░░░██───██░░░░░░░░░░██─██░░░░░░░░░░██──────────██░░░░░░░░░░██─██░░░░██──██░░░░██─
#─██░░████████░░██───██░░██████░░██─██░░██████░░██──────────██░░██████░░██─████░░██──██░░████─
#─██░░██────██░░██───██░░██──██░░██─██░░██──██░░██──────────██░░██──██░░██───██░░░░██░░░░██───
#─██░░████████░░██───██░░██──██░░██─██░░██████░░████────────██░░██████░░██───████░░░░░░████───
#─██░░░░░░░░░░░░██───██░░██──██░░██─██░░░░░░░░░░░░██────────██░░░░░░░░░░██─────████░░████─────
#─██░░██████░░████───██░░██──██░░██─██░░████████░░██────────██░░██████████───────██░░██───────
#─██░░██──██░░██─────██░░██──██░░██─██░░██────██░░██────────██░░██───────────────██░░██───────
#─██░░██──██░░██████─██░░██████░░██─██░░████████░░██─██████─██░░██───────────────██░░██───────
#─██░░██──██░░░░░░██─██░░░░░░░░░░██─██░░░░░░░░░░░░██─██░░██─██░░██───────────────██░░██───────
#─██████──██████████─██████████████─████████████████─██████─██████───────────────██████───────
#─────────────────────────────────────────────────────────────────────────────────────────────
import discord
from discord.ext import commands
import random
from main import update_balance, get_balance
class Rob(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.command(name='rob')
@commands.cooldown(1, 14400, commands.BucketType.user)
async def rob(self, ctx, member: discord.Member):
"""Intenta robarle dinero a otro usuario."""
robber_id = ctx.author.id
victim_id = member.id
if robber_id == victim_id:
await ctx.send("No puedes robarte a ti mismo.")
self.rob.reset_cooldown(ctx)
return
victim_balance = get_balance(victim_id)
if victim_balance < 200:
await ctx.send(f"**{member.display_name}** es demasiado pobre, no vale la pena robarle.")
self.rob.reset_cooldown(ctx)
return
success = random.choice([True, False])
if success:
amount_stolen = int(victim_balance * random.uniform(0.1, 0.4))
update_balance(robber_id, amount_stolen)
update_balance(victim_id, -amount_stolen)
await ctx.send(f"¡Éxito! {ctx.author.mention} le robó **${amount_stolen:,}** a {member.mention}.")
else:
robber_balance = get_balance(robber_id)
fine = min(robber_balance, int(victim_balance * random.uniform(0.05, 0.2)))
if fine > 0:
update_balance(robber_id, -fine)
await ctx.send(f"¡Fallaste! {ctx.author.mention} fue atrapado y tuvo que pagar una multa de **${fine:,}**.")
else:
await ctx.send(f"¡Fallaste! {ctx.author.mention} fue atrapado, pero no tenías dinero para la multa.")
@rob.error
async def rob_error(self, ctx, error):
if isinstance(error, commands.CommandOnCooldown):
seconds = int(error.retry_after)
minutes, seconds = divmod(seconds, 60)
hours, minutes = divmod(minutes, 60)
await ctx.send(f'La policía te está buscando. Podrás volver a robar en **{hours}h {minutes}m {seconds}s**.')
elif isinstance(error, commands.MissingRequiredArgument):
await ctx.send("Debes mencionar a quién quieres robar. Uso: `$rob @usuario`")
async def setup(bot):
await bot.add_cog(Rob(bot))
crime.py
#─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
#─██████████████─████████████████───██████████─██████──────────██████─██████████████────────██████████████─████████──████████─
#─██░░░░░░░░░░██─██░░░░░░░░░░░░██───██░░░░░░██─██░░██████████████░░██─██░░░░░░░░░░██────────██░░░░░░░░░░██─██░░░░██──██░░░░██─
#─██░░██████████─██░░████████░░██───████░░████─██░░░░░░░░░░░░░░░░░░██─██░░██████████────────██░░██████░░██─████░░██──██░░████─
#─██░░██─────────██░░██────██░░██─────██░░██───██░░██████░░██████░░██─██░░██────────────────██░░██──██░░██───██░░░░██░░░░██───
#─██░░██─────────██░░████████░░██─────██░░██───██░░██──██░░██──██░░██─██░░██████████────────██░░██████░░██───████░░░░░░████───
#─██░░██─────────██░░░░░░░░░░░░██─────██░░██───██░░██──██░░██──██░░██─██░░░░░░░░░░██────────██░░░░░░░░░░██─────████░░████─────
#─██░░██─────────██░░██████░░████─────██░░██───██░░██──██████──██░░██─██░░██████████────────██░░██████████───────██░░██───────
#─██░░██─────────██░░██──██░░██───────██░░██───██░░██──────────██░░██─██░░██────────────────██░░██───────────────██░░██───────
#─██░░██████████─██░░██──██░░██████─████░░████─██░░██──────────██░░██─██░░██████████─██████─██░░██───────────────██░░██───────
#─██░░░░░░░░░░██─██░░██──██░░░░░░██─██░░░░░░██─██░░██──────────██░░██─██░░░░░░░░░░██─██░░██─██░░██───────────────██░░██───────
#─██████████████─██████──██████████─██████████─██████──────────██████─██████████████─██████─██████───────────────██████───────
#─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────█
import discord
from discord.ext import commands
import random
from main import update_balance, get_balance
class Crime(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.command(name='crime')
@commands.cooldown(1, 1800, commands.BucketType.user)
async def crime(self, ctx):
user_id = ctx.author.id
success_chance = random.randint(1, 100)
if success_chance > 40:
earnings = random.randint(250, 1500)
update_balance(user_id, earnings)
await ctx.send(f'¡Escape perfecto, {ctx.author.mention}! Robaste **${earnings:,}**.')
else:
current_balance = get_balance(user_id)
fine = min(current_balance, random.randint(100, 800))
if fine > 0:
update_balance(user_id, -fine)
await ctx.send(f'¡Te atraparon, {ctx.author.mention}! Tuviste que pagar una multa de **${fine:,}**.')
else:
await ctx.send(f'{ctx.author.mention}, intentaste un crimen pero no tenías dinero para la multa.')
@crime.error
async def crime_error(self, ctx, error):
if isinstance(error, commands.CommandOnCooldown):
seconds = int(error.retry_after)
minutes, seconds = divmod(seconds, 60)
await ctx.send(f'Estás bajo vigilancia. Intenta otro crimen en **{minutes}m {seconds}s**.')
async def setup(bot):
await bot.add_cog(Crime(bot))
Comentarios (0)
Inicia sesión para comentar
¡Aún no hay comentarios. Sé el primero en comentar!