@@ -64,24 +64,25 @@ async def snippets(self, ctx):
64
64
65
65
embeds = []
66
66
67
- em = discord .Embed (color = discord .Color .green ())
68
- em .set_author (name = 'Snippets' , icon_url = ctx .guild .icon_url )
69
-
70
- embeds .append (em )
71
-
72
- em .description = ('Here is a list of snippets '
73
- 'that are currently configured.' )
74
-
75
- if not self .bot .snippets :
76
- em .color = discord .Color .red ()
77
- em .description = f'You dont have any snippets at the moment.'
67
+ if self .bot .snippets :
68
+ em = discord .Embed (color = discord .Color .blurple (),
69
+ description = 'Here is a list of snippets '
70
+ 'that are currently configured.' )
71
+ else :
72
+ em = discord .Embed (
73
+ color = discord .Color .red (),
74
+ description = 'You dont have any snippets at the moment.'
75
+ )
78
76
em .set_footer (
79
77
text = f'Do { self .bot .prefix } help snippets for more commands.'
80
78
)
81
79
80
+ em .set_author (name = 'Snippets' , icon_url = ctx .guild .icon_url )
81
+ embeds .append (em )
82
+
82
83
for name , value in self .bot .snippets .items ():
83
84
if len (em .fields ) == 5 :
84
- em = discord .Embed (color = discord .Color .green (),
85
+ em = discord .Embed (color = discord .Color .blurple (),
85
86
description = em .description )
86
87
em .set_author (name = 'Snippets' , icon_url = ctx .guild .icon_url )
87
88
embeds .append (em )
@@ -101,7 +102,7 @@ async def add_(self, ctx, name: str.lower, *, value):
101
102
102
103
em = discord .Embed (
103
104
title = 'Added snippet' ,
104
- color = discord .Color .green (),
105
+ color = discord .Color .blurple (),
105
106
description = f'`{ name } ` points to: { value } '
106
107
)
107
108
@@ -111,20 +112,22 @@ async def add_(self, ctx, name: str.lower, *, value):
111
112
async def del_ (self , ctx , * , name : str .lower ):
112
113
"""Removes a snippet from bot config."""
113
114
114
- em = discord .Embed (
115
- title = 'Removed snippet' ,
116
- color = discord .Color .green (),
117
- description = f'`{ name } ` no longer exists.'
118
- )
119
-
120
- if not self .bot .config .snippets .get (name ):
121
- em .title = 'Error'
122
- em .color = discord .Color .red ()
123
- em .description = f'Snippet `{ name } ` does not exist.'
124
- else :
115
+ if self .bot .config .snippets .get (name ):
116
+ em = discord .Embed (
117
+ title = 'Removed snippet' ,
118
+ color = discord .Color .blurple (),
119
+ description = f'`{ name } ` no longer exists.'
120
+ )
125
121
del self .bot .config ['snippets' ][name ]
126
122
await self .bot .config .update ()
127
123
124
+ else :
125
+ em = discord .Embed (
126
+ title = 'Error' ,
127
+ color = discord .Color .red (),
128
+ description = f'Snippet `{ name } ` does not exist.'
129
+ )
130
+
128
131
await ctx .send (embed = em )
129
132
130
133
@commands .command ()
@@ -246,7 +249,7 @@ async def notify(self, ctx, *, role=None):
246
249
else :
247
250
mentions .append (mention )
248
251
await self .bot .config .update ()
249
- em = discord .Embed (color = discord .Color .green (),
252
+ em = discord .Embed (color = discord .Color .blurple (),
250
253
description = f'{ mention } will be mentioned '
251
254
'on the next message received.' )
252
255
return await ctx .send (embed = em )
@@ -284,7 +287,7 @@ async def subscribe(self, ctx, *, role=None):
284
287
else :
285
288
mentions .append (mention )
286
289
await self .bot .config .update ()
287
- em = discord .Embed (color = discord .Color .green (),
290
+ em = discord .Embed (color = discord .Color .blurple (),
288
291
description = f'{ mention } will now be notified '
289
292
'of all messages received.' )
290
293
return await ctx .send (embed = em )
@@ -317,7 +320,7 @@ async def unsubscribe(self, ctx, *, role=None):
317
320
else :
318
321
mentions .remove (mention )
319
322
await self .bot .config .update ()
320
- em = discord .Embed (color = discord .Color .green (),
323
+ em = discord .Embed (color = discord .Color .blurple (),
321
324
description = f'{ mention } is now unsubscribed '
322
325
'to this thread.' )
323
326
return await ctx .send (embed = em )
@@ -372,7 +375,7 @@ async def logs(self, ctx, *,
372
375
373
376
for index , entry in enumerate (closed_logs ):
374
377
if len (embeds [- 1 ].fields ) == 3 :
375
- em = discord .Embed (color = discord .Color .green ())
378
+ em = discord .Embed (color = discord .Color .blurple ())
376
379
em .set_author (name = 'Previous Logs' , icon_url = icon_url )
377
380
embeds .append (em )
378
381
@@ -454,7 +457,7 @@ async def edit(self, ctx, message_id: Optional[int] = None,
454
457
async for msg in ctx .channel .history ():
455
458
if message_id is None and msg .embeds :
456
459
em = msg .embeds [0 ]
457
- if 'Moderator' not in str ( em .footer . text ) :
460
+ if em . color != discord . Color . green () or not em .author . url :
458
461
continue
459
462
linked_message_id = str (em .author .url ).split ('/' )[- 1 ]
460
463
break
@@ -492,7 +495,7 @@ async def contact(self, ctx,
492
495
title = 'Created thread' ,
493
496
description = f'Thread started in { thread .channel .mention } '
494
497
f'for { user .mention } ' ,
495
- color = discord .Color .green ()
498
+ color = discord .Color .blurple ()
496
499
)
497
500
498
501
return await ctx .send (embed = em )
@@ -503,8 +506,8 @@ async def contact(self, ctx,
503
506
async def blocked (self , ctx ):
504
507
"""Returns a list of blocked users"""
505
508
em = discord .Embed (title = 'Blocked Users' ,
506
- color = discord .Color .green (),
507
- description = '' )
509
+ color = discord .Color .blurple (),
510
+ description = 'Here is a list of blocked users. ' )
508
511
509
512
users = []
510
513
not_reachable = []
@@ -516,8 +519,6 @@ async def blocked(self, ctx):
516
519
else :
517
520
not_reachable .append ((id_ , reason ))
518
521
519
- em .description = 'Here is a list of blocked users.'
520
-
521
522
if users :
522
523
val = '\n ' .join (u .mention + (f' - `{ r } `' if r else '' )
523
524
for u , r in users )
@@ -549,19 +550,21 @@ async def block(self, ctx,
549
550
550
551
mention = user .mention if hasattr (user , 'mention' ) else f'`{ user .id } `'
551
552
552
- em = discord .Embed (color = discord .Color .green ())
553
-
554
553
if str (user .id ) not in self .bot .blocked_users :
555
554
self .bot .config .blocked [str (user .id )] = reason
556
555
await self .bot .config .update ()
557
-
558
- em .title = 'Success'
559
556
extend = f'for `{ reason } `' if reason else ''
560
- em .description = f'{ mention } is now blocked ' + extend
557
+ em = discord .Embed (
558
+ title = 'Success' ,
559
+ color = discord .Color .blurple (),
560
+ description = f'{ mention } is now blocked ' + extend
561
+ )
561
562
else :
562
- em .title = 'Error'
563
- em .description = f'{ mention } is already blocked'
564
- em .color = discord .Color .red ()
563
+ em = discord .Embed (
564
+ title = 'Error' ,
565
+ color = discord .Color .red (),
566
+ description = f'{ mention } is already blocked'
567
+ )
565
568
566
569
return await ctx .send (embed = em )
567
570
@@ -581,18 +584,20 @@ async def unblock(self, ctx, *,
581
584
582
585
mention = user .mention if hasattr (user , 'mention' ) else f'`{ user .id } `'
583
586
584
- em = discord .Embed (color = discord .Color .green ())
585
-
586
587
if str (user .id ) in self .bot .blocked_users :
587
588
del self .bot .config .blocked [str (user .id )]
588
589
await self .bot .config .update ()
589
-
590
- em .title = 'Success'
591
- em .description = f'{ mention } is no longer blocked'
590
+ em = discord .Embed (
591
+ title = 'Success' ,
592
+ color = discord .Color .blurple (),
593
+ description = f'{ mention } is no longer blocked'
594
+ )
592
595
else :
593
- em .title = 'Error'
594
- em .description = f'{ mention } is not blocked'
595
- em .color = discord .Color .red ()
596
+ em = discord .Embed (
597
+ title = 'Error' ,
598
+ description = f'{ mention } is not blocked' ,
599
+ color = discord .Color .red ()
600
+ )
596
601
597
602
return await ctx .send (embed = em )
598
603
0 commit comments