I’m relatively new to Discord.py, and I have a bot that seems to be experiencing a peculiar problem. Not too long after being started as a service on my remote Ubuntu server, the bot will begin duplicating certain commands (if not all of them), as seen in Discord’s slash command interface.
My code is as follows:
from discord import Intents, Client, Message
from archive import TOKEN
client: Client = Client(intents=intents)
tree = setup_command(client) # setup_command simply returns a CommandTree
@client.event
async def on_ready() -> None:
# Global synchronization of slash commands may take up to an hour.
await tree.sync()
print(f'{client.user} is now running.')
What am I missing?