mirror of
https://github.com/myned/modufur.git
synced 2024-11-01 13:02:38 +00:00
Merge branch 'dev'
This commit is contained in:
commit
3f018dd6e9
3 changed files with 38 additions and 37 deletions
|
@ -304,7 +304,7 @@ class MsG:
|
|||
icon_url=self._get_score(post['score']))
|
||||
|
||||
except exc.MissingArgument:
|
||||
await ctx.send('**Invalid url**')
|
||||
await ctx.send('\N{CROSS MARK} **Invalid url**')
|
||||
await ctx.message.add_reaction('\N{CROSS MARK}')
|
||||
|
||||
@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')
|
||||
|
@ -331,7 +331,7 @@ class MsG:
|
|||
await ctx.message.add_reaction('\N{CROSS MARK}')
|
||||
|
||||
except exc.MissingArgument:
|
||||
await ctx.send('**Invalid url or file**')
|
||||
await ctx.send('\N{CROSS MARK} **Invalid url or file**')
|
||||
await ctx.message.add_reaction('\N{CROSS MARK}')
|
||||
|
||||
@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')
|
||||
|
@ -423,7 +423,7 @@ class MsG:
|
|||
await ctx.message.delete()
|
||||
|
||||
except exc.MissingArgument:
|
||||
await ctx.send('**Invalid url or file.** Be sure the link directs to an image file')
|
||||
await ctx.send('\N{CROSS MARK} **Invalid url or file.** Be sure the link directs to an image file')
|
||||
await ctx.message.add_reaction('\N{CROSS MARK}')
|
||||
except exc.SizeError as e:
|
||||
await ctx.send(f'`{e}` **too large.** Maximum is 8 MB')
|
||||
|
@ -1417,7 +1417,7 @@ class MsG:
|
|||
usage='[blacklist]')
|
||||
async def get_blacklist(self, ctx):
|
||||
if not ctx.invoked_subcommand:
|
||||
await ctx.send('**Invalid blacklist**')
|
||||
await ctx.send('\N{CROSS MARK} **Invalid blacklist**')
|
||||
await ctx.message.add_reaction('\N{CROSS MARK}')
|
||||
|
||||
@get_blacklist.command(
|
||||
|
@ -1483,7 +1483,7 @@ class MsG:
|
|||
usage='[blacklist] [tags...]')
|
||||
async def add_tags(self, ctx):
|
||||
if not ctx.invoked_subcommand:
|
||||
await ctx.send('**Invalid blacklist**')
|
||||
await ctx.send('\N{CROSS MARK} **Invalid blacklist**')
|
||||
await ctx.message.add_reaction('\N{CROSS MARK}')
|
||||
|
||||
async def _add(self, tags, lst, alias=False):
|
||||
|
@ -1586,7 +1586,7 @@ class MsG:
|
|||
usage='[blacklist] [tags...]')
|
||||
async def remove_tags(self, ctx):
|
||||
if not ctx.invoked_subcommand:
|
||||
await ctx.send('**Invalid blacklist**')
|
||||
await ctx.send('\N{CROSS MARK} **Invalid blacklist**')
|
||||
await ctx.message.add_reaction('\N{CROSS MARK}')
|
||||
|
||||
def _remove(self, remove, lst):
|
||||
|
@ -1684,7 +1684,7 @@ class MsG:
|
|||
usage='[blacklist]')
|
||||
async def clear_blacklist(self, ctx):
|
||||
if not ctx.invoked_subcommand:
|
||||
await ctx.send('**Invalid blacklist**')
|
||||
await ctx.send('\N{CROSS MARK} **Invalid blacklist**')
|
||||
await ctx.message.add_reaction('\N{CROSS MARK}')
|
||||
|
||||
@clear_blacklist.command(
|
||||
|
|
|
@ -159,6 +159,7 @@ async def on_error(error, *args, **kwargs):
|
|||
|
||||
@bot.event
|
||||
async def on_command_error(ctx, error):
|
||||
with suppress(err.NotFound):
|
||||
if isinstance(error, errext.CommandOnCooldown):
|
||||
await ctx.message.add_reaction('\N{HOURGLASS}')
|
||||
await asyncio.sleep(error.retry_after)
|
||||
|
|
|
@ -16,7 +16,7 @@ async def get_post(url):
|
|||
if filesize > 8192 * 1024:
|
||||
raise exc.SizeError(size(filesize, system=alternative))
|
||||
|
||||
except ValueError:
|
||||
except (ValueError, KeyError):
|
||||
raise exc.MissingArgument
|
||||
|
||||
content = await u.fetch('http://iqdb.harry.lu', params={'url': url})
|
||||
|
|
Loading…
Reference in a new issue