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

Formatting and naming changes

This commit is contained in:
Myned 2017-11-20 11:28:49 -05:00
parent 88b3c9f506
commit a80a1c27fe
2 changed files with 9 additions and 9 deletions

View file

@ -28,7 +28,7 @@ class MsG:
self.LIMIT = 100 self.LIMIT = 100
self.HISTORY_LIMIT = 150 self.HISTORY_LIMIT = 150
self.RATE_LIMIT = u.RATE_LIMIT self.RATE_LIMIT = u.RATE_LIMIT
self.reviqueue = asyncio.Queue() self.reversiqueue = asyncio.Queue()
self.reversifying = False self.reversifying = False
self.updating = False self.updating = False
@ -45,7 +45,7 @@ class MsG:
for channel in u.tasks['auto_rev']: for channel in u.tasks['auto_rev']:
temp = self.bot.get_channel(channel) temp = self.bot.get_channel(channel)
self.bot.loop.create_task(self.queue_for_reversification(temp)) self.bot.loop.create_task(self.queue_for_reversification(temp))
print('AUTO-REVERSIFYING : #{}'.format(temp.name)) print('STARTED : auto-reversifying in #{}'.format(temp.name))
self.reversifying = True self.reversifying = True
self.bot.loop.create_task(self._reversify()) self.bot.loop.create_task(self._reversify())
# if not self.updating: # if not self.updating:
@ -124,7 +124,7 @@ class MsG:
# self.bot.loop.create_task(self._post()) # self.bot.loop.create_task(self._post())
# self.posting = True # self.posting = True
# #
# print('AUTO-POSTING : #{}'.format(ctx.channel.name)) # print('STARTED : auto-posting in #{}'.format(ctx.channel.name))
# await ctx.send('**Auto-posting all images in {}**'.format(ctx.channel.mention), delete_after=5) # await ctx.send('**Auto-posting all images in {}**'.format(ctx.channel.mention), delete_after=5)
# else: # else:
# raise exc.Exists # raise exc.Exists
@ -434,7 +434,7 @@ class MsG:
async def _reversify(self): async def _reversify(self):
while self.reversifying: while self.reversifying:
message = await self.reviqueue.get() message = await self.reversiqueue.get()
urls = [] urls = []
for match in re.finditer('(https?:\/\/[^ ]*\.(?:gif|png|jpg|jpeg))', message.content): for match in re.finditer('(https?:\/\/[^ ]*\.(?:gif|png|jpg|jpeg))', message.content):
@ -487,9 +487,9 @@ class MsG:
return False return False
try: try:
while not self.bot.is_closed(): while self.reversifying:
message = await self.bot.wait_for('message', check=check) message = await self.bot.wait_for('message', check=check)
await self.reviqueue.put(message) await self.reversiqueue.put(message)
await message.add_reaction('\N{HOURGLASS WITH FLOWING SAND}') await message.add_reaction('\N{HOURGLASS WITH FLOWING SAND}')
except exc.Abort: except exc.Abort:
@ -512,7 +512,7 @@ class MsG:
self.bot.loop.create_task(self._reversify()) self.bot.loop.create_task(self._reversify())
self.reversifying = True self.reversifying = True
print('AUTO-REVERSIFYING : #{}'.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` to stop.'.format(ctx.channel.mention), delete_after=7)

View file

@ -24,7 +24,7 @@ class Administration:
for channel in u.tasks['auto_del']: for channel in u.tasks['auto_del']:
temp = self.bot.get_channel(channel) temp = self.bot.get_channel(channel)
self.bot.loop.create_task(self.queue_for_deletion(temp)) self.bot.loop.create_task(self.queue_for_deletion(temp))
print('AUTO-DELETING : #{}'.format(temp.name)) print('STARTED : auto-deleting in #{}'.format(temp.name))
self.deleting = True self.deleting = True
self.bot.loop.create_task(self.delete()) self.bot.loop.create_task(self.delete())
@ -164,7 +164,7 @@ class Administration:
if not self.deleting: if not self.deleting:
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.name)) print('STARTED : auto-deleting in #{}'.format(ctx.channel.name))
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)
else: else:
raise exc.Exists raise exc.Exists