Skip to content

Commit

Permalink
main.py fix
Browse files Browse the repository at this point in the history
  • Loading branch information
yakMM committed Nov 14, 2021
1 parent 7b343c7 commit 3a78548
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions bot/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,6 @@ async def on_command_error(ctx, error):
await disp.UNKNOWN_ERROR.send(ctx, type(original).__name__)
raise error

# Reaction update handler (for rule acceptance)
@client.event
# Has to be on_raw cause the message already exists when the bot starts


@client.event
async def on_member_join(member):
player = Player.get(member.id)
Expand Down Expand Up @@ -176,10 +171,11 @@ async def on_ready():
# fetch rule message, remove all reaction but the bot's
channel = client.get_channel(cfg.channels["rules"])
msg = await channel.fetch_message(channel.last_message_id)
ctx = _interactions_handler.get_new_context(msg)
if msg.author.id == client.user.id:
ctx = _interactions_handler.get_new_context(msg)
await disp.RULES.edit(ctx)
else:
ctx = _interactions_handler.get_new_context(channel)
await disp.RULES.send(ctx)

# Update all players roles
Expand Down

0 comments on commit 3a78548

Please sign in to comment.