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

Merge branch 'dev'

This commit is contained in:
Myned 2017-10-11 11:09:28 -04:00
commit 589866196b
4 changed files with 17 additions and 8 deletions

View file

@ -164,7 +164,10 @@ class MsG:
tb.print_exc() tb.print_exc()
finally: finally:
if starred: if starred:
for url in starred: await user.send(url) for url in starred:
await user.send(url)
if len(starred) > 5:
await asyncio.sleep(2.1)
@e621_paginator.error @e621_paginator.error
async def e621_paginator_error(self, ctx, error): async def e621_paginator_error(self, ctx, error):

View file

@ -168,9 +168,14 @@ class Administration:
@checks.del_ctx() @checks.del_ctx()
async def auto_delete(self, ctx): async def auto_delete(self, ctx):
channel = ctx.message.channel channel = ctx.message.channel
u.background.setdefault('management', {}).setdefault('auto_delete', []).append(channel.id)
u.update(u.background, 'background.json') try:
self.bot.loop.create_task(self.on_message(channel)) if channel.id not in u.background['management']['auto_delete']:
self.bot.loop.create_task(self.delete()) u.background.setdefault('management', {}).setdefault('auto_delete', []).append(channel.id)
print('Looping {}'.format(channel.id)) u.update(u.background, 'background.json')
await ctx.send('✅ **Auto-deleting all messages in this channel.**', delete_after=5) self.bot.loop.create_task(self.on_message(channel))
self.bot.loop.create_task(self.delete())
print('Looping {}'.format(channel.id))
await ctx.send('✅ **Auto-deleting all messages in this channel.**', delete_after=5)
else: raise exc.Exists
except exc.Exists: await ctx.send('❌ **Already deleting in this channel.**')

View file

@ -3,6 +3,7 @@ base = '⚠️ **An internal error has occurred.** Please notify my master! 🐺
class Left(Exception): pass class Left(Exception): pass
class Right(Exception): pass class Right(Exception): pass
class Save(Exception): pass class Save(Exception): pass
class Exists(Exception): pass
class PostError(Exception): pass class PostError(Exception): pass
class ImageError(Exception): pass class ImageError(Exception): pass
class MatchError(Exception): pass class MatchError(Exception): pass

View file

@ -6,7 +6,7 @@ try:
print('\"config.json\" loaded.') print('\"config.json\" loaded.')
except FileNotFoundError: except FileNotFoundError:
with open('config.json', 'w') as outfile: with open('config.json', 'w') as outfile:
json.dump({'client_id': 0, 'listed_ids': [0], 'owner_id': 0, 'permissions': 388160, 'prefix': ',', 'shutdown_channel': 0, 'startup_channel': 0, 'token': 'str'}, outfile, indent=4, sort_keys=True) json.dump({'client_id': 0, 'listed_ids': [0], 'owner_id': 0, 'permissions': 126016, 'prefix': ',', 'shutdown_channel': 0, 'startup_channel': 0, 'token': 'str'}, outfile, indent=4, sort_keys=True)
raise FileNotFoundError('Config file not found: \"config.json\" created with abstract values. Restart \"run.py\" with correct values.') raise FileNotFoundError('Config file not found: \"config.json\" created with abstract values. Restart \"run.py\" with correct values.')
import asyncio import asyncio