@@ -390,18 +390,17 @@ async def restore_from_snooze(self):
390390 except Exception :
391391 logger .error ("Failed to recreate thread channel during unsnooze." , exc_info = True )
392392 return False
393+
393394 # Helper to safely send to thread channel, recreating once if deleted
394395 async def _safe_send_to_channel (* , content = None , embeds = None , allowed_mentions = None ):
395396 nonlocal channel
396397 try :
397- return await channel .send (
398- content = content , embeds = embeds , allowed_mentions = allowed_mentions
399- )
398+ return await channel .send (content = content , embeds = embeds , allowed_mentions = allowed_mentions )
400399 except discord .NotFound :
401400 # Channel was deleted between restore and send; try to recreate once
402401 try :
403402 ow_map : dict = {}
404- for role_id , perm_values in ( self .snooze_data .get ("overwrites" , []) or []) :
403+ for role_id , perm_values in self .snooze_data .get ("overwrites" , []) or []:
405404 target = guild .get_role (role_id ) or guild .get_member (role_id )
406405 if target is None :
407406 continue
@@ -528,9 +527,7 @@ async def _safe_send_to_channel(*, content=None, embeds=None, allowed_mentions=N
528527 notify_channel = self .bot .config .get ("unsnooze_notify_channel" ) or "thread"
529528 notify_text = self .bot .config .get ("unsnooze_text" ) or "This thread has been unsnoozed and restored."
530529 if notify_channel == "thread" :
531- await _safe_send_to_channel (
532- content = notify_text , allowed_mentions = discord .AllowedMentions .none ()
533- )
530+ await _safe_send_to_channel (content = notify_text , allowed_mentions = discord .AllowedMentions .none ())
534531 else :
535532 ch = self .bot .get_channel (int (notify_channel ))
536533 if ch :
@@ -926,9 +923,7 @@ async def _close(self, closer, silent=False, delete_channel=True, message=None,
926923 view = None
927924 if self .bot .config .get ("show_log_url_button" ) and log_url :
928925 view = discord .ui .View ()
929- view .add_item (
930- discord .ui .Button (label = "Log link" , url = log_url , style = discord .ButtonStyle .url )
931- )
926+ view .add_item (discord .ui .Button (label = "Log link" , url = log_url , style = discord .ButtonStyle .url ))
932927 tasks .append (self .bot .log_channel .send (embed = embed , view = view ))
933928
934929 # Thread closed message
0 commit comments