【发布时间】:2021-06-06 16:35:35
【问题描述】:
我想为我的私人服务器创建一个命令,在所有公会频道中创建 webhook 并让他们发送消息,我已经尝试过这样:
@client.command()
async def allchannel(ctx):
for channel in ctx.guild.channels:
webhook = discord.utils.get(await ctx.channel.webhooks())
if not webhook:
webhook = await ctx.channel.create_webhook("Test")
await webhook.send(content="Hello")
但它说:discord.ext.commands.errors.CommandInvokeError:命令引发异常:TypeError:create_webhook() 采用 1 个位置参数,但给出了 2 个
【问题讨论】:
标签: python discord discord.py webhooks