mirror of
https://github.com/myned/modufur.git
synced 2024-12-24 22:27:28 +00:00
Removed periods from output for aesthetic purposes
This commit is contained in:
parent
dcc251496b
commit
ddc020e11d
4 changed files with 69 additions and 69 deletions
|
@ -173,7 +173,7 @@ class MsG:
|
||||||
await ctx.message.add_reaction('\N{WHITE HEAVY CHECK MARK}')
|
await ctx.message.add_reaction('\N{WHITE HEAVY CHECK MARK}')
|
||||||
|
|
||||||
except exc.MissingArgument:
|
except exc.MissingArgument:
|
||||||
await ctx.send('**Invalid url or file.**', delete_after=10)
|
await ctx.send('**Invalid url or file**', delete_after=10)
|
||||||
await ctx.message.add_reaction('\N{CROSS MARK}')
|
await ctx.message.add_reaction('\N{CROSS MARK}')
|
||||||
|
|
||||||
# Reverse image searches a linked image using the public iqdb
|
# Reverse image searches a linked image using the public iqdb
|
||||||
|
@ -218,7 +218,7 @@ class MsG:
|
||||||
await ctx.message.add_reaction('\N{CROSS MARK}')
|
await ctx.message.add_reaction('\N{CROSS MARK}')
|
||||||
|
|
||||||
except exc.MissingArgument:
|
except exc.MissingArgument:
|
||||||
await ctx.send('**Invalid url or file.**', delete_after=10)
|
await ctx.send('**Invalid url or file**', delete_after=10)
|
||||||
await ctx.message.add_reaction('\N{CROSS MARK}')
|
await ctx.message.add_reaction('\N{CROSS MARK}')
|
||||||
|
|
||||||
@commands.command(name='quality', aliases=['qual', 'qrev', 'qis'])
|
@commands.command(name='quality', aliases=['qual', 'qrev', 'qis'])
|
||||||
|
@ -266,7 +266,7 @@ class MsG:
|
||||||
await ctx.message.add_reaction('\N{CROSS MARK}')
|
await ctx.message.add_reaction('\N{CROSS MARK}')
|
||||||
|
|
||||||
except exc.MissingArgument:
|
except exc.MissingArgument:
|
||||||
await ctx.send('**Invalid url or file.**', delete_after=10)
|
await ctx.send('**Invalid url or file**', delete_after=10)
|
||||||
await ctx.message.add_reaction('\N{CROSS MARK}')
|
await ctx.message.add_reaction('\N{CROSS MARK}')
|
||||||
|
|
||||||
@commands.command(name='reversify', aliases=['revify', 'risify', 'rify'])
|
@commands.command(name='reversify', aliases=['revify', 'risify', 'rify'])
|
||||||
|
@ -333,7 +333,7 @@ class MsG:
|
||||||
await ctx.message.add_reaction('\N{WHITE HEAVY CHECK MARK}')
|
await ctx.message.add_reaction('\N{WHITE HEAVY CHECK MARK}')
|
||||||
|
|
||||||
except exc.NotFound:
|
except exc.NotFound:
|
||||||
await ctx.send('**No matches found.**', delete_after=10)
|
await ctx.send('**No matches found**', delete_after=10)
|
||||||
await ctx.message.add_reaction('\N{CROSS MARK}')
|
await ctx.message.add_reaction('\N{CROSS MARK}')
|
||||||
except exc.BoundsError as e:
|
except exc.BoundsError as e:
|
||||||
await ctx.send('`{}` **invalid limit.** Query limited to 30'.format(e), delete_after=10)
|
await ctx.send('`{}` **invalid limit.** Query limited to 30'.format(e), delete_after=10)
|
||||||
|
@ -407,7 +407,7 @@ class MsG:
|
||||||
await ctx.message.add_reaction('\N{WHITE HEAVY CHECK MARK}')
|
await ctx.message.add_reaction('\N{WHITE HEAVY CHECK MARK}')
|
||||||
|
|
||||||
except exc.NotFound:
|
except exc.NotFound:
|
||||||
await ctx.send('**No matches found.**', delete_after=10)
|
await ctx.send('**No matches found**', delete_after=10)
|
||||||
await ctx.message.add_reaction('\N{CROSS MARK}')
|
await ctx.message.add_reaction('\N{CROSS MARK}')
|
||||||
except exc.BoundsError as e:
|
except exc.BoundsError as e:
|
||||||
await ctx.send('`{}` **invalid limit.** Query limited to 30'.format(e), delete_after=10)
|
await ctx.send('`{}` **invalid limit.** Query limited to 30'.format(e), delete_after=10)
|
||||||
|
@ -441,8 +441,8 @@ class MsG:
|
||||||
|
|
||||||
post = await scraper.get_post(attachment.url)
|
post = await scraper.get_post(attachment.url)
|
||||||
|
|
||||||
await message.channel.send('**Probable match from** {}**:**\n{}'.format(message.author.display_name, await scraper.get_image(post)))
|
await message.channel.send('**Probable match from** {}\n{}'.format(message.author.display_name, await scraper.get_image(post)))
|
||||||
await message.add_reaction('\N{WHITE HEAVY CHECK MARK}')
|
await message.add_reaction('\N{WHITE HEAVY CHECK MARK}')
|
||||||
|
|
||||||
await asyncio.sleep(self.RATE_LIMIT)
|
await asyncio.sleep(self.RATE_LIMIT)
|
||||||
|
|
||||||
|
@ -475,7 +475,7 @@ class MsG:
|
||||||
if not u.tasks['auto_qual']:
|
if not u.tasks['auto_qual']:
|
||||||
self.qualitifying = False
|
self.qualitifying = False
|
||||||
print('STOPPED : qualitifying #{}'.format(channel.name))
|
print('STOPPED : qualitifying #{}'.format(channel.name))
|
||||||
await channel.send('**Stopped queueing messages for qualitification in** {}**.**'.format(channel.mention), delete_after=5)
|
await channel.send('**Stopped queueing messages for qualitification in** {}'.format(channel.mention), delete_after=5)
|
||||||
|
|
||||||
@commands.command(name='autoqualitify', aliases=['autoqual'])
|
@commands.command(name='autoqualitify', aliases=['autoqual'])
|
||||||
@commands.has_permissions(manage_channels=True)
|
@commands.has_permissions(manage_channels=True)
|
||||||
|
@ -490,7 +490,7 @@ class MsG:
|
||||||
self.qualitifying = True
|
self.qualitifying = True
|
||||||
|
|
||||||
print('AUTO-QUALITIFYING : #{}'.format(ctx.channel.name))
|
print('AUTO-QUALITIFYING : #{}'.format(ctx.channel.name))
|
||||||
await ctx.send('**Auto-qualitifying all images in {}.**'.format(ctx.channel.mention), delete_after=5)
|
await ctx.send('**Auto-qualitifying all images in** {}'.format(ctx.channel.mention), delete_after=5)
|
||||||
await ctx.message.add_reaction('\N{WHITE HEAVY CHECK MARK}')
|
await ctx.message.add_reaction('\N{WHITE HEAVY CHECK MARK}')
|
||||||
else:
|
else:
|
||||||
raise exc.Exists
|
raise exc.Exists
|
||||||
|
@ -689,7 +689,7 @@ class MsG:
|
||||||
|
|
||||||
await paginator.edit(content='\N{HEAVY BLACK HEART}' if values[c - 1]['url'] in hearted else None, embed=embed)
|
await paginator.edit(content='\N{HEAVY BLACK HEART}' if values[c - 1]['url'] in hearted else None, embed=embed)
|
||||||
else:
|
else:
|
||||||
await paginator.edit(content='**First image.**')
|
await paginator.edit(content='**First image**')
|
||||||
|
|
||||||
except exc.GoTo:
|
except exc.GoTo:
|
||||||
await paginator.edit(content='**Enter image number...**')
|
await paginator.edit(content='**Enter image number...**')
|
||||||
|
@ -724,9 +724,9 @@ class MsG:
|
||||||
await paginator.edit(content='\N{HEAVY BLACK HEART}' if values[c - 1]['url'] in hearted else None, embed=embed)
|
await paginator.edit(content='\N{HEAVY BLACK HEART}' if values[c - 1]['url'] in hearted else None, embed=embed)
|
||||||
|
|
||||||
except IndexError:
|
except IndexError:
|
||||||
await paginator.edit(content='**No more images found.**')
|
await paginator.edit(content='**No more images found**')
|
||||||
except exc.NotFound:
|
except exc.NotFound:
|
||||||
await paginator.edit(content='**No more images found.**')
|
await paginator.edit(content='**No more images found**')
|
||||||
else:
|
else:
|
||||||
kwargs = u.get_kwargs(ctx, args)
|
kwargs = u.get_kwargs(ctx, args)
|
||||||
dest, query = kwargs['destination'], kwargs['remaining']
|
dest, query = kwargs['destination'], kwargs['remaining']
|
||||||
|
@ -782,7 +782,7 @@ class MsG:
|
||||||
|
|
||||||
await paginator.edit(content='\N{HEAVY BLACK HEART}' if values[c - 1]['url'] in hearted else None, embed=embed)
|
await paginator.edit(content='\N{HEAVY BLACK HEART}' if values[c - 1]['url'] in hearted else None, embed=embed)
|
||||||
else:
|
else:
|
||||||
await paginator.edit(content='**First image.**')
|
await paginator.edit(content='**First image**')
|
||||||
|
|
||||||
except exc.GoTo:
|
except exc.GoTo:
|
||||||
await paginator.edit(content='**Enter image number...**')
|
await paginator.edit(content='**Enter image number...**')
|
||||||
|
@ -809,7 +809,7 @@ class MsG:
|
||||||
|
|
||||||
await paginator.edit(content='\N{HEAVY BLACK HEART}' if values[c - 1]['url'] in hearted else None, embed=embed)
|
await paginator.edit(content='\N{HEAVY BLACK HEART}' if values[c - 1]['url'] in hearted else None, embed=embed)
|
||||||
else:
|
else:
|
||||||
await paginator.edit(content='**Last image.**')
|
await paginator.edit(content='**Last image**')
|
||||||
|
|
||||||
finally:
|
finally:
|
||||||
return hearted
|
return hearted
|
||||||
|
@ -823,25 +823,25 @@ class MsG:
|
||||||
|
|
||||||
except exc.Abort:
|
except exc.Abort:
|
||||||
try:
|
try:
|
||||||
await paginator.edit(content='**Exited paginator.**')
|
await paginator.edit(content='**Exited paginator**')
|
||||||
|
|
||||||
except UnboundLocalError:
|
except UnboundLocalError:
|
||||||
await dest.send('**Exited paginator.**')
|
await dest.send('**Exited paginator**')
|
||||||
if not hearted:
|
if not hearted:
|
||||||
await ctx.message.add_reaction('\N{WHITE HEAVY CHECK MARK}')
|
await ctx.message.add_reaction('\N{WHITE HEAVY CHECK MARK}')
|
||||||
except asyncio.TimeoutError:
|
except asyncio.TimeoutError:
|
||||||
try:
|
try:
|
||||||
await paginator.edit(content='**Paginator timed out.**')
|
await paginator.edit(content='**Paginator timed out**')
|
||||||
|
|
||||||
except UnboundLocalError:
|
except UnboundLocalError:
|
||||||
await dest.send('**Paginator timed out.**')
|
await dest.send('**Paginator timed out**')
|
||||||
if not hearted:
|
if not hearted:
|
||||||
await ctx.message.add_reaction('\N{WHITE HEAVY CHECK MARK}')
|
await ctx.message.add_reaction('\N{WHITE HEAVY CHECK MARK}')
|
||||||
except exc.NotFound:
|
except exc.NotFound:
|
||||||
await ctx.send('**Pool not found.**', delete_after=10)
|
await ctx.send('**Pool not found**', delete_after=10)
|
||||||
await ctx.message.add_reaction('\N{CROSS MARK}')
|
await ctx.message.add_reaction('\N{CROSS MARK}')
|
||||||
except exc.Timeout:
|
except exc.Timeout:
|
||||||
await ctx.send('**Request timed out.**')
|
await ctx.send('**Request timed out**')
|
||||||
await ctx.message.add_reaction('\N{CROSS MARK}')
|
await ctx.message.add_reaction('\N{CROSS MARK}')
|
||||||
|
|
||||||
finally:
|
finally:
|
||||||
|
@ -864,34 +864,34 @@ class MsG:
|
||||||
|
|
||||||
except exc.Abort:
|
except exc.Abort:
|
||||||
try:
|
try:
|
||||||
await paginator.edit(content='**Exited paginator.**')
|
await paginator.edit(content='**Exited paginator**')
|
||||||
|
|
||||||
except UnboundLocalError:
|
except UnboundLocalError:
|
||||||
await dest.send('**Exited paginator.**')
|
await dest.send('**Exited paginator**')
|
||||||
if not hearted:
|
if not hearted:
|
||||||
await ctx.message.add_reaction('\N{WHITE HEAVY CHECK MARK}')
|
await ctx.message.add_reaction('\N{WHITE HEAVY CHECK MARK}')
|
||||||
except asyncio.TimeoutError:
|
except asyncio.TimeoutError:
|
||||||
try:
|
try:
|
||||||
await paginator.edit(content='**Paginator timed out.**')
|
await paginator.edit(content='**Paginator timed out**')
|
||||||
|
|
||||||
except UnboundLocalError:
|
except UnboundLocalError:
|
||||||
await dest.send('**Paginator timed out.**')
|
await dest.send('**Paginator timed out**')
|
||||||
if not hearted:
|
if not hearted:
|
||||||
await ctx.message.add_reaction('\N{WHITE HEAVY CHECK MARK}')
|
await ctx.message.add_reaction('\N{WHITE HEAVY CHECK MARK}')
|
||||||
except exc.NotFound as e:
|
except exc.NotFound as e:
|
||||||
await ctx.send('`{}` **not found.**'.format(e), delete_after=10)
|
await ctx.send('`{}` **not found**'.format(e), delete_after=10)
|
||||||
await ctx.message.add_reaction('\N{CROSS MARK}')
|
await ctx.message.add_reaction('\N{CROSS MARK}')
|
||||||
except exc.TagBlacklisted as e:
|
except exc.TagBlacklisted as e:
|
||||||
await ctx.send('\N{NO ENTRY SIGN} `{}` **blacklisted.**'.format(e), delete_after=10)
|
await ctx.send('\N{NO ENTRY SIGN} `{}` **blacklisted**'.format(e), delete_after=10)
|
||||||
await ctx.message.add_reaction('\N{NO ENTRY SIGN}')
|
await ctx.message.add_reaction('\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), delete_after=10)
|
await ctx.send('`{}` **out of bounds.** Tags limited to 5.'.format(e), delete_after=10)
|
||||||
await ctx.message.add_reaction('\N{CROSS MARK}')
|
await ctx.message.add_reaction('\N{CROSS MARK}')
|
||||||
except exc.FavoritesNotFound:
|
except exc.FavoritesNotFound:
|
||||||
await ctx.send('**You have no favorite tags.**', delete_after=10)
|
await ctx.send('**You have no favorite tags**', delete_after=10)
|
||||||
await ctx.message.add_reaction('\N{CROSS MARK}')
|
await ctx.message.add_reaction('\N{CROSS MARK}')
|
||||||
except exc.Timeout:
|
except exc.Timeout:
|
||||||
await ctx.send('**Request timed out.**')
|
await ctx.send('**Request timed out**')
|
||||||
await ctx.message.add_reaction('\N{CROSS MARK}')
|
await ctx.message.add_reaction('\N{CROSS MARK}')
|
||||||
|
|
||||||
finally:
|
finally:
|
||||||
|
@ -908,7 +908,7 @@ class MsG:
|
||||||
@e621_paginator.error
|
@e621_paginator.error
|
||||||
async def e621_paginator_error(self, ctx, error):
|
async def e621_paginator_error(self, ctx, error):
|
||||||
if isinstance(error, errext.CheckFailure):
|
if isinstance(error, errext.CheckFailure):
|
||||||
await ctx.send('\N{NO ENTRY} {} **is not an NSFW channel.**'.format(ctx.channel.mention), delete_after=10)
|
await ctx.send('\N{NO ENTRY} {} **is not an NSFW channel**'.format(ctx.channel.mention), delete_after=10)
|
||||||
return await ctx.message.add_reaction('\N{NO ENTRY}')
|
return await ctx.message.add_reaction('\N{NO ENTRY}')
|
||||||
|
|
||||||
# Searches for and returns images from e621.net given tags when not blacklisted
|
# Searches for and returns images from e621.net given tags when not blacklisted
|
||||||
|
@ -939,7 +939,7 @@ class MsG:
|
||||||
await ctx.message.add_reaction('\N{WHITE HEAVY CHECK MARK}')
|
await ctx.message.add_reaction('\N{WHITE HEAVY CHECK MARK}')
|
||||||
|
|
||||||
except exc.TagBlacklisted as e:
|
except exc.TagBlacklisted as e:
|
||||||
await ctx.send('`{}` **blacklisted.**'.format(e), delete_after=10)
|
await ctx.send('`{}` **blacklisted**'.format(e), delete_after=10)
|
||||||
await ctx.message.add_reaction('\N{CROSS MARK}')
|
await ctx.message.add_reaction('\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), delete_after=10)
|
await ctx.send('`{}` **out of bounds.** Images limited to 3.'.format(e), delete_after=10)
|
||||||
|
@ -948,13 +948,13 @@ class MsG:
|
||||||
await ctx.send('`{}` **out of bounds.** Tags limited to 5.'.format(e), delete_after=10)
|
await ctx.send('`{}` **out of bounds.** Tags limited to 5.'.format(e), delete_after=10)
|
||||||
await ctx.message.add_reaction('\N{CROSS MARK}')
|
await ctx.message.add_reaction('\N{CROSS MARK}')
|
||||||
except exc.NotFound as e:
|
except exc.NotFound as e:
|
||||||
await ctx.send('`{}` **not found.**'.format(e), delete_after=10)
|
await ctx.send('`{}` **not found**'.format(e), delete_after=10)
|
||||||
await ctx.message.add_reaction('\N{CROSS MARK}')
|
await ctx.message.add_reaction('\N{CROSS MARK}')
|
||||||
except exc.FavoritesNotFound:
|
except exc.FavoritesNotFound:
|
||||||
await ctx.send('**You have no favorite tags.**', delete_after=10)
|
await ctx.send('**You have no favorite tags**', delete_after=10)
|
||||||
await ctx.message.add_reaction('\N{CROSS MARK}')
|
await ctx.message.add_reaction('\N{CROSS MARK}')
|
||||||
except exc.Timeout:
|
except exc.Timeout:
|
||||||
await ctx.send('**Request timed out.**')
|
await ctx.send('**Request timed out**')
|
||||||
await ctx.message.add_reaction('\N{CROSS MARK}')
|
await ctx.message.add_reaction('\N{CROSS MARK}')
|
||||||
|
|
||||||
# tools.command_dict.setdefault(str(ctx.author.id), {}).update(
|
# tools.command_dict.setdefault(str(ctx.author.id), {}).update(
|
||||||
|
@ -963,7 +963,7 @@ class MsG:
|
||||||
@e621.error
|
@e621.error
|
||||||
async def e621_error(self, ctx, error):
|
async def e621_error(self, ctx, error):
|
||||||
if isinstance(error, errext.CheckFailure):
|
if isinstance(error, errext.CheckFailure):
|
||||||
await ctx.send('\N{NO ENTRY} {} **is not an NSFW channel.**'.format(ctx.channel.mention), delete_after=10)
|
await ctx.send('\N{NO ENTRY} {} **is not an NSFW channel**'.format(ctx.channel.mention), delete_after=10)
|
||||||
return await ctx.message.add_reaction('\N{NO ENTRY}')
|
return await ctx.message.add_reaction('\N{NO ENTRY}')
|
||||||
|
|
||||||
# Searches for and returns images from e926.net given tags when not blacklisted
|
# Searches for and returns images from e926.net given tags when not blacklisted
|
||||||
|
@ -993,7 +993,7 @@ class MsG:
|
||||||
await ctx.message.add_reaction('\N{WHITE HEAVY CHECK MARK}')
|
await ctx.message.add_reaction('\N{WHITE HEAVY CHECK MARK}')
|
||||||
|
|
||||||
except exc.TagBlacklisted as e:
|
except exc.TagBlacklisted as e:
|
||||||
await ctx.send('`{}` **blacklisted.**'.format(e), delete_after=10)
|
await ctx.send('`{}` **blacklisted**'.format(e), delete_after=10)
|
||||||
await ctx.message.add_reaction('\N{CROSS MARK}')
|
await ctx.message.add_reaction('\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), delete_after=10)
|
await ctx.send('`{}` **out of bounds.** Images limited to 3.'.format(e), delete_after=10)
|
||||||
|
@ -1002,13 +1002,13 @@ class MsG:
|
||||||
await ctx.send('`{}` **out of bounds.** Tags limited to 5.'.format(e), delete_after=10)
|
await ctx.send('`{}` **out of bounds.** Tags limited to 5.'.format(e), delete_after=10)
|
||||||
await ctx.message.add_reaction('\N{CROSS MARK}')
|
await ctx.message.add_reaction('\N{CROSS MARK}')
|
||||||
except exc.NotFound as e:
|
except exc.NotFound as e:
|
||||||
await ctx.send('`{}` **not found.**'.format(e), delete_after=10)
|
await ctx.send('`{}` **not found**'.format(e), delete_after=10)
|
||||||
await ctx.message.add_reaction('\N{CROSS MARK}')
|
await ctx.message.add_reaction('\N{CROSS MARK}')
|
||||||
except exc.FavoritesNotFound:
|
except exc.FavoritesNotFound:
|
||||||
await ctx.send('**You have no favorite tags.**', delete_after=10)
|
await ctx.send('**You have no favorite tags**', delete_after=10)
|
||||||
await ctx.message.add_reaction('\N{CROSS MARK}')
|
await ctx.message.add_reaction('\N{CROSS MARK}')
|
||||||
except exc.Timeout:
|
except exc.Timeout:
|
||||||
await ctx.send('**Request timed out.**')
|
await ctx.send('**Request timed out**')
|
||||||
await ctx.message.add_reaction('\N{CROSS MARK}')
|
await ctx.message.add_reaction('\N{CROSS MARK}')
|
||||||
|
|
||||||
@commands.group(aliases=['fave', 'fav', 'f'])
|
@commands.group(aliases=['fave', 'fav', 'f'])
|
||||||
|
@ -1063,7 +1063,7 @@ class MsG:
|
||||||
await ctx.send('**Favorites list currently limited to:** `5`', delete_after=10)
|
await ctx.send('**Favorites list currently limited to:** `5`', delete_after=10)
|
||||||
await ctx.message.add_reaction('\N{CROSS MARK}')
|
await ctx.message.add_reaction('\N{CROSS MARK}')
|
||||||
except exc.TagBlacklisted as e:
|
except exc.TagBlacklisted as e:
|
||||||
await ctx.send('\N{NO ENTRY SIGN} `{}` **blacklisted.**', delete_after=10)
|
await ctx.send('\N{NO ENTRY SIGN} `{}` **blacklisted**', delete_after=10)
|
||||||
await ctx.message.add_reaction('\N{NO ENTRY SIGN}')
|
await ctx.message.add_reaction('\N{NO ENTRY SIGN}')
|
||||||
|
|
||||||
@_add_favorite.command(name='posts', aliases=['p'])
|
@_add_favorite.command(name='posts', aliases=['p'])
|
||||||
|
@ -1093,7 +1093,7 @@ class MsG:
|
||||||
await ctx.message.add_reaction('\N{WHITE HEAVY CHECK MARK}')
|
await ctx.message.add_reaction('\N{WHITE HEAVY CHECK MARK}')
|
||||||
|
|
||||||
except exc.TagError as e:
|
except exc.TagError as e:
|
||||||
await ctx.send('`{}` **not in favorites.**'.format(e), delete_after=10)
|
await ctx.send('`{}` **not in favorites**'.format(e), delete_after=10)
|
||||||
await ctx.message.add_reaction('\N{CROSS MARK}')
|
await ctx.message.add_reaction('\N{CROSS MARK}')
|
||||||
|
|
||||||
@_remove_favorite.command(name='posts', aliases=['p'])
|
@_remove_favorite.command(name='posts', aliases=['p'])
|
||||||
|
@ -1112,7 +1112,7 @@ class MsG:
|
||||||
del self.favorites[ctx.author.id]
|
del self.favorites[ctx.author.id]
|
||||||
u.dump(self.favorites, 'cogs/favorites.pkl')
|
u.dump(self.favorites, 'cogs/favorites.pkl')
|
||||||
|
|
||||||
await dest.send('{}**\'s favorites cleared.**'.format(ctx.author.mention), delete_after=5)
|
await dest.send('{}**\'s favorites cleared**'.format(ctx.author.mention), delete_after=5)
|
||||||
await ctx.message.add_reaction('\N{WHITE HEAVY CHECK MARK}')
|
await ctx.message.add_reaction('\N{WHITE HEAVY CHECK MARK}')
|
||||||
|
|
||||||
@_clear_favorite.command(name='posts', aliases=['p'])
|
@_clear_favorite.command(name='posts', aliases=['p'])
|
||||||
|
@ -1130,12 +1130,12 @@ class MsG:
|
||||||
# @blacklist.error
|
# @blacklist.error
|
||||||
# async def blacklist_error(self, ctx, error):
|
# async def blacklist_error(self, ctx, error):
|
||||||
# if isinstance(error, KeyError):
|
# if isinstance(error, KeyError):
|
||||||
# return await ctx.send('**Blacklist does not exist.**', delete_after=10)
|
# return await ctx.send('**Blacklist does not exist**', delete_after=10)
|
||||||
|
|
||||||
@blacklist.group(name='get', aliases=['g'])
|
@blacklist.group(name='get', aliases=['g'])
|
||||||
async def _get_blacklist(self, ctx):
|
async def _get_blacklist(self, ctx):
|
||||||
if ctx.invoked_subcommand is None:
|
if ctx.invoked_subcommand is None:
|
||||||
await ctx.send('**Invalid blacklist.**', delete_after=10)
|
await ctx.send('**Invalid blacklist**', delete_after=10)
|
||||||
await ctx.message.add_reaction('\N{CROSS MARK}')
|
await ctx.message.add_reaction('\N{CROSS MARK}')
|
||||||
|
|
||||||
@_get_blacklist.command(name='global', aliases=['gl', 'g'])
|
@_get_blacklist.command(name='global', aliases=['gl', 'g'])
|
||||||
|
@ -1175,7 +1175,7 @@ class MsG:
|
||||||
@_get_blacklist.group(name='all', aliases=['a'])
|
@_get_blacklist.group(name='all', aliases=['a'])
|
||||||
async def __get_all_blacklists(self, ctx):
|
async def __get_all_blacklists(self, ctx):
|
||||||
if ctx.invoked_subcommand is None:
|
if ctx.invoked_subcommand is None:
|
||||||
await ctx.send('**Invalid blacklist.**')
|
await ctx.send('**Invalid blacklist**')
|
||||||
await ctx.message.add_reaction('\N{CROSS MARK}')
|
await ctx.message.add_reaction('\N{CROSS MARK}')
|
||||||
|
|
||||||
@__get_all_blacklists.command(name='guild', aliases=['g'])
|
@__get_all_blacklists.command(name='guild', aliases=['g'])
|
||||||
|
@ -1200,7 +1200,7 @@ class MsG:
|
||||||
@blacklist.group(name='add', aliases=['a'])
|
@blacklist.group(name='add', aliases=['a'])
|
||||||
async def _add_tags(self, ctx):
|
async def _add_tags(self, ctx):
|
||||||
if ctx.invoked_subcommand is None:
|
if ctx.invoked_subcommand is None:
|
||||||
await ctx.send('**Invalid blacklist.**', delete_after=10)
|
await ctx.send('**Invalid blacklist**', delete_after=10)
|
||||||
await ctx.message.add_reaction('\N{CROSS MARK}')
|
await ctx.message.add_reaction('\N{CROSS MARK}')
|
||||||
|
|
||||||
@_add_tags.command(name='global', aliases=['gl', 'g'])
|
@_add_tags.command(name='global', aliases=['gl', 'g'])
|
||||||
|
@ -1275,7 +1275,7 @@ class MsG:
|
||||||
@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):
|
||||||
if ctx.invoked_subcommand is None:
|
if ctx.invoked_subcommand is None:
|
||||||
await ctx.send('**Invalid blacklist.**', delete_after=10)
|
await ctx.send('**Invalid blacklist**', delete_after=10)
|
||||||
await ctx.message.add_reaction('\N{CROSS MARK}')
|
await ctx.message.add_reaction('\N{CROSS MARK}')
|
||||||
|
|
||||||
@_remove_tags.command(name='global', aliases=['gl', 'g'])
|
@_remove_tags.command(name='global', aliases=['gl', 'g'])
|
||||||
|
@ -1298,7 +1298,7 @@ class MsG:
|
||||||
await ctx.message.add_reaction('\N{WHITE HEAVY CHECK MARK}')
|
await ctx.message.add_reaction('\N{WHITE HEAVY CHECK MARK}')
|
||||||
|
|
||||||
except exc.TagError as e:
|
except exc.TagError as e:
|
||||||
await ctx.send('`{}` **not in blacklist.**'.format(e), delete_after=10)
|
await ctx.send('`{}` **not in blacklist**'.format(e), delete_after=10)
|
||||||
await ctx.message.add_reaction('\N{CROSS MARK}')
|
await ctx.message.add_reaction('\N{CROSS MARK}')
|
||||||
|
|
||||||
@_remove_tags.command(name='channel', aliases=['ch', 'c'])
|
@_remove_tags.command(name='channel', aliases=['ch', 'c'])
|
||||||
|
@ -1324,7 +1324,7 @@ class MsG:
|
||||||
await ctx.message.add_reaction('\N{WHITE HEAVY CHECK MARK}')
|
await ctx.message.add_reaction('\N{WHITE HEAVY CHECK MARK}')
|
||||||
|
|
||||||
except exc.TagError as e:
|
except exc.TagError as e:
|
||||||
await ctx.send('`{}` **not in blacklist.**'.format(e), delete_after=10)
|
await ctx.send('`{}` **not in blacklist**'.format(e), delete_after=10)
|
||||||
await ctx.message.add_reaction('\N{CROSS MARK}')
|
await ctx.message.add_reaction('\N{CROSS MARK}')
|
||||||
|
|
||||||
@_remove_tags.command(name='me', aliases=['m'])
|
@_remove_tags.command(name='me', aliases=['m'])
|
||||||
|
@ -1346,13 +1346,13 @@ class MsG:
|
||||||
await ctx.message.add_reaction('\N{WHITE HEAVY CHECK MARK}')
|
await ctx.message.add_reaction('\N{WHITE HEAVY CHECK MARK}')
|
||||||
|
|
||||||
except exc.TagError as e:
|
except exc.TagError as e:
|
||||||
await ctx.send('`{}` **not in blacklist.**'.format(e), delete_after=10)
|
await ctx.send('`{}` **not in blacklist**'.format(e), delete_after=10)
|
||||||
await ctx.message.add_reaction('\N{CROSS MARK}')
|
await ctx.message.add_reaction('\N{CROSS MARK}')
|
||||||
|
|
||||||
@blacklist.group(name='clear', aliases=['cl', 'c'])
|
@blacklist.group(name='clear', aliases=['cl', 'c'])
|
||||||
async def _clear_blacklist(self, ctx):
|
async def _clear_blacklist(self, ctx):
|
||||||
if ctx.invoked_subcommand is None:
|
if ctx.invoked_subcommand is None:
|
||||||
await ctx.send('**Invalid blacklist.**', delete_after=10)
|
await ctx.send('**Invalid blacklist**', delete_after=10)
|
||||||
await ctx.message.add_reaction('\N{CROSS MARK}')
|
await ctx.message.add_reaction('\N{CROSS MARK}')
|
||||||
|
|
||||||
@_clear_blacklist.command(name='global', aliases=['gl', 'g'])
|
@_clear_blacklist.command(name='global', aliases=['gl', 'g'])
|
||||||
|
@ -1363,7 +1363,7 @@ class MsG:
|
||||||
self.blacklists['global_blacklist'].clear()
|
self.blacklists['global_blacklist'].clear()
|
||||||
u.dump(self.blacklists, 'cogs/blacklists.pkl')
|
u.dump(self.blacklists, 'cogs/blacklists.pkl')
|
||||||
|
|
||||||
await dest.send('**Global blacklist cleared.**', delete_after=5)
|
await dest.send('**Global blacklist cleared**', delete_after=5)
|
||||||
await ctx.message.add_reaction('\N{WHITE HEAVY CHECK MARK}')
|
await ctx.message.add_reaction('\N{WHITE HEAVY CHECK MARK}')
|
||||||
|
|
||||||
@_clear_blacklist.command(name='channel', aliases=['ch', 'c'])
|
@_clear_blacklist.command(name='channel', aliases=['ch', 'c'])
|
||||||
|
@ -1378,7 +1378,7 @@ class MsG:
|
||||||
del self.blacklists['guild_blacklist'][guild.id][ctx.channel.id]
|
del self.blacklists['guild_blacklist'][guild.id][ctx.channel.id]
|
||||||
u.dump(self.blacklists, 'cogs/blacklists.pkl')
|
u.dump(self.blacklists, 'cogs/blacklists.pkl')
|
||||||
|
|
||||||
await dest.send('{} **blacklist cleared.**'.format(ctx.channel.mention), delete_after=5)
|
await dest.send('{} **blacklist cleared**'.format(ctx.channel.mention), delete_after=5)
|
||||||
await ctx.message.add_reaction('\N{WHITE HEAVY CHECK MARK}')
|
await ctx.message.add_reaction('\N{WHITE HEAVY CHECK MARK}')
|
||||||
|
|
||||||
@_clear_blacklist.command(name='me', aliases=['m'])
|
@_clear_blacklist.command(name='me', aliases=['m'])
|
||||||
|
@ -1389,5 +1389,5 @@ class MsG:
|
||||||
del self.blacklists['user_blacklist'][ctx.author.id]
|
del self.blacklists['user_blacklist'][ctx.author.id]
|
||||||
u.dump(self.blacklists, 'cogs/blacklists.pkl')
|
u.dump(self.blacklists, 'cogs/blacklists.pkl')
|
||||||
|
|
||||||
await dest.send('{}**\'s blacklist cleared.**'.format(ctx.author.mention), delete_after=5)
|
await dest.send('{}**\'s blacklist cleared**'.format(ctx.author.mention), delete_after=5)
|
||||||
await ctx.message.add_reaction('\N{WHITE HEAVY CHECK MARK}')
|
await ctx.message.add_reaction('\N{WHITE HEAVY CHECK MARK}')
|
||||||
|
|
|
@ -50,7 +50,7 @@ class Administration:
|
||||||
|
|
||||||
history = []
|
history = []
|
||||||
try:
|
try:
|
||||||
pru_sent = await ctx.send('\N{HOURGLASS} **Pruning** <@{}>**\'s messages will take some time.**'.format(user))
|
pru_sent = await ctx.send('\N{HOURGLASS} **Pruning** <@{}>**\'s messages will take some time**'.format(user))
|
||||||
ch_sent = await ctx.send('\N{FILE CABINET} **Caching channels...**')
|
ch_sent = await ctx.send('\N{FILE CABINET} **Caching channels...**')
|
||||||
|
|
||||||
if when is None:
|
if when is None:
|
||||||
|
@ -58,54 +58,54 @@ class Administration:
|
||||||
async for message in channel.history(limit=None):
|
async for message in channel.history(limit=None):
|
||||||
if message.author.id == int(user):
|
if message.author.id == int(user):
|
||||||
history.append(message)
|
history.append(message)
|
||||||
await ch_sent.edit(content='\N{FILE CABINET} **Cached** `{}/{}` **channels.**'.format(channels.index(channel) + 1, len(channels)))
|
await ch_sent.edit(content='\N{FILE CABINET} **Cached** `{}/{}` **channels**'.format(channels.index(channel) + 1, len(channels)))
|
||||||
await asyncio.sleep(self.RATE_LIMIT)
|
await asyncio.sleep(self.RATE_LIMIT)
|
||||||
elif when == 'before':
|
elif when == 'before':
|
||||||
for channel in channels:
|
for channel in channels:
|
||||||
async for message in channel.history(limit=None, before=ref.created_at):
|
async for message in channel.history(limit=None, before=ref.created_at):
|
||||||
if message.author.id == int(user):
|
if message.author.id == int(user):
|
||||||
history.append(message)
|
history.append(message)
|
||||||
await ch_sent.edit(content='\N{FILE CABINET} **Cached** `{}/{}` **channels.**'.format(channels.index(channel) + 1, len(channels)))
|
await ch_sent.edit(content='\N{FILE CABINET} **Cached** `{}/{}` **channels**'.format(channels.index(channel) + 1, len(channels)))
|
||||||
await asyncio.sleep(self.RATE_LIMIT)
|
await asyncio.sleep(self.RATE_LIMIT)
|
||||||
elif when == 'after':
|
elif when == 'after':
|
||||||
for channel in channels:
|
for channel in channels:
|
||||||
async for message in channel.history(limit=None, after=ref.created_at):
|
async for message in channel.history(limit=None, after=ref.created_at):
|
||||||
if message.author.id == int(user):
|
if message.author.id == int(user):
|
||||||
history.append(message)
|
history.append(message)
|
||||||
await ch_sent.edit(content='\N{FILE CABINET} **Cached** `{}/{}` **channels.**'.format(channels.index(channel) + 1, len(channels)))
|
await ch_sent.edit(content='\N{FILE CABINET} **Cached** `{}/{}` **channels**'.format(channels.index(channel) + 1, len(channels)))
|
||||||
await asyncio.sleep(self.RATE_LIMIT)
|
await asyncio.sleep(self.RATE_LIMIT)
|
||||||
elif when == 'about':
|
elif when == 'about':
|
||||||
for channel in channels:
|
for channel in channels:
|
||||||
async for message in channel.history(limit=None, about=ref.created_at):
|
async for message in channel.history(limit=None, about=ref.created_at):
|
||||||
if message.author.id == int(user):
|
if message.author.id == int(user):
|
||||||
history.append(message)
|
history.append(message)
|
||||||
await ch_sent.edit(content='\N{FILE CABINET} **Cached** `{}/{}` **channels.**'.format(channels.index(channel) + 1, len(channels)))
|
await ch_sent.edit(content='\N{FILE CABINET} **Cached** `{}/{}` **channels**'.format(channels.index(channel) + 1, len(channels)))
|
||||||
await asyncio.sleep(self.RATE_LIMIT)
|
await asyncio.sleep(self.RATE_LIMIT)
|
||||||
|
|
||||||
est_sent = await ctx.send('\N{STOPWATCH} **Estimated time to delete history:** `{}m {}s`'.format(int(self.RATE_LIMIT * len(history) / 60), int(self.RATE_LIMIT * len(history) % 60)))
|
est_sent = await ctx.send('\N{STOPWATCH} **Estimated time to delete history:** `{}m {}s`'.format(int(self.RATE_LIMIT * len(history) / 60), int(self.RATE_LIMIT * len(history) % 60)))
|
||||||
cont_sent = await ctx.send('{} **Continue?** `Y` or `N`'.format(ctx.author.mention))
|
cont_sent = await ctx.send('{} **Continue?** `Y` or `N`'.format(ctx.author.mention))
|
||||||
await self.bot.wait_for('message', check=yes, timeout=10 * 60)
|
await self.bot.wait_for('message', check=yes, timeout=10 * 60)
|
||||||
await cont_sent.delete()
|
await cont_sent.delete()
|
||||||
del_sent = await ctx.send('\N{WASTEBASKET} **Deleting messages...**')
|
del_sent = await ctx.send('\N{WASTEBASKET} **Deleting messages..**')
|
||||||
await del_sent.pin()
|
await del_sent.pin()
|
||||||
c = 0
|
c = 0
|
||||||
for message in history:
|
for message in history:
|
||||||
with suppress(err.NotFound):
|
with suppress(err.NotFound):
|
||||||
await message.delete()
|
await message.delete()
|
||||||
c += 1
|
c += 1
|
||||||
await del_sent.edit(content='\N{WASTEBASKET} **Deleted** `{}/{}` **messages.**'.format(history.index(message) + 1, len(history)))
|
await del_sent.edit(content='\N{WASTEBASKET} **Deleted** `{}/{}` **messages**'.format(history.index(message) + 1, len(history)))
|
||||||
await asyncio.sleep(self.RATE_LIMIT)
|
await asyncio.sleep(self.RATE_LIMIT)
|
||||||
await del_sent.unpin()
|
await del_sent.unpin()
|
||||||
|
|
||||||
await ctx.send('\N{WASTEBASKET} `{}` **of** <@{}>**\'s messages left in** {}**.**'.format(len(history) - c, user, ctx.guild.name))
|
await ctx.send('\N{WASTEBASKET} `{}` **of** <@{}>**\'s messages left in** {}****'.format(len(history) - c, user, ctx.guild.name))
|
||||||
await ctx.message.add_reaction('\N{WHITE HEAVY CHECK MARK}')
|
await ctx.message.add_reaction('\N{WHITE HEAVY CHECK MARK}')
|
||||||
|
|
||||||
except exc.CheckFail:
|
except exc.CheckFail:
|
||||||
await ctx.send('**Deletion aborted.**', delete_after=10)
|
await ctx.send('**Deletion aborted**', delete_after=10)
|
||||||
await ctx.message.add_reaction('\N{CROSS MARK}')
|
await ctx.message.add_reaction('\N{CROSS MARK}')
|
||||||
|
|
||||||
except TimeoutError:
|
except TimeoutError:
|
||||||
await ctx.send('**Deletion timed out.**', delete_after=10)
|
await ctx.send('**Deletion timed out**', delete_after=10)
|
||||||
await ctx.message.add_reaction('\N{CROSS MARK}')
|
await ctx.message.add_reaction('\N{CROSS MARK}')
|
||||||
|
|
||||||
async def delete(self):
|
async def delete(self):
|
||||||
|
@ -143,9 +143,9 @@ class Administration:
|
||||||
if not u.tasks['auto_del']:
|
if not u.tasks['auto_del']:
|
||||||
self.deleting = False
|
self.deleting = False
|
||||||
print('STOPPED : deleting #{}'.format(channel.id))
|
print('STOPPED : deleting #{}'.format(channel.id))
|
||||||
await channel.send('**Stopped queueing messages for deletion in** {}**.**'.format(channel.mention), delete_after=5)
|
await channel.send('**Stopped queueing messages for deletion in** {}'.format(channel.mention), delete_after=5)
|
||||||
|
|
||||||
@commands.command(name='autodelete', aliases=['autodel', 'ad'])
|
@commands.command(name='autodelete', aliases=['autodel'])
|
||||||
@commands.has_permissions(administrator=True)
|
@commands.has_permissions(administrator=True)
|
||||||
@checks.del_ctx()
|
@checks.del_ctx()
|
||||||
async def auto_delete(self, ctx):
|
async def auto_delete(self, ctx):
|
||||||
|
@ -158,7 +158,7 @@ class Administration:
|
||||||
self.bot.loop.create_task(self.delete())
|
self.bot.loop.create_task(self.delete())
|
||||||
self.deleting = True
|
self.deleting = True
|
||||||
print('AUTO-DELETING : #{}'.format(ctx.channel.id))
|
print('AUTO-DELETING : #{}'.format(ctx.channel.id))
|
||||||
await ctx.send('**Auto-deleting all messages in {}.**'.format(ctx.channel.mention), delete_after=5)
|
await ctx.send('**Auto-deleting all messages in {}**'.format(ctx.channel.mention), delete_after=5)
|
||||||
await ctx.message.add_reaction('\N{WHITE HEAVY CHECK MARK}')
|
await ctx.message.add_reaction('\N{WHITE HEAVY CHECK MARK}')
|
||||||
else:
|
else:
|
||||||
raise exc.Exists
|
raise exc.Exists
|
||||||
|
|
|
@ -105,11 +105,11 @@ class Utils:
|
||||||
print('https://www.youtube.com/watch?v=' + youtube.videos().insert(part='snippet',
|
print('https://www.youtube.com/watch?v=' + youtube.videos().insert(part='snippet',
|
||||||
body={'categoryId': '24', 'title': 'Test'}, media_body=http.MediaFileUpload(temp.name, chunksize=-1)))
|
body={'categoryId': '24', 'title': 'Test'}, media_body=http.MediaFileUpload(temp.name, chunksize=-1)))
|
||||||
except exc.InvalidVideoFile as e:
|
except exc.InvalidVideoFile as e:
|
||||||
await ctx.send('`' + str(e) + '` **not valid video type.**', delete_after=10)
|
await ctx.send('`' + str(e) + '` **invalid video type**', delete_after=10)
|
||||||
except exc.TooManyAttachments as e:
|
except exc.TooManyAttachments as e:
|
||||||
await ctx.send('`' + str(e) + '` **too many attachments.** Only one attachment is permitted to upload.', delete_after=10)
|
await ctx.send('`' + str(e) + '` **too many attachments.** Only one attachment is permitted to upload.', delete_after=10)
|
||||||
except exc.MissingAttachment:
|
except exc.MissingAttachment:
|
||||||
await ctx.send('**Missing attachment.**', delete_after=10)
|
await ctx.send('**Missing attachment**', delete_after=10)
|
||||||
|
|
||||||
@upload.error
|
@upload.error
|
||||||
async def upload_error(self, ctx, error):
|
async def upload_error(self, ctx, error):
|
||||||
|
|
|
@ -84,7 +84,7 @@ async def on_error(error, *args, **kwargs):
|
||||||
@bot.event
|
@bot.event
|
||||||
async def on_command_error(ctx, error):
|
async def on_command_error(ctx, error):
|
||||||
if isinstance(error, errext.CheckFailure):
|
if isinstance(error, errext.CheckFailure):
|
||||||
await ctx.send('\N{NO ENTRY} **Insufficient permissions.**', delete_after=10)
|
await ctx.send('\N{NO ENTRY} **Insufficient permissions**', delete_after=10)
|
||||||
await ctx.message.add_reaction('\N{NO ENTRY}')
|
await ctx.message.add_reaction('\N{NO ENTRY}')
|
||||||
elif isinstance(error, errext.CommandNotFound):
|
elif isinstance(error, errext.CommandNotFound):
|
||||||
print('INVALID COMMAND : {}'.format(error), file=sys.stderr)
|
print('INVALID COMMAND : {}'.format(error), file=sys.stderr)
|
||||||
|
|
Loading…
Reference in a new issue