From 700044b9b827a19918fd84268f1ae88736441d8d Mon Sep 17 00:00:00 2001 From: Myned Date: Sun, 10 Dec 2017 17:13:38 -0500 Subject: [PATCH 1/5] Tweaked initial help info --- src/run.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/run.py b/src/run.py index b9c078f..658d882 100644 --- a/src/run.py +++ b/src/run.py @@ -58,7 +58,7 @@ def get_prefix(bot, message): return u.settings['prefixes'].get(message.guild.id, u.config['prefix']) return u.config['prefix'] -bot = cmds.Bot(command_prefix=get_prefix, self_bot=u.config['selfbot'], formatter=cmds.HelpFormatter(show_check_failure=True), description='Modumind - A booru bot with a side of management\n\nS for single command\nG for group command', help_attrs={'aliases': ['h']}, pm_help=None) +bot = cmds.Bot(command_prefix=get_prefix, self_bot=u.config['selfbot'], formatter=cmds.HelpFormatter(show_check_failure=True), description='Modufur - A booru bot with a side of management and automated tasking\nMade by @Myned#3985\n\nNSFW for Not Safe For Wumpus commands\n(G) for group commands\np for prefix\n\n\{\} for mandatory argument\n[] for optional argument', help_attrs={'aliases': ['h']}, pm_help=None) @bot.command(help='help', brief='brief', description='description', usage='usage', hidden=True) async def test(ctx): From 7446986f84a27bdd8cae785fcaa46b44a7520826 Mon Sep 17 00:00:00 2001 From: Myned Date: Sun, 10 Dec 2017 17:14:15 -0500 Subject: [PATCH 2/5] WIP Cleaning of help command --- src/cogs/booru.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/cogs/booru.py b/src/cogs/booru.py index c3c35fd..555f684 100644 --- a/src/cogs/booru.py +++ b/src/cogs/booru.py @@ -171,12 +171,12 @@ class MsG: # await ctx.send('**Already auto-posting in {}.** Type `stop` to stop.'.format(ctx.channel.mention), delete_after=7) # await ctx.message.add_reaction('\N{CROSS MARK}') - @cmds.group(aliases=['tag', 't'], brief='e621 - Get info on tags', description='e621 | NSFW\nGroup command for obtaining info on tags', usage='[tags|tag|t]') + @cmds.group(aliases=['tag', 't'], brief='(G) Get info on tags', description='Group command for obtaining info on tags\n\nUsage:\n\{p\}tag \{flag\} \{tag(s)\}') async def tags(self, ctx): pass # Tag search - @tags.command(name='related', aliases=['relate', 'rel'], brief='e621 - Search for related tags', description='Return related tags for given tag(s)', usage='[related|relate|rel]') + @tags.command(name='related', aliases=['relate', 'rel'], brief='(tags) Search for related tags', description='Return related tags for given tag(s)\n\nExample:\n\{p\}tag related wolf') async def _tags_related(self, ctx, *args): kwargs = u.get_kwargs(ctx, args) dest, tags = kwargs['destination'], kwargs['remaining'] @@ -206,7 +206,7 @@ class MsG: await ctx.message.add_reaction('\N{CROSS MARK}') # Tag aliases - @tags.command(name='aliases', aliases=['alias', 'als'], brief='e621 - Search for tag aliases', description='Return aliases for given tag(s)', usage='[aliases|alias|als]') + @tags.command(name='aliases', aliases=['alias', 'als'], brief='(tags) Search for tag aliases', description='Return aliases for given tag(s)\n\nExample:\n\{p\}tag alias wolf') async def _tags_aliases(self, ctx, *args): kwargs = u.get_kwargs(ctx, args) dest, tags = kwargs['destination'], kwargs['remaining'] @@ -235,13 +235,13 @@ class MsG: if not c: await ctx.message.add_reaction('\N{CROSS MARK}') - @cmds.group(aliases=['g']) + @cmds.group(aliases=['g'], brief='(G) Get e621 elements', description='Group command for obtaining various elements like post info\n\nUsage:\n\{p\}get \{flag\} \{args\}') async def get(self, ctx): if not ctx.invoked_subcommand: await ctx.send('**Use a flag to get items.**\n*Type* `{}help get` *for more info.*'.format(ctx.prefix), delete_after=7) await ctx.message.add_reaction('\N{CROSS MARK}') - @get.command(name='info', aliases=['i'], brief='e621 - Get info from post', description='Return info for given post', usage='[info|i]') + @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): try: kwargs = u.get_kwargs(ctx, args) @@ -275,7 +275,7 @@ class MsG: await ctx.send('**Invalid url**', delete_after=7) await ctx.message.add_reaction('\N{CROSS MARK}') - @get.command(name='image', aliases=['img'], brief='e621 - Get image link', description='Return image for given post', usage='[image|img]') + @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): try: kwargs = u.get_kwargs(ctx, args) @@ -306,7 +306,7 @@ class MsG: await ctx.send('**Invalid url or file**', delete_after=7) await ctx.message.add_reaction('\N{CROSS MARK}') - @get.command(name='pool', aliases=['p'], brief='e621 - Get pool link', description='Return pool info for given query', usage='[pool|p]') + @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): def on_reaction(reaction, user): if reaction.emoji == '\N{OCTAGONAL SIGN}' and reaction.message.id == ctx.message.id and user is ctx.author: @@ -351,7 +351,7 @@ class MsG: await e.message.edit(content='\N{NO ENTRY SIGN}', delete_after=7) # Reverse image searches a linked image using the public iqdb - @cmds.command(name='reverse', aliases=['rev', 'ris'], brief='e621 Reverse image search', description='e621 | NSFW\nReverse-search an image with given URL') + @cmds.command(name='reverse', aliases=['rev', 'ris'], brief='Reverse image search from e621', description='NSFW\nReverse-search an image with given URL') async def reverse(self, ctx, *args): try: kwargs = u.get_kwargs(ctx, args) From 679975f9df810df57baf5a0c993a986251385a28 Mon Sep 17 00:00:00 2001 From: Myned Date: Sun, 10 Dec 2017 17:14:49 -0500 Subject: [PATCH 3/5] Increased hearting timeout to 1 hour --- src/cogs/booru.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cogs/booru.py b/src/cogs/booru.py index 555f684..71d0115 100644 --- a/src/cogs/booru.py +++ b/src/cogs/booru.py @@ -142,8 +142,8 @@ class MsG: while self.hearting: try: - await asyncio.gather(*[self.bot.wait_for('reaction_add', check=on_reaction, timeout=7 * 60), - self.bot.wait_for('reaction_remove', check=on_reaction, timeout=7 * 60)]) + await asyncio.gather(*[self.bot.wait_for('reaction_add', check=on_reaction, timeout=60 * 60), + self.bot.wait_for('reaction_remove', check=on_reaction, timeout=60 * 60)]) except exc.Save as e: await self.heartqueue.put((e.user, send)) From 878eb4de06fe2307a4b83ef0447b5886962fd6a4 Mon Sep 17 00:00:00 2001 From: Myned Date: Sun, 10 Dec 2017 17:18:20 -0500 Subject: [PATCH 4/5] Moved hourglass timeout to reaction and changed to check mark --- src/cogs/booru.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cogs/booru.py b/src/cogs/booru.py index 71d0115..58495ca 100644 --- a/src/cogs/booru.py +++ b/src/cogs/booru.py @@ -149,7 +149,7 @@ class MsG: await self.heartqueue.put((e.user, send)) except asyncio.TimeoutError: - await message.edit(content='\N{HOURGLASS}') + await message.add_reaction('\N{WHITE HEAVY CHECK MARK}') # @cmds.command() # async def auto_post(self, ctx): From 5d64aaf55c96784516a746e32f0cd418ee1f267f Mon Sep 17 00:00:00 2001 From: Myned Date: Sun, 10 Dec 2017 17:18:37 -0500 Subject: [PATCH 5/5] Added minimal logging of NotFound errors --- src/run.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/run.py b/src/run.py index 658d882..f50d6d8 100644 --- a/src/run.py +++ b/src/run.py @@ -142,7 +142,7 @@ async def on_error(error, *args, **kwargs): @bot.event async def on_command_error(ctx, error): if isinstance(error, err.NotFound): - pass + print('NOT FOUND') elif isinstance(error, errext.CheckFailure): await ctx.send('**Insufficient permissions**', delete_after=10) await ctx.message.add_reaction('\N{NO ENTRY}')