TypeError: send() takes from 1 to 2 positional arguments but 3 were given discord.py

TypeError: send() takes from 1 to 2 positional arguments but 3 were given discord.py

这已经发生了一段时间。我用了discord.py。这是一个例子:

test = input("Write something:")
await message.channel.send("You wrote:", test)

它在控制台中写入的内容:

>>TypeError: send() takes from 1 to 2 positional arguments but 3 were given

请帮忙。

根据discord.py send() documentation,您应该将消息字符串作为位置参数传递。我相信你想写这样的东西:

test = input("Write something:")
await message.channel.send(f"You wrote: {test}")