partirdezero/discord_integration/core/BotClass.py

14 lines
No EOL
376 B
Python

import discord
from discord import app_commands
intents = discord.Intents.default()
intents.members = True
intents.message_content = True
class Bot(discord.Client):
def __init__(self, *, intents: discord.Intents):
super().__init__(intents=intents)
self.tree = app_commands.CommandTree(self)
async def setup_hook(self):
await self.tree.sync()