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

Change tag limit to accommodate e621 update

This commit is contained in:
Myned 2020-03-09 11:33:11 -04:00
parent 61e4e2fca9
commit 75698ba127
No known key found for this signature in database
GPG key ID: 2EF9C0C44229D034

View file

@ -695,8 +695,8 @@ class MsG(cmds.Cog):
order = 'order:random' order = 'order:random'
# Checks if tags are in local blacklists # Checks if tags are in local blacklists
if tags: if tags:
if (len(tags) > 5 and booru == 'e621') or (len(tags) > 4 and booru == 'e926'): if (len(tags) > 40):
raise exc.TagBoundsError(' '.join(tags[5:])) raise exc.TagBoundsError(' '.join(tags[40:]))
for tag in tags: for tag in tags:
if tag == 'swf' or tag == 'webm' or tag in blacklist: if tag == 'swf' or tag == 'webm' or tag in blacklist:
raise exc.TagBlacklisted(tag) raise exc.TagBlacklisted(tag)
@ -1002,7 +1002,7 @@ class MsG(cmds.Cog):
await ctx.send('\N{NO ENTRY SIGN} `{}` **blacklisted**'.format(e)) await ctx.send('\N{NO ENTRY SIGN} `{}` **blacklisted**'.format(e))
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 40.'.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 exc.FavoritesNotFound: except exc.FavoritesNotFound:
await ctx.send('**You have no favorite tags**') await ctx.send('**You have no favorite tags**')
@ -1063,7 +1063,7 @@ class MsG(cmds.Cog):
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{HEAVY EXCLAMATION MARK SYMBOL}') 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 40.'.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 exc.NotFound as e: except exc.NotFound as e:
await ctx.send('`{}` **not found**'.format(e)) await ctx.send('`{}` **not found**'.format(e))