-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbot.py
39 lines (28 loc) · 839 Bytes
/
bot.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
32
33
34
35
36
37
38
39
"""
PO(I)TD
A Discord bot that sends a random OI problem every day
"""
import os
import logging
from discord import Activity, ActivityType
from discord.ext.commands import Bot, when_mentioned_or
from cogs.bot_info import BotInfo
from cogs.problems import Problems
from cogs.analytics import Analytics
from cogs.top_gg import TopGG
logging.basicConfig(level=logging.INFO)
prefix = '$'
if 'BOT_PREFIX' in os.environ:
prefix = os.environ['BOT_PREFIX']
bot = Bot(
command_prefix=when_mentioned_or(prefix),
help_command=None,
activity=Activity(type=ActivityType.watching, name='you solve problems')
)
bot.add_cog(BotInfo(bot))
bot.add_cog(Problems(bot))
if 'PRISMA_TOKEN' in os.environ:
bot.add_cog(Analytics(bot))
if 'TOP_GG_TOKEN' in os.environ:
bot.add_cog(TopGG(bot))
bot.run(os.environ['DISCORD_TOKEN'])