cambio 38562138562
This commit is contained in:
13
main.py
13
main.py
@@ -43,12 +43,13 @@ async def on_message(message):
|
|||||||
|
|
||||||
|
|
||||||
@bot.command(description="Añade una característica más de Arnau!")
|
@bot.command(description="Añade una característica más de Arnau!")
|
||||||
async def add(ctx, attr: str, user: str):
|
async def add(ctx, attr: str, user: discord.Option(choices=[os.environ['N1'], os.environ['N2']])):
|
||||||
if user == "Juan":
|
msg = 0
|
||||||
|
if user == os.environ['N1']:
|
||||||
channel = bot.get_channel(1166495380003889232)
|
channel = bot.get_channel(1166495380003889232)
|
||||||
msg = await channel.fetch_message(1167496435944652891)
|
msg = await channel.fetch_message(1167496435944652891)
|
||||||
|
|
||||||
elif user == "Arnau":
|
elif user == os.environ['N2']:
|
||||||
channel = bot.get_channel(1153429735527948399)
|
channel = bot.get_channel(1153429735527948399)
|
||||||
msg = await channel.fetch_message(1153429808429158460)
|
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)")
|
@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)
|
channel = bot.get_channel(1153429735527948399)
|
||||||
msg = await channel.fetch_message(1153429808429158460)
|
msg = await channel.fetch_message(1153429808429158460)
|
||||||
role = discord.utils.get(ctx.guild.roles, name="Admin")
|
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}")
|
await send_log(f"Característica eliminada: {attr} por {ctx.user}")
|
||||||
return
|
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)
|
await ctx.respond("No tienes permiso para hacerlo!", ephemeral=True)
|
||||||
return
|
return
|
||||||
|
|
||||||
@@ -116,6 +117,4 @@ Disfrutad del bot
|
|||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
parse_cmds("cmds.txt")
|
parse_cmds("cmds.txt")
|
||||||
make_help()
|
make_help()
|
||||||
bot.add_application_command(add)
|
|
||||||
bot.add_application_command(delete)
|
|
||||||
bot.run(os.environ['TOKEN'])
|
bot.run(os.environ['TOKEN'])
|
||||||
|
|||||||
Reference in New Issue
Block a user