@@ -111,15 +111,11 @@ def cancelled(self, flag: bool):
111111 i .cancel ()
112112
113113 @classmethod
114- async def from_channel (
115- cls , manager : "ThreadManager" , channel : discord .TextChannel
116- ) -> "Thread" :
114+ async def from_channel (cls , manager : "ThreadManager" , channel : discord .TextChannel ) -> "Thread" :
117115 recipient_id = match_user_id (
118116 channel .topic
119117 ) # there is a chance it grabs from another recipient's main thread
120- recipient = manager .bot .get_user (recipient_id ) or await manager .bot .fetch_user (
121- recipient_id
122- )
118+ recipient = manager .bot .get_user (recipient_id ) or await manager .bot .fetch_user (recipient_id )
123119
124120 other_recipients = match_other_recipients (channel .topic )
125121 for n , uid in enumerate (other_recipients ):
@@ -761,7 +757,11 @@ async def reply(self, message: discord.Message, anonymous: bool = False, plain:
761757 for user in self .recipients :
762758 user_msg_tasks .append (
763759 self .send (
764- message , destination = user , from_mod = True , anonymous = anonymous , plain = plain ,
760+ message ,
761+ destination = user ,
762+ from_mod = True ,
763+ anonymous = anonymous ,
764+ plain = plain ,
765765 )
766766 )
767767
@@ -1071,19 +1071,15 @@ async def set_title(self, title: str) -> None:
10711071 user_id = match_user_id (self .channel .topic )
10721072 ids = "," .join (i .id for i in self ._other_recipients )
10731073
1074- await self .channel .edit (
1075- topic = f"Title: { title } \n User ID: { user_id } \n Other Recipients: { ids } "
1076- )
1074+ await self .channel .edit (topic = f"Title: { title } \n User ID: { user_id } \n Other Recipients: { ids } " )
10771075
10781076 async def add_user (self , user : typing .Union [discord .Member , discord .User ]) -> None :
10791077 title = match_title (self .channel .topic )
10801078 user_id = match_user_id (self .channel .topic )
10811079 self ._other_recipients .append (user )
10821080
10831081 ids = "," .join (str (i .id ) for i in self ._other_recipients )
1084- await self .channel .edit (
1085- topic = f"Title: { title } \n User ID: { user_id } \n Other Recipients: { ids } "
1086- )
1082+ await self .channel .edit (topic = f"Title: { title } \n User ID: { user_id } \n Other Recipients: { ids } " )
10871083
10881084
10891085class ThreadManager :
@@ -1139,9 +1135,7 @@ async def find(
11391135 if not thread .cancelled and (
11401136 not thread .channel or not self .bot .get_channel (thread .channel .id )
11411137 ):
1142- logger .warning (
1143- "Found existing thread for %s but the channel is invalid." , recipient_id
1144- )
1138+ logger .warning ("Found existing thread for %s but the channel is invalid." , recipient_id )
11451139 await thread .close (closer = self .bot .user , silent = True , delete_channel = False )
11461140 thread = None
11471141 else :
@@ -1280,9 +1274,7 @@ async def create(
12801274 if str (r .emoji ) == deny_emoji :
12811275 thread .cancelled = True
12821276 self .bot .loop .create_task (
1283- destination .send (
1284- embed = discord .Embed (title = "Cancelled" , color = self .bot .error_color )
1285- )
1277+ destination .send (embed = discord .Embed (title = "Cancelled" , color = self .bot .error_color ))
12861278 )
12871279
12881280 async def remove_reactions ():
0 commit comments