auto guilds 2.0

This commit is contained in:
Lendemor 2024-05-12 15:07:35 +02:00
parent b49ed138b6
commit 8a4bb04185
2 changed files with 3 additions and 3 deletions

View File

@ -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!")

View File

@ -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"