mirror of
https://github.com/uhIgnacio/EmoteManager.git
synced 2024-08-15 02:23:13 +00:00
add bot from discord template
This commit is contained in:
parent
5683490ab6
commit
5188b6f729
2 changed files with 23 additions and 0 deletions
23
bot.py
Executable file
23
bot.py
Executable 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
0
cogs/__init__.py
Normal file
Loading…
Reference in a new issue