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)
它给出了什么错误?