Search code examples
pythonpython-3.xpycharmdiscord.pysend

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


This has been happening for a while. I used discord.py. This is an example:

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

What it writes in the console:

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

please help.


Solution

  • According discord.py send() documentation you should pass a message string as a positional argument. I believe you want to write something like this:

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