@@ -41,12 +41,18 @@ async def setup(self, ctx):
41
41
42
42
if ctx .guild != self .bot .modmail_guild :
43
43
return await ctx .send (
44
- _ ("You can only setup in the Modmail guild: {guild_name}." .format (guild_name = self .bot .modmail_guild ))
44
+ _ (
45
+ "You can only setup in the Modmail guild: {guild_name}." .format (
46
+ guild_name = self .bot .modmail_guild
47
+ )
48
+ )
45
49
)
46
50
47
51
if self .bot .main_category is not None :
48
52
logger .debug ("Can't re-setup server, main_category is found." )
49
- return await ctx .send (_ ("{guild_name} is already set up." ).format (guild_name = self .bot .modmail_guild ))
53
+ return await ctx .send (
54
+ _ ("{guild_name} is already set up." ).format (guild_name = self .bot .modmail_guild )
55
+ )
50
56
51
57
if self .bot .modmail_guild is None :
52
58
embed = discord .Embed (
@@ -89,21 +95,27 @@ async def setup(self, ctx):
89
95
90
96
embed = discord .Embed (
91
97
title = _ ("Friendly Reminder" ),
92
- description = _ ("You may use the `{prefix}config set log_channel_id "
93
- "<channel-id>` command to set up a custom log channel, then you can delete this default "
94
- "{log_channel} log channel." ).format (prefix = self .bot .prefix , log_channel = log_channel .mention ),
98
+ description = _ (
99
+ "You may use the `{prefix}config set log_channel_id "
100
+ "<channel-id>` command to set up a custom log channel, then you can delete this default "
101
+ "{log_channel} log channel."
102
+ ).format (prefix = self .bot .prefix , log_channel = log_channel .mention ),
95
103
color = self .bot .main_color ,
96
104
)
97
105
98
106
embed .add_field (
99
107
name = _ ("Thanks for using the bot!" ),
100
- value = _ ("If you like what you see, consider giving the "
101
- "[repo a star](https://github.com/kyb3r/modmail) :star: or if you are "
102
- "feeling generous, check us out on [Patreon](https://patreon.com/kyber)!" ),
108
+ value = _ (
109
+ "If you like what you see, consider giving the "
110
+ "[repo a star](https://github.com/kyb3r/modmail) :star: or if you are "
111
+ "feeling generous, check us out on [Patreon](https://patreon.com/kyber)!"
112
+ ),
103
113
)
104
114
105
115
embed .set_footer (
106
- text = _ ('Type "{prefix}help" for a complete list of commands.' ).format (prefix = self .bot .prefix )
116
+ text = _ ('Type "{prefix}help" for a complete list of commands.' ).format (
117
+ prefix = self .bot .prefix
118
+ )
107
119
)
108
120
await log_channel .send (embed = embed )
109
121
@@ -112,12 +124,14 @@ async def setup(self, ctx):
112
124
113
125
await self .bot .config .update ()
114
126
await ctx .send (
115
- _ ("**Successfully set up server.**\n "
116
- "Consider setting permission levels "
117
- "to give access to roles or users the ability to use Modmail.\n \n "
118
- "Type:\n - `{prefix}permissions` and `{prefix}permissions add` "
119
- "for more info on setting permissions.\n "
120
- "- `{prefix}config help` for a list of available customizations." ).format (prefix = self .bot .prefix )
127
+ _ (
128
+ "**Successfully set up server.**\n "
129
+ "Consider setting permission levels "
130
+ "to give access to roles or users the ability to use Modmail.\n \n "
131
+ "Type:\n - `{prefix}permissions` and `{prefix}permissions add` "
132
+ "for more info on setting permissions.\n "
133
+ "- `{prefix}config help` for a list of available customizations."
134
+ ).format (prefix = self .bot .prefix )
121
135
)
122
136
123
137
if not self .bot .config ["command_permissions" ] and not self .bot .config ["level_permissions" ]:
@@ -224,7 +238,9 @@ async def snippet_add(self, ctx, name: str.lower, *, value: commands.clean_conte
224
238
embed = discord .Embed (
225
239
title = _ ("Error" ),
226
240
color = self .bot .error_color ,
227
- description = _ ("An alias with the same name already exists: `{name}`." ).format (name = name ),
241
+ description = _ ("An alias with the same name already exists: `{name}`." ).format (
242
+ name = name
243
+ ),
228
244
)
229
245
return await ctx .send (embed = embed )
230
246
@@ -323,16 +339,16 @@ async def send_scheduled_close_message(self, ctx, after, silent=False):
323
339
324
340
embed = discord .Embed (
325
341
title = _ ("Scheduled close" ),
326
- description = _ ("This thread will close {silent}in {time}." ).format (silent = silent , time = human_delta ),
342
+ description = _ ("This thread will close {silent}in {time}." ).format (
343
+ silent = silent , time = human_delta
344
+ ),
327
345
color = self .bot .error_color ,
328
346
)
329
347
330
348
if after .arg and not silent :
331
349
embed .add_field (name = _ ("Message" ), value = after .arg )
332
350
333
- embed .set_footer (
334
- text = _ ("Closing will be cancelled if a thread message is sent." )
335
- )
351
+ embed .set_footer (text = _ ("Closing will be cancelled if a thread message is sent." ))
336
352
embed .timestamp = after .dt
337
353
338
354
await ctx .send (embed = embed )
@@ -430,15 +446,18 @@ async def notify(
430
446
if mention in mentions :
431
447
embed = discord .Embed (
432
448
color = self .bot .error_color ,
433
- description = _ ("{mention} is already going to be mentioned." ).format (mention = mention ),
449
+ description = _ ("{mention} is already going to be mentioned." ).format (
450
+ mention = mention
451
+ ),
434
452
)
435
453
else :
436
454
mentions .append (mention )
437
455
await self .bot .config .update ()
438
456
embed = discord .Embed (
439
457
color = self .bot .main_color ,
440
- description = _ ("{mention} will be mentioned "
441
- "on the next message received." ).format (mention = mention ),
458
+ description = _ (
459
+ "{mention} will be mentioned " "on the next message received."
460
+ ).format (mention = mention ),
442
461
)
443
462
return await ctx .send (embed = embed )
444
463
@@ -469,7 +488,9 @@ async def unnotify(
469
488
if mention not in mentions :
470
489
embed = discord .Embed (
471
490
color = self .bot .error_color ,
472
- description = _ ("{mention} does not have a pending notification." ).format (mention = mention ),
491
+ description = _ ("{mention} does not have a pending notification." ).format (
492
+ mention = mention
493
+ ),
473
494
)
474
495
else :
475
496
mentions .remove (mention )
@@ -509,15 +530,18 @@ async def subscribe(
509
530
if mention in mentions :
510
531
embed = discord .Embed (
511
532
color = self .bot .error_color ,
512
- description = _ ("{mention} is already subscribed to this thread." ).format (mention = mention ),
533
+ description = _ ("{mention} is already subscribed to this thread." ).format (
534
+ mention = mention
535
+ ),
513
536
)
514
537
else :
515
538
mentions .append (mention )
516
539
await self .bot .config .update ()
517
540
embed = discord .Embed (
518
541
color = self .bot .main_color ,
519
- description = _ ("{mention} will now be "
520
- "notified of all messages received." ).format (mention = mention ),
542
+ description = _ (
543
+ "{mention} will now be " "notified of all messages received."
544
+ ).format (mention = mention ),
521
545
)
522
546
return await ctx .send (embed = embed )
523
547
@@ -548,14 +572,18 @@ async def unsubscribe(
548
572
if mention not in mentions :
549
573
embed = discord .Embed (
550
574
color = self .bot .error_color ,
551
- description = _ ("{mention} is not already subscribed to this thread." ).format (mention = mention ),
575
+ description = _ ("{mention} is not already subscribed to this thread." ).format (
576
+ mention = mention
577
+ ),
552
578
)
553
579
else :
554
580
mentions .remove (mention )
555
581
await self .bot .config .update ()
556
582
embed = discord .Embed (
557
583
color = self .bot .main_color ,
558
- description = _ ("{mention} is now unsubscribed to this thread." ).format (mention = mention ),
584
+ description = _ ("{mention} is now unsubscribed to this thread." ).format (
585
+ mention = mention
586
+ ),
559
587
)
560
588
return await ctx .send (embed = embed )
561
589
@@ -740,7 +768,9 @@ async def logs_responded(self, ctx, *, user: User = None):
740
768
if not embeds :
741
769
embed = discord .Embed (
742
770
color = self .bot .error_color ,
743
- description = _ ("{mention} has not responded to any threads." ).format (mention = getattr (user , 'mention' , user .id )),
771
+ description = _ ("{mention} has not responded to any threads." ).format (
772
+ mention = getattr (user , "mention" , user .id )
773
+ ),
744
774
)
745
775
return await ctx .send (embed = embed )
746
776
@@ -896,17 +926,17 @@ async def contact(
896
926
897
927
if user .bot :
898
928
embed = discord .Embed (
899
- color = self .bot .error_color ,
900
- description = _ ("Cannot start a thread with a bot." ),
929
+ color = self .bot .error_color , description = _ ("Cannot start a thread with a bot." ),
901
930
)
902
931
return await ctx .send (embed = embed )
903
932
904
933
exists = await self .bot .threads .find (recipient = user )
905
934
if exists :
906
935
embed = discord .Embed (
907
936
color = self .bot .error_color ,
908
- description = _ ("A thread for this user already "
909
- "exists in {mention}." ).format (mention = exists .channel .mention ),
937
+ description = _ ("A thread for this user already " "exists in {mention}." ).format (
938
+ mention = exists .channel .mention
939
+ ),
910
940
)
911
941
await ctx .channel .send (embed = embed )
912
942
@@ -917,8 +947,9 @@ async def contact(
917
947
918
948
embed = discord .Embed (
919
949
title = _ ("Created Thread" ),
920
- description = _ ("Thread started by {author_mention} "
921
- "for {user_mention}." ).format (author_mention = ctx .author .mention , user_mention = user .mention ),
950
+ description = _ ("Thread started by {author_mention} " "for {user_mention}." ).format (
951
+ author_mention = ctx .author .mention , user_mention = user .mention
952
+ ),
922
953
color = self .bot .main_color ,
923
954
)
924
955
await thread .wait_until_ready ()
@@ -935,9 +966,7 @@ async def blocked(self, ctx):
935
966
"""Retrieve a list of blocked users."""
936
967
937
968
embeds = [
938
- discord .Embed (
939
- title = _ ("Blocked Users" ), color = self .bot .main_color , description = ""
940
- )
969
+ discord .Embed (title = _ ("Blocked Users" ), color = self .bot .main_color , description = "" )
941
970
]
942
971
943
972
users = []
@@ -1015,8 +1044,10 @@ async def blocked_whitelist(self, ctx, *, user: User = None):
1015
1044
reason = msg [16 :].strip ().rstrip ("." )
1016
1045
embed = discord .Embed (
1017
1046
title = "Success" ,
1018
- description = _ ("{mention} was previously blocked internally for "
1019
- '"{reason}". {mention} is now whitelisted.' ).format (mention = mention , reason = reason ),
1047
+ description = _ (
1048
+ "{mention} was previously blocked internally for "
1049
+ '"{reason}". {mention} is now whitelisted.'
1050
+ ).format (mention = mention , reason = reason ),
1020
1051
color = self .bot .main_color ,
1021
1052
)
1022
1053
else :
@@ -1057,7 +1088,9 @@ async def block(self, ctx, user: Optional[User] = None, *, after: UserFriendlyTi
1057
1088
if str (user .id ) in self .bot .blocked_whitelisted_users :
1058
1089
embed = discord .Embed (
1059
1090
title = _ ("Error" ),
1060
- description = _ ("Cannot block {mention}, user is whitelisted." ).format (mention = mention ),
1091
+ description = _ ("Cannot block {mention}, user is whitelisted." ).format (
1092
+ mention = mention
1093
+ ),
1061
1094
color = self .bot .error_color ,
1062
1095
)
1063
1096
return await ctx .send (embed = embed )
@@ -1082,15 +1115,19 @@ async def block(self, ctx, user: Optional[User] = None, *, after: UserFriendlyTi
1082
1115
old_reason = msg .strip ().rstrip ("." )
1083
1116
embed = discord .Embed (
1084
1117
title = _ ("Success" ),
1085
- description = _ ("{mention} was previously blocked {old_reason}.\n "
1086
- "{mention} is now blocked {reason}" ).format (mention = mention , old_reason = old_reason , reason = reason ),
1118
+ description = _ (
1119
+ "{mention} was previously blocked {old_reason}.\n "
1120
+ "{mention} is now blocked {reason}"
1121
+ ).format (mention = mention , old_reason = old_reason , reason = reason ),
1087
1122
color = self .bot .main_color ,
1088
1123
)
1089
1124
else :
1090
1125
embed = discord .Embed (
1091
1126
title = _ ("Success" ),
1092
1127
color = self .bot .main_color ,
1093
- description = _ ("{mention} is now blocked {reason}" ).format (mention = mention , reason = reason ),
1128
+ description = _ ("{mention} is now blocked {reason}" ).format (
1129
+ mention = mention , reason = reason
1130
+ ),
1094
1131
)
1095
1132
self .bot .blocked_users [str (user .id )] = reason
1096
1133
await self .bot .config .update ()
@@ -1129,16 +1166,18 @@ async def unblock(self, ctx, *, user: User = None):
1129
1166
reason = msg [16 :].strip ().rstrip ("." ) or "no reason"
1130
1167
embed = discord .Embed (
1131
1168
title = "Success" ,
1132
- description = _ ("{mention} was previously blocked internally "
1133
- "{reason}.\n {mention} is no longer blocked." ).format (mention = mention , reason = reason ),
1169
+ description = _ (
1170
+ "{mention} was previously blocked internally "
1171
+ "{reason}.\n {mention} is no longer blocked."
1172
+ ).format (mention = mention , reason = reason ),
1134
1173
color = self .bot .main_color ,
1135
1174
)
1136
1175
embed .set_footer (
1137
- text = _ ("However, if the original system block reason still applies, "
1138
- "{name} will be automatically blocked again. Use "
1139
- '"{self.bot.prefix}blocked whitelist {user.id}" to whitelist the user.' ). format (
1140
- name = name , prefix = self .bot .prefix , user_id = user .id
1141
- )
1176
+ text = _ (
1177
+ "However, if the original system block reason still applies, "
1178
+ "{name} will be automatically blocked again. Use "
1179
+ '"{ self.bot.prefix}blocked whitelist { user.id}" to whitelist the user.'
1180
+ ). format ( name = name , prefix = self . bot . prefix , user_id = user . id )
1142
1181
)
1143
1182
else :
1144
1183
embed = discord .Embed (
@@ -1355,7 +1394,9 @@ async def disable_new(self, ctx):
1355
1394
else :
1356
1395
embed = discord .Embed (
1357
1396
title = _ ("Success" ),
1358
- description = _ ("Modmail will not create **new** threads, but existing threads will now be functioning." ),
1397
+ description = _ (
1398
+ "Modmail will not create **new** threads, but existing threads will now be functioning."
1399
+ ),
1359
1400
color = self .bot .main_color ,
1360
1401
)
1361
1402
self .bot .config ["dm_disabled" ] = 1
@@ -1404,7 +1445,9 @@ async def isenable(self, ctx):
1404
1445
elif self .bot .config ["dm_disabled" ] == 2 :
1405
1446
embed = discord .Embed (
1406
1447
title = _ ("All DM Disabled" ),
1407
- description = _ ("Modmail is not accepting any DM messages for new and existing threads." ),
1448
+ description = _ (
1449
+ "Modmail is not accepting any DM messages for new and existing threads."
1450
+ ),
1408
1451
color = self .bot .error_color ,
1409
1452
)
1410
1453
else :
0 commit comments