cambio 38562138562

This commit is contained in:
binlaab
2023-10-28 19:05:26 +02:00
parent ccceefc7e7
commit 1114b7207c

13
main.py
View File

@@ -43,12 +43,13 @@ async def on_message(message):
@bot.command(description="Añade una característica más de Arnau!")
async def add(ctx, attr: str, user: str):
if user == "Juan":
async def add(ctx, attr: str, user: discord.Option(choices=[os.environ['N1'], os.environ['N2']])):
msg = 0
if user == os.environ['N1']:
channel = bot.get_channel(1166495380003889232)
msg = await channel.fetch_message(1167496435944652891)
elif user == "Arnau":
elif user == os.environ['N2']:
channel = bot.get_channel(1153429735527948399)
msg = await channel.fetch_message(1153429808429158460)
@@ -62,7 +63,7 @@ async def add(ctx, attr: str, user: str):
@bot.command(description="Borrar una característica de Arnau (sólo admins)")
async def delete(ctx, attr: discord.Option(str)):
async def delete(ctx, attr: discord.Option(choices=[os.environ['N1'], os.environ['N2']])):
channel = bot.get_channel(1153429735527948399)
msg = await channel.fetch_message(1153429808429158460)
role = discord.utils.get(ctx.guild.roles, name="Admin")
@@ -73,7 +74,7 @@ async def delete(ctx, attr: discord.Option(str)):
await send_log(f"Característica eliminada: {attr} por {ctx.user}")
return
if role not in ctx.author.roles or ctx.author.id == 676816739065004043:
if role not in ctx.author.roles or ctx.author.id == os.environ['AID'] or ctx.author.id == os.environ['JID']:
await ctx.respond("No tienes permiso para hacerlo!", ephemeral=True)
return
@@ -116,6 +117,4 @@ Disfrutad del bot
if __name__ == '__main__':
parse_cmds("cmds.txt")
make_help()
bot.add_application_command(add)
bot.add_application_command(delete)
bot.run(os.environ['TOKEN'])