selena/main.py
Dan 15ed750f8b FEAT: Added a Logger
REF: Changed Spotify Module to use the logger now
2024-06-21 13:08:45 -04:00

36 lines
977 B
Python

import discord
import config
class Selena(discord.Client):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.tree = discord.app_commands.CommandTree(self)
async def setup_hook(self):
await self.load_extensions()
await self.tree.sync()
async def load_extension(self, name):
module = __import__(name, fromlist=["setup"])
await module.setup(self)
async def load_extensions(self):
extensions = [
"modules.admin.logger_module",
"modules.media.spotify_module",
# Add other modules here
]
for extension in extensions:
await self.load_extension(extension)
async def on_ready(self):
print(f'Logged in as {self.user} (ID: {self.user.id})')
print('------')
if __name__ == "__main__":
intents = discord.Intents.default()
client = Selena(intents=intents)
client.run(config.DISCORD_TOKEN)