【发布时间】:2021-06-03 13:18:51
【问题描述】:
所以我正在尝试创建一个票务系统,其中机器人创建一个频道并将其放入不同频道的类别中(例如:bot-cmds}
import discord
from discord.ext import commands
client = commands.Bot(command_prefix=">")
@client.command() #or bot
async def ticket(ctx):
guild = ctx.guild
category = discord.utils.get(guild.categories, name="category_name")
if category is None:
await guild.create_category_channel(name="category_name")
ticket = await guild.create_text_channel(name=f"{ctx.author.name}#{ctx.author.discriminator}'s ticket")
await ctx.send(f"Here's your ticket #{ticket}")
await ctx.channel.edit(category=category)
但是它把 bot-cmds 放在了这个类别中,那么我该如何解决呢?
【问题讨论】:
标签: python discord.py