@@ -52,7 +52,7 @@ async def setup(self, ctx):
5252 embed = discord .Embed (
5353 title = "Error" ,
5454 description = "Modmail functioning guild not found." ,
55- color = discord . Color . red () ,
55+ color = self . bot . error_color ,
5656 )
5757 return await ctx .send (embed = embed )
5858
@@ -165,7 +165,7 @@ async def snippet(self, ctx, *, name: str.lower = None):
165165
166166 if not self .bot .snippets :
167167 embed = discord .Embed (
168- color = discord . Color . red () ,
168+ color = self . bot . error_color ,
169169 description = "You dont have any snippets at the moment." ,
170170 )
171171 embed .set_footer (
@@ -212,23 +212,23 @@ async def snippet_add(self, ctx, name: str.lower, *, value: commands.clean_conte
212212 if name in self .bot .snippets :
213213 embed = discord .Embed (
214214 title = "Error" ,
215- color = discord . Color . red () ,
215+ color = self . bot . error_color ,
216216 description = f"Snippet `{ name } ` already exists." ,
217217 )
218218 return await ctx .send (embed = embed )
219219
220220 if name in self .bot .aliases :
221221 embed = discord .Embed (
222222 title = "Error" ,
223- color = discord . Color . red () ,
223+ color = self . bot . error_color ,
224224 description = f"An alias with the same name already exists: `{ name } `." ,
225225 )
226226 return await ctx .send (embed = embed )
227227
228228 if len (name ) > 120 :
229229 embed = discord .Embed (
230230 title = "Error" ,
231- color = discord . Color . red () ,
231+ color = self . bot . error_color ,
232232 description = f"Snippet names cannot be longer than 120 characters." ,
233233 )
234234 return await ctx .send (embed = embed )
@@ -316,16 +316,15 @@ async def move(self, ctx, category: discord.CategoryChannel, *, specifics: str =
316316 except (discord .HTTPException , discord .InvalidArgument ):
317317 pass
318318
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 ):
321320 human_delta = human_timedelta (after .dt )
322321
323322 silent = "*silently* " if silent else ""
324323
325324 embed = discord .Embed (
326325 title = "Scheduled close" ,
327326 description = f"This thread will close { silent } in { human_delta } ." ,
328- color = discord . Color . red () ,
327+ color = self . bot . error_color ,
329328 )
330329
331330 if after .arg and not silent :
@@ -375,12 +374,12 @@ async def close(self, ctx, *, after: UserFriendlyTime = None):
375374 if thread .close_task is not None or thread .auto_close_task is not None :
376375 await thread .cancel_closure (all = True )
377376 embed = discord .Embed (
378- color = discord . Color . red () ,
377+ color = self . bot . error_color ,
379378 description = "Scheduled close has been cancelled." ,
380379 )
381380 else :
382381 embed = discord .Embed (
383- color = discord . Color . red () ,
382+ color = self . bot . error_color ,
384383 description = "This thread has not already been scheduled to close." ,
385384 )
386385
@@ -432,7 +431,7 @@ async def notify(
432431
433432 if mention in mentions :
434433 embed = discord .Embed (
435- color = discord . Color . red () ,
434+ color = self . bot . error_color ,
436435 description = f"{ mention } is already going to be mentioned." ,
437436 )
438437 else :
@@ -471,7 +470,7 @@ async def unnotify(
471470
472471 if mention not in mentions :
473472 embed = discord .Embed (
474- color = discord . Color . red () ,
473+ color = self . bot . error_color ,
475474 description = f"{ mention } does not have a pending notification." ,
476475 )
477476 else :
@@ -511,7 +510,7 @@ async def subscribe(
511510
512511 if mention in mentions :
513512 embed = discord .Embed (
514- color = discord . Color . red () ,
513+ color = self . bot . error_color ,
515514 description = f"{ mention } is already " "subscribed to this thread." ,
516515 )
517516 else :
@@ -550,7 +549,7 @@ async def unsubscribe(
550549
551550 if mention not in mentions :
552551 embed = discord .Embed (
553- color = discord . Color . red () ,
552+ color = self . bot . error_color ,
554553 description = f"{ mention } is not already " "subscribed to this thread." ,
555554 )
556555 else :
@@ -659,7 +658,7 @@ async def logs(self, ctx, *, user: User = None):
659658
660659 if not any (not log ["open" ] for log in logs ):
661660 embed = discord .Embed (
662- color = discord . Color . red () ,
661+ color = self . bot . error_color ,
663662 description = "This user does not " "have any previous logs." ,
664663 )
665664 return await ctx .send (embed = embed )
@@ -696,7 +695,7 @@ async def logs_closed_by(self, ctx, *, user: User = None):
696695
697696 if not embeds :
698697 embed = discord .Embed (
699- color = discord . Color . red () ,
698+ color = self . bot . error_color ,
700699 description = "No log entries have been found for that query" ,
701700 )
702701 return await ctx .send (embed = embed )
@@ -729,7 +728,7 @@ async def logs_search(self, ctx, limit: Optional[int] = None, *, query):
729728
730729 if not embeds :
731730 embed = discord .Embed (
732- color = discord . Color . red () ,
731+ color = self . bot . error_color ,
733732 description = "No log entries have been found for that query." ,
734733 )
735734 return await ctx .send (embed = embed )
@@ -788,11 +787,7 @@ async def find_linked_message(self, ctx, message_id):
788787 async for msg in ctx .channel .history ():
789788 if message_id is None and msg .embeds :
790789 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 :
796791 continue
797792 # TODO: use regex to find the linked message id
798793 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):
823818 embed = discord .Embed (
824819 title = "Failed" ,
825820 description = "Cannot find a message to edit." ,
826- color = discord . Color . red () ,
821+ color = self . bot . error_color ,
827822 )
828823 )
829824
@@ -859,15 +854,15 @@ async def contact(
859854
860855 if user .bot :
861856 embed = discord .Embed (
862- color = discord . Color . red () ,
857+ color = self . bot . error_color ,
863858 description = "Cannot start a thread with a bot." ,
864859 )
865860 return await ctx .send (embed = embed )
866861
867862 exists = await self .bot .threads .find (recipient = user )
868863 if exists :
869864 embed = discord .Embed (
870- color = discord . Color . red () ,
865+ color = self . bot . error_color ,
871866 description = "A thread for this user already "
872867 f"exists in { exists .channel .mention } ." ,
873868 )
@@ -1031,7 +1026,7 @@ async def block(
10311026 embed = discord .Embed (
10321027 title = "Error" ,
10331028 description = f"Cannot block { mention } , user is whitelisted." ,
1034- color = discord . Color . red () ,
1029+ color = self . bot . error_color ,
10351030 )
10361031 return await ctx .send (embed = embed )
10371032
@@ -1079,7 +1074,7 @@ async def block(
10791074 else :
10801075 embed = discord .Embed (
10811076 title = "Error" ,
1082- color = discord . Color . red () ,
1077+ color = self . bot . error_color ,
10831078 description = f"{ mention } is already blocked." ,
10841079 )
10851080
@@ -1136,7 +1131,7 @@ async def unblock(self, ctx, *, user: User = None):
11361131 embed = discord .Embed (
11371132 title = "Error" ,
11381133 description = f"{ mention } is not blocked." ,
1139- color = discord . Color . red () ,
1134+ color = self . bot . error_color ,
11401135 )
11411136
11421137 return await ctx .send (embed = embed )
@@ -1168,7 +1163,7 @@ async def delete(self, ctx, message_id: Optional[int] = None):
11681163 embed = discord .Embed (
11691164 title = "Failed" ,
11701165 description = "Cannot find a message to delete." ,
1171- color = discord . Color . red () ,
1166+ color = self . bot . error_color ,
11721167 )
11731168 )
11741169
0 commit comments