Skip to content
This repository has been archived by the owner on Mar 1, 2022. It is now read-only.

Commit

Permalink
Fix cancel bug in session
Browse files Browse the repository at this point in the history
Fixes a bug where certain parts of session were passing `ctx` to cancel when not required.
  • Loading branch information
EvieePy authored Nov 3, 2019
1 parent ffa9ba6 commit a0dd227
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions discord/ext/buttons/buttons.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ async def _session_loop(self, ctx):
future.cancel()

if not done:
return ctx.bot.loop.create_task(self.cancel(ctx))
return ctx.bot.loop.create_task(self.cancel())

try:
result = done.pop()
Expand All @@ -126,7 +126,7 @@ async def _session_loop(self, ctx):
else:
action = False
except Exception:
return ctx.bot.loop.create_task(self.cancel(ctx))
return ctx.bot.loop.create_task(self.cancel())

emoji = self.get_emoji_as_string(payload.emoji)
button = self.buttons[emoji]
Expand Down

0 comments on commit a0dd227

Please sign in to comment.