我想创建一个在服务器中设置频道的命令,我该怎么做?这是正确的原因,它不断给我错误,
代码:
@Bot.command()
async def azsetup(ctx, guild, channelName):
await guild.create_text_channel('cool-channel')
embed = discord.Embed(title='', description=f"Setup is Done:" , color = discord.Color.green, timestamp=ctx.message.created_at)
embed.add_field(name="Note:" , value ="All the Modlogs and Important Announcements will be set there!")
await ctx.send(embed = embed)
答案 0 :(得分:1)
您没有正确定义命令,guild
已包含在 ctx
中。
*,channelname
将命令后的所有内容设为频道名称
@Bot.command()
async def azsetup(ctx, *,channelName):
await ctx.guild.create_text_channel(channelName)