@@ -50,9 +50,7 @@ async def setup(self, ctx):
50
50
51
51
if self .bot .modmail_guild is None :
52
52
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 ,
56
54
)
57
55
return await ctx .send (embed = embed )
58
56
@@ -184,9 +182,7 @@ async def snippet_raw(self, ctx, *, name: str.lower):
184
182
else :
185
183
val = truncate (escape_code_block (val ), 2048 - 7 )
186
184
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 ,
190
186
)
191
187
192
188
return await ctx .send (embed = embed )
@@ -208,9 +204,7 @@ async def snippet_add(self, ctx, name: str.lower, *, value: commands.clean_conte
208
204
"""
209
205
if name in self .bot .snippets :
210
206
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." ,
214
208
)
215
209
return await ctx .send (embed = embed )
216
210
@@ -234,9 +228,7 @@ async def snippet_add(self, ctx, name: str.lower, *, value: commands.clean_conte
234
228
await self .bot .config .update ()
235
229
236
230
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." ,
240
232
)
241
233
return await ctx .send (embed = embed )
242
234
@@ -453,8 +445,7 @@ async def notify(self, ctx, *, user_or_role: Union[discord.Role, User, str.lower
453
445
454
446
if mention in mentions :
455
447
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." ,
458
449
)
459
450
else :
460
451
mentions .append (mention )
@@ -489,8 +480,7 @@ async def unnotify(self, ctx, *, user_or_role: Union[discord.Role, User, str.low
489
480
490
481
if mention not in mentions :
491
482
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." ,
494
484
)
495
485
else :
496
486
mentions .remove (mention )
@@ -526,8 +516,7 @@ async def subscribe(self, ctx, *, user_or_role: Union[discord.Role, User, str.lo
526
516
527
517
if mention in mentions :
528
518
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." ,
531
520
)
532
521
else :
533
522
mentions .append (mention )
@@ -562,15 +551,13 @@ async def unsubscribe(self, ctx, *, user_or_role: Union[discord.Role, User, str.
562
551
563
552
if mention not in mentions :
564
553
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." ,
567
555
)
568
556
else :
569
557
mentions .remove (mention )
570
558
await self .bot .config .update ()
571
559
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." ,
574
561
)
575
562
return await ctx .send (embed = embed )
576
563
@@ -697,8 +684,7 @@ async def logs(self, ctx, *, user: User = None):
697
684
698
685
if not any (not log ["open" ] for log in logs ):
699
686
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." ,
702
688
)
703
689
return await ctx .send (embed = embed )
704
690
@@ -725,8 +711,7 @@ async def logs_closed_by(self, ctx, *, user: User = None):
725
711
726
712
if not embeds :
727
713
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." ,
730
715
)
731
716
return await ctx .send (embed = embed )
732
717
@@ -745,9 +730,7 @@ async def logs_delete(self, ctx, key_or_link: str):
745
730
746
731
if not success :
747
732
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 ,
751
734
)
752
735
else :
753
736
embed = discord .Embed (
@@ -800,8 +783,7 @@ async def logs_search(self, ctx, limit: Optional[int] = None, *, query):
800
783
801
784
if not embeds :
802
785
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." ,
805
787
)
806
788
return await ctx .send (embed = embed )
807
789
@@ -1012,10 +994,7 @@ async def contact(
1012
994
1013
995
else :
1014
996
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 ,
1019
998
)
1020
999
if thread .cancelled :
1021
1000
return
@@ -1029,11 +1008,7 @@ async def contact(
1029
1008
else :
1030
1009
description = f"{ ctx .author .name } has opened a Modmail thread."
1031
1010
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 ,)
1037
1012
if self .bot .config ["show_timestamp" ]:
1038
1013
em .timestamp = datetime .utcnow ()
1039
1014
em .set_footer (icon_url = ctx .author .avatar_url )
@@ -1075,8 +1050,7 @@ async def blocked(self, ctx):
1075
1050
end_time = re .search (r"%([^%]+?)%" , reason )
1076
1051
if end_time is not None :
1077
1052
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_ ,
1080
1054
)
1081
1055
1082
1056
if end_time is not None :
@@ -1107,8 +1081,7 @@ async def blocked(self, ctx):
1107
1081
end_time = re .search (r"%([^%]+?)%" , reason )
1108
1082
if end_time is not None :
1109
1083
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_ ,
1112
1085
)
1113
1086
1114
1087
if end_time is not None :
@@ -1130,9 +1103,7 @@ async def blocked(self, ctx):
1130
1103
line = mention + f" - { reason or 'No Reason Provided' } \n "
1131
1104
if len (embed .description ) + len (line ) > 2048 :
1132
1105
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 ,
1136
1107
)
1137
1108
embeds .append (embed )
1138
1109
else :
@@ -1149,9 +1120,7 @@ async def blocked(self, ctx):
1149
1120
line = mention + f" - { reason or 'No Reason Provided' } \n "
1150
1121
if len (embed .description ) + len (line ) > 2048 :
1151
1122
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 ,
1155
1124
)
1156
1125
embeds .append (embed )
1157
1126
else :
@@ -1211,9 +1180,7 @@ async def blocked_whitelist(self, ctx, *, user: User = None):
1211
1180
)
1212
1181
else :
1213
1182
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." ,
1217
1184
)
1218
1185
1219
1186
return await ctx .send (embed = embed )
@@ -1291,9 +1258,7 @@ async def block(
1291
1258
)
1292
1259
else :
1293
1260
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 } " ,
1297
1262
)
1298
1263
1299
1264
if isinstance (user_or_role , discord .Role ):
@@ -1356,9 +1321,7 @@ async def unblock(self, ctx, *, user_or_role: Union[User, Role] = None):
1356
1321
await self .bot .config .update ()
1357
1322
1358
1323
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." ,
1362
1325
)
1363
1326
else :
1364
1327
embed = discord .Embed (
@@ -1415,8 +1378,7 @@ async def repair(self, ctx):
1415
1378
1416
1379
# Search cache for channel
1417
1380
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 ),
1420
1382
)
1421
1383
if thread is not None :
1422
1384
logger .debug ("Found thread with tempered ID." )
0 commit comments