@@ -52,7 +52,7 @@ async def setup(self, ctx):
52
52
embed = discord .Embed (
53
53
title = "Error" ,
54
54
description = "Modmail functioning guild not found." ,
55
- color = discord . Color . red () ,
55
+ color = self . bot . error_color ,
56
56
)
57
57
return await ctx .send (embed = embed )
58
58
@@ -165,7 +165,7 @@ async def snippet(self, ctx, *, name: str.lower = None):
165
165
166
166
if not self .bot .snippets :
167
167
embed = discord .Embed (
168
- color = discord . Color . red () ,
168
+ color = self . bot . error_color ,
169
169
description = "You dont have any snippets at the moment." ,
170
170
)
171
171
embed .set_footer (
@@ -212,23 +212,23 @@ async def snippet_add(self, ctx, name: str.lower, *, value: commands.clean_conte
212
212
if name in self .bot .snippets :
213
213
embed = discord .Embed (
214
214
title = "Error" ,
215
- color = discord . Color . red () ,
215
+ color = self . bot . error_color ,
216
216
description = f"Snippet `{ name } ` already exists." ,
217
217
)
218
218
return await ctx .send (embed = embed )
219
219
220
220
if name in self .bot .aliases :
221
221
embed = discord .Embed (
222
222
title = "Error" ,
223
- color = discord . Color . red () ,
223
+ color = self . bot . error_color ,
224
224
description = f"An alias with the same name already exists: `{ name } `." ,
225
225
)
226
226
return await ctx .send (embed = embed )
227
227
228
228
if len (name ) > 120 :
229
229
embed = discord .Embed (
230
230
title = "Error" ,
231
- color = discord . Color . red () ,
231
+ color = self . bot . error_color ,
232
232
description = f"Snippet names cannot be longer than 120 characters." ,
233
233
)
234
234
return await ctx .send (embed = embed )
@@ -316,16 +316,15 @@ async def move(self, ctx, category: discord.CategoryChannel, *, specifics: str =
316
316
except (discord .HTTPException , discord .InvalidArgument ):
317
317
pass
318
318
319
- @staticmethod
320
- async def send_scheduled_close_message (ctx , after , silent = False ):
319
+ async def send_scheduled_close_message (self , ctx , after , silent = False ):
321
320
human_delta = human_timedelta (after .dt )
322
321
323
322
silent = "*silently* " if silent else ""
324
323
325
324
embed = discord .Embed (
326
325
title = "Scheduled close" ,
327
326
description = f"This thread will close { silent } in { human_delta } ." ,
328
- color = discord . Color . red () ,
327
+ color = self . bot . error_color ,
329
328
)
330
329
331
330
if after .arg and not silent :
@@ -375,12 +374,12 @@ async def close(self, ctx, *, after: UserFriendlyTime = None):
375
374
if thread .close_task is not None or thread .auto_close_task is not None :
376
375
await thread .cancel_closure (all = True )
377
376
embed = discord .Embed (
378
- color = discord . Color . red () ,
377
+ color = self . bot . error_color ,
379
378
description = "Scheduled close has been cancelled." ,
380
379
)
381
380
else :
382
381
embed = discord .Embed (
383
- color = discord . Color . red () ,
382
+ color = self . bot . error_color ,
384
383
description = "This thread has not already been scheduled to close." ,
385
384
)
386
385
@@ -432,7 +431,7 @@ async def notify(
432
431
433
432
if mention in mentions :
434
433
embed = discord .Embed (
435
- color = discord . Color . red () ,
434
+ color = self . bot . error_color ,
436
435
description = f"{ mention } is already going to be mentioned." ,
437
436
)
438
437
else :
@@ -471,7 +470,7 @@ async def unnotify(
471
470
472
471
if mention not in mentions :
473
472
embed = discord .Embed (
474
- color = discord . Color . red () ,
473
+ color = self . bot . error_color ,
475
474
description = f"{ mention } does not have a pending notification." ,
476
475
)
477
476
else :
@@ -511,7 +510,7 @@ async def subscribe(
511
510
512
511
if mention in mentions :
513
512
embed = discord .Embed (
514
- color = discord . Color . red () ,
513
+ color = self . bot . error_color ,
515
514
description = f"{ mention } is already " "subscribed to this thread." ,
516
515
)
517
516
else :
@@ -550,7 +549,7 @@ async def unsubscribe(
550
549
551
550
if mention not in mentions :
552
551
embed = discord .Embed (
553
- color = discord . Color . red () ,
552
+ color = self . bot . error_color ,
554
553
description = f"{ mention } is not already " "subscribed to this thread." ,
555
554
)
556
555
else :
@@ -659,7 +658,7 @@ async def logs(self, ctx, *, user: User = None):
659
658
660
659
if not any (not log ["open" ] for log in logs ):
661
660
embed = discord .Embed (
662
- color = discord . Color . red () ,
661
+ color = self . bot . error_color ,
663
662
description = "This user does not " "have any previous logs." ,
664
663
)
665
664
return await ctx .send (embed = embed )
@@ -696,7 +695,7 @@ async def logs_closed_by(self, ctx, *, user: User = None):
696
695
697
696
if not embeds :
698
697
embed = discord .Embed (
699
- color = discord . Color . red () ,
698
+ color = self . bot . error_color ,
700
699
description = "No log entries have been found for that query" ,
701
700
)
702
701
return await ctx .send (embed = embed )
@@ -729,7 +728,7 @@ async def logs_search(self, ctx, limit: Optional[int] = None, *, query):
729
728
730
729
if not embeds :
731
730
embed = discord .Embed (
732
- color = discord . Color . red () ,
731
+ color = self . bot . error_color ,
733
732
description = "No log entries have been found for that query." ,
734
733
)
735
734
return await ctx .send (embed = embed )
@@ -788,11 +787,7 @@ async def find_linked_message(self, ctx, message_id):
788
787
async for msg in ctx .channel .history ():
789
788
if message_id is None and msg .embeds :
790
789
embed = msg .embeds [0 ]
791
- if isinstance (self .bot .mod_color , discord .Color ):
792
- mod_color = self .bot .mod_color .value
793
- else :
794
- mod_color = self .bot .mod_color
795
- if embed .color .value != mod_color or not embed .author .url :
790
+ if embed .color .value != self .bot .mod_color or not embed .author .url :
796
791
continue
797
792
# TODO: use regex to find the linked message id
798
793
linked_message_id = str (embed .author .url ).split ("/" )[- 1 ]
@@ -823,7 +818,7 @@ async def edit(self, ctx, message_id: Optional[int] = None, *, message: str):
823
818
embed = discord .Embed (
824
819
title = "Failed" ,
825
820
description = "Cannot find a message to edit." ,
826
- color = discord . Color . red () ,
821
+ color = self . bot . error_color ,
827
822
)
828
823
)
829
824
@@ -859,15 +854,15 @@ async def contact(
859
854
860
855
if user .bot :
861
856
embed = discord .Embed (
862
- color = discord . Color . red () ,
857
+ color = self . bot . error_color ,
863
858
description = "Cannot start a thread with a bot." ,
864
859
)
865
860
return await ctx .send (embed = embed )
866
861
867
862
exists = await self .bot .threads .find (recipient = user )
868
863
if exists :
869
864
embed = discord .Embed (
870
- color = discord . Color . red () ,
865
+ color = self . bot . error_color ,
871
866
description = "A thread for this user already "
872
867
f"exists in { exists .channel .mention } ." ,
873
868
)
@@ -1031,7 +1026,7 @@ async def block(
1031
1026
embed = discord .Embed (
1032
1027
title = "Error" ,
1033
1028
description = f"Cannot block { mention } , user is whitelisted." ,
1034
- color = discord . Color . red () ,
1029
+ color = self . bot . error_color ,
1035
1030
)
1036
1031
return await ctx .send (embed = embed )
1037
1032
@@ -1079,7 +1074,7 @@ async def block(
1079
1074
else :
1080
1075
embed = discord .Embed (
1081
1076
title = "Error" ,
1082
- color = discord . Color . red () ,
1077
+ color = self . bot . error_color ,
1083
1078
description = f"{ mention } is already blocked." ,
1084
1079
)
1085
1080
@@ -1136,7 +1131,7 @@ async def unblock(self, ctx, *, user: User = None):
1136
1131
embed = discord .Embed (
1137
1132
title = "Error" ,
1138
1133
description = f"{ mention } is not blocked." ,
1139
- color = discord . Color . red () ,
1134
+ color = self . bot . error_color ,
1140
1135
)
1141
1136
1142
1137
return await ctx .send (embed = embed )
@@ -1168,7 +1163,7 @@ async def delete(self, ctx, message_id: Optional[int] = None):
1168
1163
embed = discord .Embed (
1169
1164
title = "Failed" ,
1170
1165
description = "Cannot find a message to delete." ,
1171
- color = discord . Color . red () ,
1166
+ color = self . bot . error_color ,
1172
1167
)
1173
1168
)
1174
1169
0 commit comments