auto guilds 2.0
This commit is contained in:
parent
b49ed138b6
commit
8a4bb04185
3
main.py
3
main.py
@ -22,7 +22,8 @@ async def on_ready():
|
|||||||
for m in client.modules:
|
for m in client.modules:
|
||||||
await m.load()
|
await m.load()
|
||||||
async for guild in client.fetch_guilds():
|
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!")
|
print(f"Logged in as {client.user} on {len(client.guilds)} servers!")
|
||||||
|
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@ import discord
|
|||||||
from discord import app_commands
|
from discord import app_commands
|
||||||
|
|
||||||
import httpx
|
import httpx
|
||||||
from client import tree
|
from client import client, tree
|
||||||
|
|
||||||
|
|
||||||
GUILD_ID = os.getenv("GUILD_ID")
|
GUILD_ID = os.getenv("GUILD_ID")
|
||||||
@ -40,7 +40,6 @@ init_gitea_projects()
|
|||||||
@tree.command(
|
@tree.command(
|
||||||
name="gitea-issue",
|
name="gitea-issue",
|
||||||
description="Create issues to gitea",
|
description="Create issues to gitea",
|
||||||
guild=discord.Object(id=GUILD_ID),
|
|
||||||
)
|
)
|
||||||
@app_commands.describe(
|
@app_commands.describe(
|
||||||
title="Issue title", project="The project where the issue is created"
|
title="Issue title", project="The project where the issue is created"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user