I'm trying to create a command that formats your code on Discord with a given language,
by sending the formatted string:
f"```{language}\n{code}\n```"
The function prototype is :
def format(ctx, language, *code)
And I'm typing on Discord for example :
!format c int function(int x)
{
return x;
}
But when I tried to print out the code
arg, there is no \n
in the list and the bot message is on a single line.
I also tried with quotation marks around my message, and this worked for keeping \n
but if my code contains another quotation mark it ends the code
arg, and throws an error for the remaining part.
Is there a way to get the complete message including newlines?