Discord.py 机器人中,未在所需位置创建类别


import discord
from discord.ext import commands
botToken = "*"
client = commands.Bot(command_prefix = '*')
@client.event
async def on_ready():
print("I'm ready!")
@client.command()
async def start(ctx):
a = await ctx.guild.create_category("TEST", position=0)
a.position = 0
client.run(botToken)

position=intchannel.position=int不工作

未发现任何与我的问题有关的问题,已授予机器人管理员权限https://discord.com/developers/applications然后得到链接,让他进入我的服务器,在允许的情况下创建一个角色,并给他这个角色,但不起作用

create_text_channelcreate_voice_channel[/strong>没有任何变化,通道的设置就好像我没有给它们分配位置一样。

显示类别位置的图片

它不工作,因为没有位置0,第一个位置总是1

category = await ctx.guild.create_category("TEST", position=1)

如果它仍然在另一个位置创建类别,您可以手动编辑它:

await category.edit(position=1)

最新更新