add bot from discord template

This commit is contained in:
bmintz 2018-07-29 22:48:58 -05:00
parent 5683490ab6
commit 5188b6f729
2 changed files with 23 additions and 0 deletions

23
bot.py Executable file
View File

@ -0,0 +1,23 @@
#!/usr/bin/env python3
# encoding: utf-8
import discord
from discord.ext import commands
with open('config.py') as f:
config = eval(f.read(), {})
class Bot(commands.AutoShardedBot):
def __init__(self, **kwargs):
super().__init__(command_prefix=commands.when_mentioned, **kwargs)
for cog in config['cogs']:
self.load_extension(cog)
async def on_ready(self):
print('Logged on as {0} (ID: {0.id})'.format(self.user))
bot = Bot()
if __name__ == '__main__':
bot.run(config['tokens'].pop('discord'))

0
cogs/__init__.py Normal file
View File