Skip to content

Commit

Permalink
Merge pull request #62 from Edwinexd/patch-6
Browse files Browse the repository at this point in the history
  • Loading branch information
eibex authored Feb 19, 2021
2 parents 041c63e + e60d9a8 commit f4a69a3
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,7 @@ async def getchannel(channel_id):
channel = bot.get_channel(channel_id)

if not channel:
try:
channel = await bot.fetch_channel(channel_id)
except discord.InvalidData:
channel = None
except discord.HTTPException:
channel = None
channel = await bot.fetch_channel(channel_id)

return channel

Expand Down Expand Up @@ -737,9 +732,15 @@ def reaction_check3(payload):
"raw_reaction_add", timeout=120, check=reaction_check3
)
try:
channel = await getchannel(
oldmessage_response_payload.channel_id
)
try:
channel = await getchannel(
oldmessage_response_payload.channel_id
)
except discord.InvalidData:
channel = None
except discord.HTTPException:
channel = None

if channel is None:
raise discord.NotFound
try:
Expand Down

0 comments on commit f4a69a3

Please sign in to comment.