Skip to content

Commit 0f9b9bb

Browse files
Fix DMChannel AttributeError in viraj cog (#10)
* fix: handle DMChannel missing category_id in viraj cog Co-Authored-By: Oliver Ni <oliver.ni@gmail.com> * fix: skip DMs entirely instead of using getattr Co-Authored-By: Oliver Ni <oliver.ni@gmail.com> --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: Oliver Ni <oliver.ni@gmail.com>
1 parent 88b8bc3 commit 0f9b9bb

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

bmt_discord_bot/cogs/viraj.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ def _correct_text(self, match):
2626
async def on_message(self, message):
2727
if message.author.bot:
2828
return
29+
if message.guild is None:
30+
return
2931
if message.channel.category_id in IGNORED_CATEGORY_IDS:
3032
return
3133
if "proctor" in message.content.casefold() and random.random() < 0.05:

0 commit comments

Comments
 (0)