Revert "change avatars every 30 minutes"

This reverts commit ee9f8a0af9.
Yeah actually nevermind.
This commit is contained in:
bmintz 2018-07-30 01:30:44 -05:00
parent ee9f8a0af9
commit d5c0983a5f
1 changed files with 0 additions and 13 deletions

13
bot.py
View File

@ -1,15 +1,10 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# encoding: utf-8 # encoding: utf-8
import random
import asyncio
import logging import logging
import os.path
import traceback import traceback
from glob import glob
import discord import discord
import aiofiles
from discord.ext import commands from discord.ext import commands
logging.basicConfig(level=logging.WARNING) logging.basicConfig(level=logging.WARNING)
@ -31,14 +26,6 @@ class Bot(commands.AutoShardedBot):
async def on_ready(self): async def on_ready(self):
logger.info('Logged on as {0} (ID: {0.id})'.format(self.user)) logger.info('Logged on as {0} (ID: {0.id})'.format(self.user))
bot.loop.create_task(self.change_avatar_loop())
async def change_avatar_loop(self):
while await asyncio.sleep(30*60, True):
glob_pattern = os.path.join('avatars', '*')
async with aiofiles.open(random.choice(glob(glob_pattern)), 'rb') as f:
await self.user.edit(avatar=await f.read())
# https://github.com/Rapptz/RoboDanny/blob/ca75fae7de132e55270e53d89bc19dd2958c2ae0/bot.py#L77-L85 # https://github.com/Rapptz/RoboDanny/blob/ca75fae7de132e55270e53d89bc19dd2958c2ae0/bot.py#L77-L85
async def on_command_error(self, context, error): async def on_command_error(self, context, error):