@@ -106,7 +106,7 @@ async def snippets(self, ctx):
106
106
107
107
@snippets .command (name = 'add' )
108
108
@checks .has_permissions (PermissionLevel .SUPPORTER )
109
- async def add_ (self , ctx , name : str .lower , * , value ):
109
+ async def snippets_add (self , ctx , name : str .lower , * , value ):
110
110
"""Add a snippet to the bot config."""
111
111
if 'snippets' not in self .bot .config .cache :
112
112
self .bot .config ['snippets' ] = {}
@@ -124,7 +124,7 @@ async def add_(self, ctx, name: str.lower, *, value):
124
124
125
125
@snippets .command (name = 'remove' , aliases = ['del' , 'delete' , 'rm' ])
126
126
@checks .has_permissions (PermissionLevel .SUPPORTER )
127
- async def remove_ (self , ctx , * , name : str .lower ):
127
+ async def snippets_remove (self , ctx , * , name : str .lower ):
128
128
"""Removes a snippet from bot config."""
129
129
130
130
if self .bot .config .snippets .get (name ):
@@ -386,7 +386,6 @@ def format_log_embeds(self, logs, avatar_url):
386
386
if prefix == 'NONE' :
387
387
prefix = ''
388
388
389
-
390
389
log_url = self .bot .config .log_url .strip ('/' ) + f'{ prefix } /{ key } '
391
390
392
391
username = entry ['recipient' ]['name' ] + '#'
@@ -450,9 +449,9 @@ async def logs(self, ctx, *, member: User = None):
450
449
session = PaginatorSession (ctx , * embeds )
451
450
await session .run ()
452
451
453
- @logs .command (name = 'closed-by' )
452
+ @logs .command (name = 'closed-by' , aliases = [ 'closeby' ] )
454
453
@checks .has_permissions (PermissionLevel .SUPPORTER )
455
- async def closed_by (self , ctx , * , user : User = None ):
454
+ async def logs_closed_by (self , ctx , * , user : User = None ):
456
455
"""Returns all logs closed by a user."""
457
456
user = user or ctx .author
458
457
@@ -481,9 +480,9 @@ async def closed_by(self, ctx, *, user: User = None):
481
480
session = PaginatorSession (ctx , * embeds )
482
481
await session .run ()
483
482
484
- @logs .command ()
483
+ @logs .command (name = 'search' , aliases = [ 'find' ] )
485
484
@checks .has_permissions (PermissionLevel .SUPPORTER )
486
- async def search (self , ctx , limit : Optional [int ] = None , * , query ):
485
+ async def logs_search (self , ctx , limit : Optional [int ] = None , * , query ):
487
486
"""Searches all logs for a message that contains your query."""
488
487
489
488
await ctx .trigger_typing ()
@@ -518,7 +517,7 @@ async def search(self, ctx, limit: Optional[int] = None, *, query):
518
517
@commands .command ()
519
518
@checks .has_permissions (PermissionLevel .SUPPORTER )
520
519
@checks .thread_only ()
521
- async def reply (self , ctx , * , msg = '' ):
520
+ async def reply (self , ctx , * , msg : str ):
522
521
"""Reply to users using this command.
523
522
524
523
Supports attachments and images as well as
@@ -531,7 +530,7 @@ async def reply(self, ctx, *, msg=''):
531
530
@commands .command ()
532
531
@checks .has_permissions (PermissionLevel .SUPPORTER )
533
532
@checks .thread_only ()
534
- async def anonreply (self , ctx , * , msg = '' ):
533
+ async def anonreply (self , ctx , * , msg : str ):
535
534
"""Reply to a thread anonymously.
536
535
537
536
You can edit the anonymous user's name,
@@ -547,7 +546,7 @@ async def anonreply(self, ctx, *, msg=''):
547
546
@commands .command ()
548
547
@checks .has_permissions (PermissionLevel .SUPPORTER )
549
548
@checks .thread_only ()
550
- async def note (self , ctx , * , msg = '' ):
549
+ async def note (self , ctx , * , msg : str ):
551
550
"""Take a note about the current thread, useful for noting context."""
552
551
ctx .message .content = msg
553
552
async with ctx .typing ():
@@ -579,7 +578,7 @@ async def find_linked_message(self, ctx, message_id):
579
578
@checks .has_permissions (PermissionLevel .SUPPORTER )
580
579
@checks .thread_only ()
581
580
async def edit (self , ctx , message_id : Optional [int ] = None ,
582
- * , new_message ):
581
+ * , new_message : str ):
583
582
"""Edit a message that was sent using the reply command.
584
583
585
584
If no `message_id` is provided, the
@@ -758,7 +757,6 @@ async def unblock(self, ctx, *, user: User = None):
758
757
use only.
759
758
"""
760
759
761
-
762
760
if user is None :
763
761
thread = ctx .thread
764
762
if thread :
@@ -803,18 +801,19 @@ async def unblock(self, ctx, *, user: User = None):
803
801
@commands .command ()
804
802
@checks .has_permissions (PermissionLevel .SUPPORTER )
805
803
@checks .thread_only ()
806
- async def delete (self , ctx , message_id = None ):
804
+ async def delete (self , ctx , message_id : Optional [ int ] = None ):
807
805
"""Delete a message that was sent using the reply command.
808
806
809
807
Deletes the previous message, unless a message ID is provided, which in that case,
810
808
deletes the message with that message ID.
811
809
"""
812
810
thread = ctx .thread
813
811
814
- try :
815
- message_id = int (message_id )
816
- except ValueError :
817
- raise commands .BadArgument ('An integer message ID needs to be specified.' )
812
+ if message_id is not None :
813
+ try :
814
+ message_id = int (message_id )
815
+ except ValueError :
816
+ raise commands .BadArgument ('An integer message ID needs to be specified.' )
818
817
819
818
linked_message_id = await self .find_linked_message (ctx , message_id )
820
819
0 commit comments