mirror of
https://github.com/myned/modufur.git
synced 2024-12-25 14:47:29 +00:00
Merge branch 'dev'
This commit is contained in:
commit
87090bb64a
2 changed files with 19 additions and 11 deletions
|
@ -422,18 +422,22 @@ class MsG(cmds.Cog):
|
||||||
await ctx.message.delete()
|
await ctx.message.delete()
|
||||||
|
|
||||||
except exc.MissingArgument:
|
except exc.MissingArgument:
|
||||||
await ctx.send('\N{HEAVY EXCLAMATION MARK SYMBOL} **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.**\n'
|
||||||
|
'Be sure the link directs to an image file')
|
||||||
await u.add_reaction(ctx.message, '\N{HEAVY EXCLAMATION MARK SYMBOL}')
|
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.**\nMaximum is 8 MB')
|
||||||
await u.add_reaction(ctx.message, '\N{HEAVY EXCLAMATION MARK SYMBOL}')
|
await u.add_reaction(ctx.message, '\N{HEAVY EXCLAMATION MARK SYMBOL}')
|
||||||
except err.HTTPException:
|
except err.HTTPException:
|
||||||
await ctx.send('\N{HEAVY EXCLAMATION MARK SYMBOL} **The image database returned an unexpected result.** It may be offline')
|
await ctx.send(
|
||||||
|
'\N{HEAVY EXCLAMATION MARK SYMBOL} **Search engines returned an unexpected result.**\n'
|
||||||
|
'They may be offline')
|
||||||
await u.add_reaction(ctx.message, '\N{HEAVY EXCLAMATION MARK SYMBOL}')
|
await u.add_reaction(ctx.message, '\N{HEAVY EXCLAMATION MARK SYMBOL}')
|
||||||
except exc.ImageError:
|
except exc.ImageError:
|
||||||
await ctx.send(
|
await ctx.send(
|
||||||
'\N{HEAVY EXCLAMATION MARK SYMBOL} **None of the search engines could use this file.** '
|
'\N{HEAVY EXCLAMATION MARK SYMBOL} **Search engines were denied access to this file.**\n'
|
||||||
'Try opening it in a browser and uploading the copied file into Discord')
|
'Try opening it in a browser and uploading the file to Discord')
|
||||||
|
|
||||||
@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)
|
||||||
|
@ -494,7 +498,7 @@ class MsG(cmds.Cog):
|
||||||
await message.add_reaction('\N{CROSS MARK}')
|
await message.add_reaction('\N{CROSS MARK}')
|
||||||
c -= 1
|
c -= 1
|
||||||
except exc.SizeError as e:
|
except exc.SizeError as e:
|
||||||
await dest.send(f'`{e}` **too large.** Maximum is 8 MB')
|
await dest.send(f'`{e}` **too large.**\nMaximum is 8 MB')
|
||||||
await message.add_reaction('\N{CROSS MARK}')
|
await message.add_reaction('\N{CROSS MARK}')
|
||||||
c -= 1
|
c -= 1
|
||||||
|
|
||||||
|
@ -508,15 +512,17 @@ class MsG(cmds.Cog):
|
||||||
await dest.send('**No matches found**')
|
await dest.send('**No matches found**')
|
||||||
await u.add_reaction(ctx.message, '\N{HEAVY EXCLAMATION MARK SYMBOL}')
|
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 5'.format(e))
|
await dest.send('`{}` **invalid limit.**\nQuery limited to 5'.format(e))
|
||||||
await u.add_reaction(ctx.message, '\N{HEAVY EXCLAMATION MARK SYMBOL}')
|
await u.add_reaction(ctx.message, '\N{HEAVY EXCLAMATION MARK SYMBOL}')
|
||||||
except err.HTTPException:
|
except err.HTTPException:
|
||||||
await dest.send('\N{HEAVY EXCLAMATION MARK SYMBOL} **The image database returned an unexpected result.** It may be offline')
|
await dest.send(
|
||||||
|
'\N{HEAVY EXCLAMATION MARK SYMBOL} **Search engines returned an unexpected result.**\n'
|
||||||
|
'They may be offline')
|
||||||
await u.add_reaction(ctx.message, '\N{HEAVY EXCLAMATION MARK SYMBOL}')
|
await u.add_reaction(ctx.message, '\N{HEAVY EXCLAMATION MARK SYMBOL}')
|
||||||
except exc.ImageError:
|
except exc.ImageError:
|
||||||
await ctx.send(
|
await ctx.send(
|
||||||
'\N{HEAVY EXCLAMATION MARK SYMBOL} **None of the search engines could use this file.** '
|
'\N{HEAVY EXCLAMATION MARK SYMBOL} **Search engines were denied access to this file.**\n'
|
||||||
'Try opening it in a browser and uploading the copied file into Discord')
|
'Try opening it in a browser and uploading the file to Discord')
|
||||||
|
|
||||||
async def _reversify(self):
|
async def _reversify(self):
|
||||||
while self.reversifying:
|
while self.reversifying:
|
||||||
|
|
|
@ -83,7 +83,9 @@ async def query_saucenao(url):
|
||||||
params={'url': url, 'api_key': u.config['saucenao_api'], 'output_type': 2},
|
params={'url': url, 'api_key': u.config['saucenao_api'], 'output_type': 2},
|
||||||
json=True)
|
json=True)
|
||||||
|
|
||||||
if content['header'].get('message', '') == 'Access to specified file was denied... ;_;':
|
if content['header'].get('message', '') in (
|
||||||
|
'Access to specified file was denied... ;_;',
|
||||||
|
'Problem with remote server...'):
|
||||||
raise exc.ImageError
|
raise exc.ImageError
|
||||||
|
|
||||||
match = content['results'][0]
|
match = content['results'][0]
|
||||||
|
|
Loading…
Reference in a new issue