Update main.py

This commit is contained in:
Elmon11 2020-10-25 16:01:12 +01:00 committed by GitHub
parent e88c1e674e
commit c573bacc50
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -73,7 +73,7 @@ async def on_raw_reaction_add(payload):
else:
for role_id, msg_id, emoji in bot.reaction_roles:
if msg_id == payload.message_id and emoji == str(payload.emoji.name.encode('utf-8')):
await payload.member.add_roles(bot.get_guild(payload.guild_id).get_role(role_id))
await payload.member.add_roles(bot.get_guild(payload.guild_id).get_role(role_id), reason='reaction')
@bot.event
async def on_raw_reaction_remove(payload):
@ -82,7 +82,7 @@ async def on_raw_reaction_remove(payload):
else:
for role_id, msg_id, emoji in bot.reaction_roles:
if msg_id == payload.message_id and emoji == str(payload.emoji.name.encode('utf-8')):
await bot.get_guild(payload.guild_id).get_member(payload.user_id).remove_roles(bot.get_guild(payload.guild_id).get_role(role_id))
await bot.get_guild(payload.guild_id).get_member(payload.user_id).remove_roles(bot.get_guild(payload.guild_id).get_role(role_id), reason='reaction')
@bot.command()
@commands.has_permissions(manage_roles=True)
@ -169,4 +169,4 @@ async def debug(ctx, *, cmd):
await ctx.send(f'''```py
{result}```''')
bot.run(botToken)
bot.run(botToken)