tfjm-discord-bot/src/tfjm_discord_bot.py

38 lines
990 B
Python
Raw Normal View History

#!/bin/python
2021-01-21 22:11:57 +00:00
from discord import Intents
from src.constants import *
2020-05-05 11:39:44 +00:00
from src.core import CustomBot
2020-04-30 15:26:33 +00:00
# We allow "! " to catch people that put a space in their commands.
# It must be in first otherwise "!" always match first and the space is not recognised
2020-05-10 15:30:45 +00:00
from src.utils import fg
2020-04-29 14:55:12 +00:00
# Global variable to hold the tirages.
2020-04-29 13:14:35 +00:00
# We *want* it to be global so we can reload the tirages cog without
# removing all the running tirages
2020-04-27 09:43:16 +00:00
tirages = {}
2020-05-10 15:30:45 +00:00
def start():
2021-01-21 22:11:00 +00:00
bot = CustomBot(("! ", "!"), case_insensitive=True, owner_id=DIEGO, intents=Intents.all())
2020-05-10 15:30:45 +00:00
@bot.event
async def on_ready():
print(f"{bot.user} has connected to Discord!")
2020-05-10 15:30:45 +00:00
bot.remove_command("help")
bot.load_extension("src.cogs.dev")
bot.load_extension("src.cogs.errors")
bot.load_extension("src.cogs.misc")
bot.load_extension("src.cogs.teams")
bot.load_extension("src.cogs.tirages")
bot.load_extension("src.utils")
bot.run(DISCORD_TOKEN)
2020-04-27 09:43:16 +00:00
if __name__ == "__main__":
2020-05-10 15:30:45 +00:00
start()