FEAT: Added Twitch module (can't check if it's working yet due to a sync issue)

FIX: Added the needed changes to the code for the new module
This commit is contained in:
Dan
2024-06-25 00:02:13 -04:00
parent 49a7588699
commit bd318a7815
3 changed files with 142 additions and 4 deletions

13
main.py
View File

@@ -3,9 +3,11 @@ from config import config
TOKEN = config['DISCORD_TOKEN']
GUILD_ID = config['GUILD_ID']
DISCORD_CHANNEL_ID = config['DISCORD_CHANNEL_ID']
intents = discord.Intents.default()
intents.messages = True
guild = discord.Object(id=GUILD_ID)
class Selena(discord.Client):
@@ -25,11 +27,14 @@ class Selena(discord.Client):
xp = XP(self)
xp.setup(self.tree)
if config['modules']['twitch']['enabled']:
from modules.social.twitch import Twitch
twitch = Twitch(self)
twitch.setup(self.tree)
async def setup_hook(self):
self.tree.copy_global_to(guild=discord.Object(id=GUILD_ID))
await self.tree.sync(guild=discord.Object(id=GUILD_ID))
# Force sync for all commands
await self.tree.sync()
self.tree.copy_global_to(guild=guild)
await self.tree.sync(guild=guild)
bot = Selena()