The "/create" commnad is now available in the bot menu

This commit is contained in:
trueold89 2024-06-07 18:34:11 +03:00
parent 9106386211
commit a9ce6a60b9
Signed by: trueold89
GPG Key ID: C122E85DD49E6B30
1 changed files with 3 additions and 1 deletions

View File

@ -39,6 +39,7 @@ async def on_ready() -> None:
""" """
Displays a link to add a bot to the server Displays a link to add a bot to the server
""" """
await bot.tree.sync()
client_id = ENV.CLIENT_ID.fget(None) client_id = ENV.CLIENT_ID.fget(None)
invite = oauth_url(client_id, permissions=Permissions( invite = oauth_url(client_id, permissions=Permissions(
manage_channels=True, manage_channels=True,
@ -47,7 +48,7 @@ async def on_ready() -> None:
print(f"Your bot invite link: {invite}") print(f"Your bot invite link: {invite}")
@bot.command() @bot.hybrid_command(name="create", description="Creates a group of vc to move users")
async def create(ctx: commands.Context) -> None: async def create(ctx: commands.Context) -> None:
""" """
Creates a group of voice channels to move the user and adds their id to the database Creates a group of voice channels to move the user and adds their id to the database
@ -58,6 +59,7 @@ async def create(ctx: commands.Context) -> None:
db = ServersDB(server.id) db = ServersDB(server.id)
circles_count = ENV.CIRCLES_COUNT.fget(None) circles_count = ENV.CIRCLES_COUNT.fget(None)
group = await server.create_category(f"{circles_count} Circles of Hell") group = await server.create_category(f"{circles_count} Circles of Hell")
await ctx.send("Creating vc's...", ephemeral=True)
if db: if db:
db.clear_channels() db.clear_channels()
for circle in range(circles_count): for circle in range(circles_count):