diff options
author | Parker <contact@pkrm.dev> | 2024-03-31 00:10:45 -0500 |
---|---|---|
committer | Parker <contact@pkrm.dev> | 2024-03-31 00:10:45 -0500 |
commit | 39026bb4e0535d31f9436e6506a38e4be0b33f30 (patch) | |
tree | 0541f46a0a27763f657d0902d523b16a0905ee79 /code/bot.py | |
parent | 7e7f2d959cc1100604774fff78d4d67087629073 (diff) |
base commit
Diffstat (limited to 'code/bot.py')
-rw-r--r-- | code/bot.py | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/code/bot.py b/code/bot.py new file mode 100644 index 0000000..e7a2922 --- /dev/null +++ b/code/bot.py @@ -0,0 +1,35 @@ +import discord +from discord.ext import commands +import os + +from validate_config import create_config +from global_variables import LOG, BOT_TOKEN + + +class MyBot(commands.Bot): + def __init__(self): + super().__init__( + command_prefix="***", + activity=discord.Game(name='music!'), + intents=discord.Intents.default(), + ) + + async def setup_hook(self): + create_config() + for ext in os.listdir("./code/cogs"): + if ext.endswith(".py"): + await self.load_extension(f"cogs.{ext[:-3]}") + + +bot = MyBot() +bot.count_hold = 0 +bot.remove_command("help") + + +@bot.event +async def on_ready(): + LOG.info(f"{bot.user} has connected to Discord.") + + +if __name__ == "__main__": + bot.run(BOT_TOKEN) |