Search code examples
pythondiscorddiscord.py

Discordpy Say command with more than one line


I'm having a problem with a say command, and it is that i can't send a well formated text.

I wanted to make it look like this: enter image description here

But it answers with this: enter image description here

Here is the code:

#COMMAND say
@commands.command()
@commands.has_any_role(*Say_Role)
async def say(self, ctx, *message):
    await ctx.message.delete()
    channel = ctx.channel
    await ctx.send(f"✅", delete_after=0.1)
    await channel.send(message)

What I need to do in order to make it look like the first image?


Solution

  • That's the wrong way to use the consume rest behavior.

    Doing func(*args) will make args into a tuple of arguments, like ('this', 'is', 'an', 'argument'). See more here.

    You're probably looking to make it a string:

    async def say(self, ctx, *, message: str):
        ...