@@ -50,9 +50,7 @@ async def setup(self, ctx):
5050
5151 if self .bot .modmail_guild is None :
5252 embed = discord .Embed (
53- title = "Error" ,
54- description = "Modmail functioning guild not found." ,
55- color = self .bot .error_color ,
53+ title = "Error" , description = "Modmail functioning guild not found." , color = self .bot .error_color ,
5654 )
5755 return await ctx .send (embed = embed )
5856
@@ -184,9 +182,7 @@ async def snippet_raw(self, ctx, *, name: str.lower):
184182 else :
185183 val = truncate (escape_code_block (val ), 2048 - 7 )
186184 embed = discord .Embed (
187- title = f'Raw snippet - "{ name } ":' ,
188- description = f"```\n { val } ```" ,
189- color = self .bot .main_color ,
185+ title = f'Raw snippet - "{ name } ":' , description = f"```\n { val } ```" , color = self .bot .main_color ,
190186 )
191187
192188 return await ctx .send (embed = embed )
@@ -208,9 +204,7 @@ async def snippet_add(self, ctx, name: str.lower, *, value: commands.clean_conte
208204 """
209205 if name in self .bot .snippets :
210206 embed = discord .Embed (
211- title = "Error" ,
212- color = self .bot .error_color ,
213- description = f"Snippet `{ name } ` already exists." ,
207+ title = "Error" , color = self .bot .error_color , description = f"Snippet `{ name } ` already exists." ,
214208 )
215209 return await ctx .send (embed = embed )
216210
@@ -234,9 +228,7 @@ async def snippet_add(self, ctx, name: str.lower, *, value: commands.clean_conte
234228 await self .bot .config .update ()
235229
236230 embed = discord .Embed (
237- title = "Added snippet" ,
238- color = self .bot .main_color ,
239- description = "Successfully created snippet." ,
231+ title = "Added snippet" , color = self .bot .main_color , description = "Successfully created snippet." ,
240232 )
241233 return await ctx .send (embed = embed )
242234
@@ -453,8 +445,7 @@ async def notify(self, ctx, *, user_or_role: Union[discord.Role, User, str.lower
453445
454446 if mention in mentions :
455447 embed = discord .Embed (
456- color = self .bot .error_color ,
457- description = f"{ mention } is already going to be mentioned." ,
448+ color = self .bot .error_color , description = f"{ mention } is already going to be mentioned." ,
458449 )
459450 else :
460451 mentions .append (mention )
@@ -489,8 +480,7 @@ async def unnotify(self, ctx, *, user_or_role: Union[discord.Role, User, str.low
489480
490481 if mention not in mentions :
491482 embed = discord .Embed (
492- color = self .bot .error_color ,
493- description = f"{ mention } does not have a pending notification." ,
483+ color = self .bot .error_color , description = f"{ mention } does not have a pending notification." ,
494484 )
495485 else :
496486 mentions .remove (mention )
@@ -526,8 +516,7 @@ async def subscribe(self, ctx, *, user_or_role: Union[discord.Role, User, str.lo
526516
527517 if mention in mentions :
528518 embed = discord .Embed (
529- color = self .bot .error_color ,
530- description = f"{ mention } is already subscribed to this thread." ,
519+ color = self .bot .error_color , description = f"{ mention } is already subscribed to this thread." ,
531520 )
532521 else :
533522 mentions .append (mention )
@@ -562,15 +551,13 @@ async def unsubscribe(self, ctx, *, user_or_role: Union[discord.Role, User, str.
562551
563552 if mention not in mentions :
564553 embed = discord .Embed (
565- color = self .bot .error_color ,
566- description = f"{ mention } is not subscribed to this thread." ,
554+ color = self .bot .error_color , description = f"{ mention } is not subscribed to this thread." ,
567555 )
568556 else :
569557 mentions .remove (mention )
570558 await self .bot .config .update ()
571559 embed = discord .Embed (
572- color = self .bot .main_color ,
573- description = f"{ mention } is now unsubscribed from this thread." ,
560+ color = self .bot .main_color , description = f"{ mention } is now unsubscribed from this thread." ,
574561 )
575562 return await ctx .send (embed = embed )
576563
@@ -697,8 +684,7 @@ async def logs(self, ctx, *, user: User = None):
697684
698685 if not any (not log ["open" ] for log in logs ):
699686 embed = discord .Embed (
700- color = self .bot .error_color ,
701- description = "This user does not have any previous logs." ,
687+ color = self .bot .error_color , description = "This user does not have any previous logs." ,
702688 )
703689 return await ctx .send (embed = embed )
704690
@@ -725,8 +711,7 @@ async def logs_closed_by(self, ctx, *, user: User = None):
725711
726712 if not embeds :
727713 embed = discord .Embed (
728- color = self .bot .error_color ,
729- description = "No log entries have been found for that query." ,
714+ color = self .bot .error_color , description = "No log entries have been found for that query." ,
730715 )
731716 return await ctx .send (embed = embed )
732717
@@ -745,9 +730,7 @@ async def logs_delete(self, ctx, key_or_link: str):
745730
746731 if not success :
747732 embed = discord .Embed (
748- title = "Error" ,
749- description = f"Log entry `{ key } ` not found." ,
750- color = self .bot .error_color ,
733+ title = "Error" , description = f"Log entry `{ key } ` not found." , color = self .bot .error_color ,
751734 )
752735 else :
753736 embed = discord .Embed (
@@ -800,8 +783,7 @@ async def logs_search(self, ctx, limit: Optional[int] = None, *, query):
800783
801784 if not embeds :
802785 embed = discord .Embed (
803- color = self .bot .error_color ,
804- description = "No log entries have been found for that query." ,
786+ color = self .bot .error_color , description = "No log entries have been found for that query." ,
805787 )
806788 return await ctx .send (embed = embed )
807789
@@ -1012,10 +994,7 @@ async def contact(
1012994
1013995 else :
1014996 thread = await self .bot .threads .create (
1015- recipient = user ,
1016- creator = ctx .author ,
1017- category = category ,
1018- manual_trigger = manual_trigger ,
997+ recipient = user , creator = ctx .author , category = category , manual_trigger = manual_trigger ,
1019998 )
1020999 if thread .cancelled :
10211000 return
@@ -1029,11 +1008,7 @@ async def contact(
10291008 else :
10301009 description = f"{ ctx .author .name } has opened a Modmail thread."
10311010
1032- em = discord .Embed (
1033- title = "New Thread" ,
1034- description = description ,
1035- color = self .bot .main_color ,
1036- )
1011+ em = discord .Embed (title = "New Thread" , description = description , color = self .bot .main_color ,)
10371012 if self .bot .config ["show_timestamp" ]:
10381013 em .timestamp = datetime .utcnow ()
10391014 em .set_footer (icon_url = ctx .author .avatar_url )
@@ -1075,8 +1050,7 @@ async def blocked(self, ctx):
10751050 end_time = re .search (r"%([^%]+?)%" , reason )
10761051 if end_time is not None :
10771052 logger .warning (
1078- r"Deprecated time message for user %s, block and unblock again to update." ,
1079- id_ ,
1053+ r"Deprecated time message for user %s, block and unblock again to update." , id_ ,
10801054 )
10811055
10821056 if end_time is not None :
@@ -1107,8 +1081,7 @@ async def blocked(self, ctx):
11071081 end_time = re .search (r"%([^%]+?)%" , reason )
11081082 if end_time is not None :
11091083 logger .warning (
1110- r"Deprecated time message for role %s, block and unblock again to update." ,
1111- id_ ,
1084+ r"Deprecated time message for role %s, block and unblock again to update." , id_ ,
11121085 )
11131086
11141087 if end_time is not None :
@@ -1130,9 +1103,7 @@ async def blocked(self, ctx):
11301103 line = mention + f" - { reason or 'No Reason Provided' } \n "
11311104 if len (embed .description ) + len (line ) > 2048 :
11321105 embed = discord .Embed (
1133- title = "Blocked Users (Continued)" ,
1134- color = self .bot .main_color ,
1135- description = line ,
1106+ title = "Blocked Users (Continued)" , color = self .bot .main_color , description = line ,
11361107 )
11371108 embeds .append (embed )
11381109 else :
@@ -1149,9 +1120,7 @@ async def blocked(self, ctx):
11491120 line = mention + f" - { reason or 'No Reason Provided' } \n "
11501121 if len (embed .description ) + len (line ) > 2048 :
11511122 embed = discord .Embed (
1152- title = "Blocked Roles (Continued)" ,
1153- color = self .bot .main_color ,
1154- description = line ,
1123+ title = "Blocked Roles (Continued)" , color = self .bot .main_color , description = line ,
11551124 )
11561125 embeds .append (embed )
11571126 else :
@@ -1211,9 +1180,7 @@ async def blocked_whitelist(self, ctx, *, user: User = None):
12111180 )
12121181 else :
12131182 embed = discord .Embed (
1214- title = "Success" ,
1215- color = self .bot .main_color ,
1216- description = f"{ mention } is now whitelisted." ,
1183+ title = "Success" , color = self .bot .main_color , description = f"{ mention } is now whitelisted." ,
12171184 )
12181185
12191186 return await ctx .send (embed = embed )
@@ -1291,9 +1258,7 @@ async def block(
12911258 )
12921259 else :
12931260 embed = discord .Embed (
1294- title = "Success" ,
1295- color = self .bot .main_color ,
1296- description = f"{ mention } is now blocked { reason } " ,
1261+ title = "Success" , color = self .bot .main_color , description = f"{ mention } is now blocked { reason } " ,
12971262 )
12981263
12991264 if isinstance (user_or_role , discord .Role ):
@@ -1356,9 +1321,7 @@ async def unblock(self, ctx, *, user_or_role: Union[User, Role] = None):
13561321 await self .bot .config .update ()
13571322
13581323 embed = discord .Embed (
1359- title = "Success" ,
1360- color = self .bot .main_color ,
1361- description = f"{ mention } is no longer blocked." ,
1324+ title = "Success" , color = self .bot .main_color , description = f"{ mention } is no longer blocked." ,
13621325 )
13631326 else :
13641327 embed = discord .Embed (
@@ -1415,8 +1378,7 @@ async def repair(self, ctx):
14151378
14161379 # Search cache for channel
14171380 user_id , thread = next (
1418- ((k , v ) for k , v in self .bot .threads .cache .items () if v .channel == ctx .channel ),
1419- (- 1 , None ),
1381+ ((k , v ) for k , v in self .bot .threads .cache .items () if v .channel == ctx .channel ), (- 1 , None ),
14201382 )
14211383 if thread is not None :
14221384 logger .debug ("Found thread with tempered ID." )
0 commit comments