discordpy suggestion command

My code:

@client.command()
async def suggest(ctx, suggestion):
    embed = discord.Embed(
        title = "New suggestion.",
        description = f"{suggestion}",
        color = 0,
        timestamp = ctx.message.created_at
    )
    embed.set_footer(text='Requested by {} | ID-{}' .format(ctx.message.author, ctx.message.author.id))

    await ctx.guild.owner.send(embed=embed)
    await ctx.send("Suggestion sent to server owner.")

Problem with this command is that bot does not read the whole message, it reads only first word of it. For example I send this message: =suggest this is suggestion And bot sends embed to a owner only with the first word in this case it will send embed with only this and not whole sentence. If it is possible, how?

Answer

You can pass the keyword-only argument

async def suggest(ctx, *, suggestion):

Take a look at the introduction

Leave a Reply

Your email address will not be published. Required fields are marked *