Discord channel.edit(position=2) 仍然排在最前面
Discord channel.edit(position=2) still goes to the top
我正在使用 await channel.edit(position=2) 将新创建的频道的位置更改为从顶部数第 3 个位置。但是,它一直跃居该类别的首位。我做错了什么?
当我添加 print(text_channel.position) 时,它给了我 2 但它仍然跳到类别的顶部。任何的想法?我试过将位置设置为 3,但它仍然跳到顶部。
text_channel = await ctx.guild.create_text_channel(channel_name, category=category)
await text_channel.edit(position=2)
已解决。显然 discord 没有按预期对其进行排序。我必须检查我想要的频道位置(在我的例子中,类别顶部的第二个位置需要一个位置 = 4),然后使用该位置来指定我想要创建新频道的位置。
任何需要代码的人:
@bot.command(name='check')
async def check_pos(ctx):
channel = ctx.channel
channel_position = channel.position
print(channel_position)
我正在使用 await channel.edit(position=2) 将新创建的频道的位置更改为从顶部数第 3 个位置。但是,它一直跃居该类别的首位。我做错了什么?
当我添加 print(text_channel.position) 时,它给了我 2 但它仍然跳到类别的顶部。任何的想法?我试过将位置设置为 3,但它仍然跳到顶部。
text_channel = await ctx.guild.create_text_channel(channel_name, category=category)
await text_channel.edit(position=2)
已解决。显然 discord 没有按预期对其进行排序。我必须检查我想要的频道位置(在我的例子中,类别顶部的第二个位置需要一个位置 = 4),然后使用该位置来指定我想要创建新频道的位置。
任何需要代码的人:
@bot.command(name='check')
async def check_pos(ctx):
channel = ctx.channel
channel_position = channel.position
print(channel_position)