This is what I want to accomplish.
In this case I am creating a bot, and I want that when the user puts the command !text
and then writes his user !text id
save the text in a variable, make a link and then send the link by the bot.
Example:
User: !text miid
Bot: Here is the link -> https/miid/.com
@client.command()
async def text(ctx, text : str):
link1 = "http:/"
link2 = "/.com"
link = link1 + text + link2
await ctx.send("Aquí esta tu link", link)
The error I get is:
I File "C:\Users\0.0\anaconda3\lib\site-packages\discord\ext\commands\core.py", line 94, in wrapped raise CommandInvokeError(exc) from exc discord.ext.commands.errors.CommandInvokeError : Command raised an exception: TypeError: send() takes from 1 to 2 positional arguments but 3 were given
I need your help, thank you very much.
Your error is a matter of logic. As the error says, ctx.send only accepts 1 or 2 positional arguments. You are passing the message "here is your link" and as a second argument you are passing something else. Those two arguments are NOT joined in a single text. To fix it, change the "," to a "+" to concatenate the message with the link.
It would look like this: