mirror of
https://github.com/myned/modufur.git
synced 2024-12-25 06:37:29 +00:00
Change user error reactions to be different from no results
This commit is contained in:
parent
82e010c795
commit
5662d2afdd
4 changed files with 34 additions and 32 deletions
|
@ -277,7 +277,7 @@ class MsG(cmds.Cog):
|
||||||
async def get(self, ctx):
|
async def get(self, ctx):
|
||||||
if not ctx.invoked_subcommand:
|
if not ctx.invoked_subcommand:
|
||||||
await ctx.send('**Use a flag to get items.**\n*Type* `{}help get` *for more info.*'.format(ctx.prefix))
|
await ctx.send('**Use a flag to get items.**\n*Type* `{}help get` *for more info.*'.format(ctx.prefix))
|
||||||
await u.add_reaction(ctx.message, '\N{CROSS MARK}')
|
await u.add_reaction(ctx.message, '\N{HEAVY EXCLAMATION MARK SYMBOL}')
|
||||||
|
|
||||||
@get.command(name='info', aliases=['i'], brief='(get) Get info from post', description='Return info for given post URL or ID\n\nExample:\n\{p\}get info 1145042')
|
@get.command(name='info', aliases=['i'], brief='(get) Get info from post', description='Return info for given post URL or ID\n\nExample:\n\{p\}get info 1145042')
|
||||||
async def _get_info(self, ctx, *args):
|
async def _get_info(self, ctx, *args):
|
||||||
|
@ -304,8 +304,8 @@ class MsG(cmds.Cog):
|
||||||
icon_url=self._get_icon(post['score']))
|
icon_url=self._get_icon(post['score']))
|
||||||
|
|
||||||
except exc.MissingArgument:
|
except exc.MissingArgument:
|
||||||
await ctx.send('\N{CROSS MARK} **Invalid url**')
|
await ctx.send('\N{HEAVY EXCLAMATION MARK SYMBOL} **Invalid url**')
|
||||||
await u.add_reaction(ctx.message, '\N{CROSS MARK}')
|
await u.add_reaction(ctx.message, '\N{HEAVY EXCLAMATION MARK SYMBOL}')
|
||||||
|
|
||||||
@get.command(name='image', aliases=['img'], brief='(get) Get direct image from post', description='Return direct image URL for given post\n\nExample:\n\{p\}get image 1145042')
|
@get.command(name='image', aliases=['img'], brief='(get) Get direct image from post', description='Return direct image URL for given post\n\nExample:\n\{p\}get image 1145042')
|
||||||
async def _get_image(self, ctx, *args):
|
async def _get_image(self, ctx, *args):
|
||||||
|
@ -331,8 +331,8 @@ class MsG(cmds.Cog):
|
||||||
await u.add_reaction(ctx.message, '\N{CROSS MARK}')
|
await u.add_reaction(ctx.message, '\N{CROSS MARK}')
|
||||||
|
|
||||||
except exc.MissingArgument:
|
except exc.MissingArgument:
|
||||||
await ctx.send('\N{CROSS MARK} **Invalid url or file**')
|
await ctx.send('\N{HEAVY EXCLAMATION MARK SYMBOL} **Invalid url or file**')
|
||||||
await u.add_reaction(ctx.message, '\N{CROSS MARK}')
|
await u.add_reaction(ctx.message, '\N{HEAVY EXCLAMATION MARK SYMBOL}')
|
||||||
|
|
||||||
@get.command(name='pool', aliases=['p'], brief='(get) Get pool from query', description='Return pool info for given query\n\nExample:\n\{p\}get pool 1145042')
|
@get.command(name='pool', aliases=['p'], brief='(get) Get pool from query', description='Return pool info for given query\n\nExample:\n\{p\}get pool 1145042')
|
||||||
async def _get_pool(self, ctx, *args):
|
async def _get_pool(self, ctx, *args):
|
||||||
|
@ -422,14 +422,14 @@ class MsG(cmds.Cog):
|
||||||
await ctx.message.delete()
|
await ctx.message.delete()
|
||||||
|
|
||||||
except exc.MissingArgument:
|
except exc.MissingArgument:
|
||||||
await ctx.send('\N{CROSS MARK} **Invalid url or file.** Be sure the link directs to an image file')
|
await ctx.send('\N{HEAVY EXCLAMATION MARK SYMBOL} **Invalid url or file.** Be sure the link directs to an image file')
|
||||||
await u.add_reaction(ctx.message, '\N{CROSS MARK}')
|
await u.add_reaction(ctx.message, '\N{HEAVY EXCLAMATION MARK SYMBOL}')
|
||||||
except exc.SizeError as e:
|
except exc.SizeError as e:
|
||||||
await ctx.send(f'`{e}` **too large.** Maximum is 8 MB')
|
await ctx.send(f'`{e}` **too large.** Maximum is 8 MB')
|
||||||
await u.add_reaction(ctx.message, '\N{CROSS MARK}')
|
await u.add_reaction(ctx.message, '\N{HEAVY EXCLAMATION MARK SYMBOL}')
|
||||||
except err.HTTPException:
|
except err.HTTPException:
|
||||||
await ctx.send('\N{CROSS MARK} **The image database returned an unexpected result.** It may be offline')
|
await ctx.send('\N{HEAVY EXCLAMATION MARK SYMBOL} **The image database returned an unexpected result.** It may be offline')
|
||||||
await u.add_reaction(ctx.message, '\N{CROSS MARK}')
|
await u.add_reaction(ctx.message, '\N{HEAVY EXCLAMATION MARK SYMBOL}')
|
||||||
|
|
||||||
@cmds.command(name='reversify', aliases=['revify', 'risify', 'rify'])
|
@cmds.command(name='reversify', aliases=['revify', 'risify', 'rify'])
|
||||||
@cmds.cooldown(1, 5, cmds.BucketType.member)
|
@cmds.cooldown(1, 5, cmds.BucketType.member)
|
||||||
|
@ -502,13 +502,13 @@ class MsG(cmds.Cog):
|
||||||
|
|
||||||
except exc.NotFound:
|
except exc.NotFound:
|
||||||
await dest.send('**No matches found**')
|
await dest.send('**No matches found**')
|
||||||
await u.add_reaction(ctx.message, '\N{CROSS MARK}')
|
await u.add_reaction(ctx.message, '\N{HEAVY EXCLAMATION MARK SYMBOL}')
|
||||||
except exc.BoundsError as e:
|
except exc.BoundsError as e:
|
||||||
await dest.send('`{}` **invalid limit.** Query limited to 30'.format(e))
|
await dest.send('`{}` **invalid limit.** Query limited to 5'.format(e))
|
||||||
await u.add_reaction(ctx.message, '\N{CROSS MARK}')
|
await u.add_reaction(ctx.message, '\N{HEAVY EXCLAMATION MARK SYMBOL}')
|
||||||
except err.HTTPException:
|
except err.HTTPException:
|
||||||
await dest.send('\N{CROSS MARK} **The image database returned an unexpected result.** It may be offline')
|
await dest.send('\N{HEAVY EXCLAMATION MARK SYMBOL} **The image database returned an unexpected result.** It may be offline')
|
||||||
await u.add_reaction(ctx.message, '\N{CROSS MARK}')
|
await u.add_reaction(ctx.message, '\N{HEAVY EXCLAMATION MARK SYMBOL}')
|
||||||
|
|
||||||
async def _reversify(self):
|
async def _reversify(self):
|
||||||
while self.reversifying:
|
while self.reversifying:
|
||||||
|
@ -548,7 +548,7 @@ class MsG(cmds.Cog):
|
||||||
await message.add_reaction('\N{CROSS MARK}')
|
await message.add_reaction('\N{CROSS MARK}')
|
||||||
except exc.SizeError as e:
|
except exc.SizeError as e:
|
||||||
await message.channel.send(f'`{e}` **too large.** Maximum is 8 MB')
|
await message.channel.send(f'`{e}` **too large.** Maximum is 8 MB')
|
||||||
await message.add_reaction('\N{CROSS MARK}')
|
await message.add_reaction('\N{HEAVY EXCLAMATION MARK SYMBOL}')
|
||||||
except Exception:
|
except Exception:
|
||||||
await message.channel.send(f'**An unknown error occurred.**')
|
await message.channel.send(f'**An unknown error occurred.**')
|
||||||
await message.add_reaction('\N{WARNING SIGN}')
|
await message.add_reaction('\N{WARNING SIGN}')
|
||||||
|
@ -985,7 +985,7 @@ class MsG(cmds.Cog):
|
||||||
await u.add_reaction(ctx.message, '\N{NO ENTRY SIGN}')
|
await u.add_reaction(ctx.message, '\N{NO ENTRY SIGN}')
|
||||||
except exc.TagBoundsError as e:
|
except exc.TagBoundsError as e:
|
||||||
await ctx.send('`{}` **out of bounds.** Tags limited to 5.'.format(e))
|
await ctx.send('`{}` **out of bounds.** Tags limited to 5.'.format(e))
|
||||||
await u.add_reaction(ctx.message, '\N{CROSS MARK}')
|
await u.add_reaction(ctx.message, '\N{HEAVY EXCLAMATION MARK SYMBOL}')
|
||||||
except exc.FavoritesNotFound:
|
except exc.FavoritesNotFound:
|
||||||
await ctx.send('**You have no favorite tags**')
|
await ctx.send('**You have no favorite tags**')
|
||||||
await u.add_reaction(ctx.message, '\N{CROSS MARK}')
|
await u.add_reaction(ctx.message, '\N{CROSS MARK}')
|
||||||
|
@ -1043,10 +1043,10 @@ class MsG(cmds.Cog):
|
||||||
await u.add_reaction(ctx.message, '\N{CROSS MARK}')
|
await u.add_reaction(ctx.message, '\N{CROSS MARK}')
|
||||||
except exc.BoundsError as e:
|
except exc.BoundsError as e:
|
||||||
await ctx.send('`{}` **out of bounds.** Images limited to 3.'.format(e))
|
await ctx.send('`{}` **out of bounds.** Images limited to 3.'.format(e))
|
||||||
await u.add_reaction(ctx.message, '\N{CROSS MARK}')
|
await u.add_reaction(ctx.message, '\N{HEAVY EXCLAMATION MARK SYMBOL}')
|
||||||
except exc.TagBoundsError as e:
|
except exc.TagBoundsError as e:
|
||||||
await ctx.send('`{}` **out of bounds.** Tags limited to 5.'.format(e))
|
await ctx.send('`{}` **out of bounds.** Tags limited to 5.'.format(e))
|
||||||
await u.add_reaction(ctx.message, '\N{CROSS MARK}')
|
await u.add_reaction(ctx.message, '\N{HEAVY EXCLAMATION MARK SYMBOL}')
|
||||||
except exc.NotFound as e:
|
except exc.NotFound as e:
|
||||||
await ctx.send('`{}` **not found**'.format(e))
|
await ctx.send('`{}` **not found**'.format(e))
|
||||||
await u.add_reaction(ctx.message, '\N{CROSS MARK}')
|
await u.add_reaction(ctx.message, '\N{CROSS MARK}')
|
||||||
|
@ -1185,9 +1185,9 @@ class MsG(cmds.Cog):
|
||||||
await ctx.send(
|
await ctx.send(
|
||||||
'**Use a flag to manage blacklists.**\n'
|
'**Use a flag to manage blacklists.**\n'
|
||||||
f'*Type* `{ctx.prefix}help bl` *for more info.*')
|
f'*Type* `{ctx.prefix}help bl` *for more info.*')
|
||||||
await u.add_reaction(ctx.message, '\N{CROSS MARK}')
|
await u.add_reaction(ctx.message, '\N{HEAVY EXCLAMATION MARK SYMBOL}')
|
||||||
elif not ctx.args:
|
elif not ctx.args:
|
||||||
await ctx.send('\N{CROSS MARK} **Missing arguments**')
|
await ctx.send('\N{HEAVY EXCLAMATION MARK SYMBOL} **Missing arguments**')
|
||||||
|
|
||||||
@blacklist.group(
|
@blacklist.group(
|
||||||
name='get',
|
name='get',
|
||||||
|
@ -1197,8 +1197,8 @@ class MsG(cmds.Cog):
|
||||||
usage='[blacklist]')
|
usage='[blacklist]')
|
||||||
async def get_blacklist(self, ctx):
|
async def get_blacklist(self, ctx):
|
||||||
if not ctx.invoked_subcommand:
|
if not ctx.invoked_subcommand:
|
||||||
await ctx.send('\N{CROSS MARK} **Invalid blacklist**')
|
await ctx.send('\N{HEAVY EXCLAMATION MARK SYMBOL} **Invalid blacklist**')
|
||||||
await u.add_reaction(ctx.message, '\N{CROSS MARK}')
|
await u.add_reaction(ctx.message, '\N{HEAVY EXCLAMATION MARK SYMBOL}')
|
||||||
|
|
||||||
@get_blacklist.command(
|
@get_blacklist.command(
|
||||||
name='global',
|
name='global',
|
||||||
|
@ -1366,8 +1366,8 @@ class MsG(cmds.Cog):
|
||||||
usage='[blacklist] [tags...]')
|
usage='[blacklist] [tags...]')
|
||||||
async def remove_tags(self, ctx):
|
async def remove_tags(self, ctx):
|
||||||
if not ctx.invoked_subcommand:
|
if not ctx.invoked_subcommand:
|
||||||
await ctx.send('\N{CROSS MARK} **Invalid blacklist**')
|
await ctx.send('\N{HEAVY EXCLAMATION MARK SYMBOL} **Invalid blacklist**')
|
||||||
await u.add_reaction(ctx.message, '\N{CROSS MARK}')
|
await u.add_reaction(ctx.message, '\N{HEAVY EXCLAMATION MARK SYMBOL}')
|
||||||
|
|
||||||
def _remove(self, remove, lst):
|
def _remove(self, remove, lst):
|
||||||
removed = set()
|
removed = set()
|
||||||
|
@ -1464,8 +1464,8 @@ class MsG(cmds.Cog):
|
||||||
usage='[blacklist]')
|
usage='[blacklist]')
|
||||||
async def clear_blacklist(self, ctx):
|
async def clear_blacklist(self, ctx):
|
||||||
if not ctx.invoked_subcommand:
|
if not ctx.invoked_subcommand:
|
||||||
await ctx.send('\N{CROSS MARK} **Invalid blacklist**')
|
await ctx.send('\N{HEAVY EXCLAMATION MARK SYMBOL} **Invalid blacklist**')
|
||||||
await u.add_reaction(ctx.message, '\N{CROSS MARK}')
|
await u.add_reaction(ctx.message, '\N{HEAVY EXCLAMATION MARK SYMBOL}')
|
||||||
|
|
||||||
@clear_blacklist.command(
|
@clear_blacklist.command(
|
||||||
name='global',
|
name='global',
|
||||||
|
|
|
@ -179,7 +179,7 @@ class Bot(cmds.Cog):
|
||||||
await ctx.send(f'**Username changed to** `{username}`')
|
await ctx.send(f'**Username changed to** `{username}`')
|
||||||
else:
|
else:
|
||||||
await ctx.send('**Invalid string**')
|
await ctx.send('**Invalid string**')
|
||||||
await u.add_reaction(ctx.message, '\N{CROSS MARK}')
|
await u.add_reaction(ctx.message, '\N{HEAVY EXCLAMATION MARK SYMBOL}')
|
||||||
|
|
||||||
|
|
||||||
class Tools(cmds.Cog):
|
class Tools(cmds.Cog):
|
||||||
|
|
|
@ -63,15 +63,17 @@ class Utils(cmds.Cog):
|
||||||
|
|
||||||
try:
|
try:
|
||||||
await tempchannel.send(message)
|
await tempchannel.send(message)
|
||||||
|
await ctx.add_reaction('\N{WHITE HEAVY CHECK MARK}')
|
||||||
|
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
await ctx.send('**Invalid channel**')
|
await ctx.send('**Invalid channel**')
|
||||||
await u.add_reaction(ctx.message, '\N{CROSS MARK}')
|
await u.add_reaction(ctx.message, '\N{HEAVY EXCLAMATION MARK SYMBOL}')
|
||||||
|
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
await ctx.send('**Invalid guild**')
|
await ctx.send('**Invalid guild**')
|
||||||
await u.add_reaction(ctx.message, '\N{CROSS MARK}')
|
await u.add_reaction(ctx.message, '\N{HEAVY EXCLAMATION MARK SYMBOL}')
|
||||||
|
|
||||||
@send.command(name='user', aliases=['u', 'member', 'm'])
|
@send.command(name='user', aliases=['u', 'member', 'm'])
|
||||||
async def send_user(self, ctx, user, *, message):
|
async def send_user(self, ctx, user, *, message):
|
||||||
await d.utils.get(self.bot.get_all_members(), id=int(user)).send(message)
|
await d.utils.get(self.bot.get_all_members(), id=int(user)).send(message)
|
||||||
|
await ctx.add_reaction('\N{WHITE HEAVY CHECK MARK}')
|
||||||
|
|
|
@ -128,10 +128,10 @@ async def on_command_error(ctx, error):
|
||||||
await u.add_reaction(ctx.message, '\N{WHITE HEAVY CHECK MARK}')
|
await u.add_reaction(ctx.message, '\N{WHITE HEAVY CHECK MARK}')
|
||||||
elif isinstance(error, errext.MissingRequiredArgument):
|
elif isinstance(error, errext.MissingRequiredArgument):
|
||||||
await ctx.send('**Missing required argument**')
|
await ctx.send('**Missing required argument**')
|
||||||
await u.add_reaction(ctx.message, '\N{CROSS MARK}')
|
await u.add_reaction(ctx.message, '\N{HEAVY EXCLAMATION MARK SYMBOL}')
|
||||||
elif isinstance(error, errext.BadArgument):
|
elif isinstance(error, errext.BadArgument):
|
||||||
await ctx.send(f'**Invalid argument.** {error}')
|
await ctx.send(f'**Invalid argument.** {error}')
|
||||||
await u.add_reaction(ctx.message, '\N{CROSS MARK}')
|
await u.add_reaction(ctx.message, '\N{HEAVY EXCLAMATION MARK SYMBOL}')
|
||||||
elif isinstance(error, errext.CheckFailure):
|
elif isinstance(error, errext.CheckFailure):
|
||||||
await ctx.send('**Insufficient permissions**')
|
await ctx.send('**Insufficient permissions**')
|
||||||
await u.add_reaction(ctx.message, '\N{NO ENTRY}')
|
await u.add_reaction(ctx.message, '\N{NO ENTRY}')
|
||||||
|
|
Loading…
Reference in a new issue