Skip to content

Commit

Permalink
Merge pull request #11734 from PennyDreadfulMTG/channelless-dms
Browse files Browse the repository at this point in the history
Fix intermitant error when running commands in DMs?
  • Loading branch information
mergify[bot] authored Nov 21, 2023
2 parents c179a7d + f404ac8 commit d8021de
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion discordbot/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,9 @@ async def single_card_text(self: 'MtgContext', c: Card, f: Callable, show_legali
return

not_pd = configuration.get_list('not_pd')
if str(self.channel.id) in not_pd:
if not self.channel:
pass # Not sure how we got here, but it happened
elif str(self.channel.id) in not_pd:
show_legality = False
elif not isinstance(self.channel, (DM, DMGroup)) and str(self.channel.guild.id) in not_pd:
show_legality = False
Expand Down

0 comments on commit d8021de

Please sign in to comment.