Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/359.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 为公会设置文本频道的命令_Python_Discord_Discord.py_Discord.py Rewrite - Fatal编程技术网

Python 为公会设置文本频道的命令

Python 为公会设置文本频道的命令,python,discord,discord.py,discord.py-rewrite,Python,Discord,Discord.py,Discord.py Rewrite,我想发出一个命令,在服务器中设置一个通道,我该怎么做?这是正确的,因为它总是给我错误 代码: @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 = d

我想发出一个命令,在服务器中设置一个通道,我该怎么做?这是正确的,因为它总是给我错误

代码:

@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)

您没有定义命令权限,
guild
已包含在
ctx
中。 使用
*,channelname
将命令后面的所有内容设置为channelname

@Bot.command()
异步设置(ctx,*,通道名称):
等待ctx.guild.创建文本频道(channelName)

它给出了什么错误?