-
Notifications
You must be signed in to change notification settings - Fork 1
/
app.py
31 lines (23 loc) · 952 Bytes
/
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import atexit
import discord
from discord.ext.commands import AutoShardedBot
from utils.db.models import get_prefix, check_db
from utils.config.setup_bot import setup_bot, shut_down
from utils.config.setup_bot import setup_logger
description = "a bot"
class Bot(AutoShardedBot):
def __init__(self):
atexit.register(shut_down, self)
message = 'ydhelp | ydinvite'
sgame = discord.Game(name=message, type=0)
super().__init__(command_prefix=get_prefix, game=sgame, description=description)
setup_bot(self)
token = self.keys['debug_token'] if self.debug else self.keys['token']
try:
self.loop.run_until_complete(self.start(token))
except discord.errors.LoginFailure or discord.errors.HTTPException as e:
self.log.error(f"shit: {repr(e)}", exc_info=False)
if __name__ == "__main__":
setup_logger()
check_db()
Bot()