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

Changed "stop" tasks command to be specific to each task (ie stop rev)

This commit is contained in:
Myned 2017-12-31 21:28:58 -05:00
parent 165d134b6d
commit 70ec1bdb9c
2 changed files with 17 additions and 15 deletions

View file

@ -135,6 +135,7 @@ class MsG:
if reaction.emoji == '\N{HEAVY BLACK HEART}' and reaction.message.id == message.id: if reaction.emoji == '\N{HEAVY BLACK HEART}' and reaction.message.id == message.id:
raise exc.Save(user) raise exc.Save(user)
return False return False
if 'stop h' in msg.content.lower():
try: try:
await message.add_reaction('\N{HEAVY BLACK HEART}') await message.add_reaction('\N{HEAVY BLACK HEART}')
@ -150,6 +151,7 @@ class MsG:
except asyncio.TimeoutError: except asyncio.TimeoutError:
await message.add_reaction('\N{WHITE HEAVY CHECK MARK}') await message.add_reaction('\N{WHITE HEAVY CHECK MARK}')
await ctx.send('**Already auto-hearting in {}.** Type `stop h(earting)` to stop.'.format(ctx.channel.mention), delete_after=7)
# @cmds.command() # @cmds.command()
# async def auto_post(self, ctx): # async def auto_post(self, ctx):
@ -518,7 +520,7 @@ class MsG:
async def queue_for_reversification(self, channel): async def queue_for_reversification(self, channel):
def check(msg): def check(msg):
if msg.content.lower() == 'stop' and msg.channel is channel and msg.author.guild_permissions.administrator: if 'stop r' in msg.content.lower() and msg.channel is channel and msg.author.guild_permissions.administrator:
raise exc.Abort raise exc.Abort
elif msg.channel is channel and msg.author.id != self.bot.user.id and (re.search('(https?:\/\/[^ ]*\.(?:gif|png|jpg|jpeg))', msg.content) is not None or msg.attachments or msg.embeds): elif msg.channel is channel and msg.author.id != self.bot.user.id and (re.search('(https?:\/\/[^ ]*\.(?:gif|png|jpg|jpeg))', msg.content) is not None or msg.attachments or msg.embeds):
return True return True
@ -553,7 +555,7 @@ class MsG:
print('STARTED : auto-reversifying in #{}'.format(ctx.channel.name)) print('STARTED : auto-reversifying in #{}'.format(ctx.channel.name))
await ctx.send('**Auto-reversifying all images in** {}'.format(ctx.channel.mention), delete_after=5) await ctx.send('**Auto-reversifying all images in** {}'.format(ctx.channel.mention), delete_after=5)
else: else:
await ctx.send('**Already auto-reversifying in {}.** Type `stop` to stop.'.format(ctx.channel.mention), delete_after=7) await ctx.send('**Already auto-reversifying in {}.** Type `stop r(eversifying)` to stop.'.format(ctx.channel.mention), delete_after=7)
await ctx.message.add_reaction('\N{CROSS MARK}') await ctx.message.add_reaction('\N{CROSS MARK}')
async def _get_pool(self, ctx, *, destination, booru='e621', query=[]): async def _get_pool(self, ctx, *, destination, booru='e621', query=[]):

View file

@ -128,7 +128,7 @@ class Administration:
async def queue_for_deletion(self, channel): async def queue_for_deletion(self, channel):
def check(msg): def check(msg):
if msg.content.lower() == 'stop' and msg.channel is channel and msg.author.guild_permissions.administrator: if 'stop d' in msg.content.lower() and msg.channel is channel and msg.author.guild_permissions.administrator:
raise exc.Abort raise exc.Abort
elif msg.channel is channel and not msg.pinned: elif msg.channel is channel and not msg.pinned:
return True return True
@ -136,7 +136,7 @@ class Administration:
try: try:
async for message in channel.history(limit=None): async for message in channel.history(limit=None):
if message.content.lower() == 'stop' and message.author.guild_permissions.administrator: if 'stop d' in message.content.lower() and message.author.guild_permissions.administrator:
raise exc.Abort raise exc.Abort
if not message.pinned: if not message.pinned:
await self.queue.put(message) await self.queue.put(message)
@ -170,7 +170,7 @@ class Administration:
raise exc.Exists raise exc.Exists
except exc.Exists: except exc.Exists:
await ctx.send('**Already auto-deleting in {}.** Type `stop` to stop.'.format(ctx.channel.mention), delete_after=7) await ctx.send('**Already auto-deleting in {}.** Type `stop d(eleting)` to stop.'.format(ctx.channel.mention), delete_after=7)
await ctx.message.add_reaction('\N{CROSS MARK}') await ctx.message.add_reaction('\N{CROSS MARK}')
@cmds.group(aliases=['setting', 'set', 's']) @cmds.group(aliases=['setting', 'set', 's'])