TypeError:send()需要1到2个位置参数,但给了3个discord.py

问题描述 投票:0回答:1

这已经发生了一段时间。我使用了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

请帮助。

python python-3.x pycharm discord.py send
1个回答
0
投票

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

test = input("Write something:")
await message.channel.send(f"You wrote: {test}")
© www.soinside.com 2019 - 2024. All rights reserved.