Skip to content

Commit fb0c3e4

Browse files
committed
Catch bad log_channel to make close more robust
1 parent 371806d commit fb0c3e4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

core/thread.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,9 +261,11 @@ async def _close(self, closer, silent=False, delete_channel=True,
261261
tasks = [
262262
self.bot.config.update()
263263
]
264-
265-
if self.bot.log_channel:
264+
265+
try:
266266
tasks.append(self.bot.log_channel.send(embed=embed))
267+
except (ValueError, AttributeError):
268+
pass
267269

268270
# Thread closed message
269271

0 commit comments

Comments
 (0)