From 5188b6f729f4dd4603440832888deff9d8b48017 Mon Sep 17 00:00:00 2001 From: bmintz Date: Sun, 29 Jul 2018 22:48:58 -0500 Subject: [PATCH] add bot from discord template --- bot.py | 23 +++++++++++++++++++++++ cogs/__init__.py | 0 2 files changed, 23 insertions(+) create mode 100755 bot.py create mode 100644 cogs/__init__.py diff --git a/bot.py b/bot.py new file mode 100755 index 0000000..017d319 --- /dev/null +++ b/bot.py @@ -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')) diff --git a/cogs/__init__.py b/cogs/__init__.py new file mode 100644 index 0000000..e69de29