Skip to content

Commit f5bf8b8

Browse files
committed
Fixed an error when deleting a catagory
1 parent 35d75bd commit f5bf8b8

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

bot.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,9 @@ async def on_guild_channel_delete(self, channel):
438438
if mod == self.user:
439439
return
440440

441+
if not isinstance(channel, discord.TextChannel):
442+
return
443+
441444
thread = await self.threads.find(channel=channel)
442445
if not thread:
443446
return

core/thread.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ async def _find_from_channel(self, channel):
503503
if user_id in self.cache:
504504
return self.cache[user_id]
505505

506-
recipient = self.bot.get_user(user_id) # this could be None
506+
recipient = self.bot.get_user(user_id)
507507
if recipient is None:
508508
self.cache[user_id] = thread = Thread(self, user_id, channel)
509509
else:

0 commit comments

Comments
 (0)