mirror of
https://github.com/myned/modufur.git
synced 2024-12-23 22:27:27 +00:00
Merge branch 'dev'
This commit is contained in:
commit
589866196b
4 changed files with 17 additions and 8 deletions
|
@ -164,7 +164,10 @@ class MsG:
|
|||
tb.print_exc()
|
||||
finally:
|
||||
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
|
||||
async def e621_paginator_error(self, ctx, error):
|
||||
|
|
|
@ -168,9 +168,14 @@ class Administration:
|
|||
@checks.del_ctx()
|
||||
async def auto_delete(self, ctx):
|
||||
channel = ctx.message.channel
|
||||
u.background.setdefault('management', {}).setdefault('auto_delete', []).append(channel.id)
|
||||
u.update(u.background, 'background.json')
|
||||
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)
|
||||
|
||||
try:
|
||||
if channel.id not in u.background['management']['auto_delete']:
|
||||
u.background.setdefault('management', {}).setdefault('auto_delete', []).append(channel.id)
|
||||
u.update(u.background, 'background.json')
|
||||
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.**')
|
||||
|
|
|
@ -3,6 +3,7 @@ base = '⚠️ **An internal error has occurred.** Please notify my master! 🐺
|
|||
class Left(Exception): pass
|
||||
class Right(Exception): pass
|
||||
class Save(Exception): pass
|
||||
class Exists(Exception): pass
|
||||
class PostError(Exception): pass
|
||||
class ImageError(Exception): pass
|
||||
class MatchError(Exception): pass
|
||||
|
|
|
@ -6,7 +6,7 @@ try:
|
|||
print('\"config.json\" loaded.')
|
||||
except FileNotFoundError:
|
||||
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.')
|
||||
|
||||
import asyncio
|
||||
|
|
Loading…
Reference in a new issue