diff --git a/main.py b/main.py index 1311eec..c33bd24 100644 --- a/main.py +++ b/main.py @@ -22,7 +22,8 @@ async def on_ready(): for m in client.modules: await m.load() async for guild in client.fetch_guilds(): - await tree.sync(guild=discord.Object(id=guild.id)) + tree.copy_global_to(guild=guild) + await tree.sync(guild=guild) print(f"Logged in as {client.user} on {len(client.guilds)} servers!") diff --git a/modules/gitea.py b/modules/gitea.py index f717c03..b92b4a6 100644 --- a/modules/gitea.py +++ b/modules/gitea.py @@ -4,7 +4,7 @@ import discord from discord import app_commands import httpx -from client import tree +from client import client, tree GUILD_ID = os.getenv("GUILD_ID") @@ -40,7 +40,6 @@ init_gitea_projects() @tree.command( name="gitea-issue", description="Create issues to gitea", - guild=discord.Object(id=GUILD_ID), ) @app_commands.describe( title="Issue title", project="The project where the issue is created"