1
0
Fork 0
mirror of https://github.com/myned/modufur.git synced 2024-12-24 14:27:27 +00:00

Add catching of empty arguments

This commit is contained in:
Dylan Dizon 2018-11-06 16:29:49 -05:00
parent 3f79a77601
commit 36075607e5

View file

@ -1495,6 +1495,9 @@ class MsG:
return True return True
return False return False
if not tags:
raise exc.MissingArgument
aliases = {} aliases = {}
try: try:
@ -1564,6 +1567,9 @@ class MsG:
except exc.Abort: except exc.Abort:
await dest.send('**Aborted**') await dest.send('**Aborted**')
except exc.MissingArgument:
await dest.send('\N{CROSS MARK} **Missing tags**')
await ctx.message.add_reaction('\N{CROSS MARK}')
@_add_tags.command(name='channel', aliases=['ch', 'c'], brief='@manage_channel@ Add tag(s) to the current channel blacklist (requires manage_channel)', description='Add tag(s) to the current channel blacklist ') @_add_tags.command(name='channel', aliases=['ch', 'c'], brief='@manage_channel@ Add tag(s) to the current channel blacklist (requires manage_channel)', description='Add tag(s) to the current channel blacklist ')
@cmds.has_permissions(manage_channels=True) @cmds.has_permissions(manage_channels=True)
@ -1585,6 +1591,9 @@ class MsG:
except exc.Abort: except exc.Abort:
await dest.send('**Aborted**') await dest.send('**Aborted**')
except exc.MissingArgument:
await dest.send('\N{CROSS MARK} **Missing tags**')
await ctx.message.add_reaction('\N{CROSS MARK}')
@_add_tags.command(name='me', aliases=['m']) @_add_tags.command(name='me', aliases=['m'])
async def __add_user_tags(self, ctx, *args): async def __add_user_tags(self, ctx, *args):
@ -1602,6 +1611,9 @@ class MsG:
except exc.Abort: except exc.Abort:
await dest.send('**Aborted**') await dest.send('**Aborted**')
except exc.MissingArgument:
await dest.send('\N{CROSS MARK} **Missing tags**')
await ctx.message.add_reaction('\N{CROSS MARK}')
@blacklist.group(name='remove', aliases=['rm', 'r']) @blacklist.group(name='remove', aliases=['rm', 'r'])
async def _remove_tags(self, ctx): async def _remove_tags(self, ctx):