Home>

I'm creating a voting system, but this character appears in the enbed and it doesn't work,

type =author =>flags =>

@ client.event
async def on_message (message):
    if message.content.startswith ('v, *, message'):
        embed = discord.Embed (title = "voting started", description = f'** {message} **', color = 0x0048ff)
        embed.add_field (name = "if I want to cancel the vote", value = "✕ add a reaction", inline = False)
        embed.set_footer (text = "voting closes in 120 minutes")
        channel = message.channel
        sent_msg = await channel.send ('Thank you for creating the vote', embed = embed)
        def reaction_check (reaction, user):
            are_same_messages = reaction.message.channel == sent_msg.channel and reaction.message.id == sent_msg.id
            return user == message.author and str (reaction.emoji) =='❌' and are_same_messages
        try: try:
            reaction, user = await client.wait_for ('reaction_add', timeout = 7200, check = reaction_check)
        except asyncio.TimeoutError:
            await channel.send ('__ ** Voting finished ** __')
        else: else:
            await channel.send ('__ ** Voting canceled ** __')


I'm calling with "v What I want to vote for", is there something wrong? Please tell me

  • Answer # 1

    embed = discord.Embed (title = "voting started", description = f'** {message} **', color = 0x0048ff)

    This will make the text look like it's just printed (to be exact, the default for str).
    If you want to get the message contentdescription = f'** {message.content} **'Let's use.


    Other things I was interested in.

    if message.content.startswith ('v, *, message'):

    'v, *, message'Can only be used with the commands framework.
    If you use it with on_message

    if message.content.startswith ('v'):
        embed = discord.Embed (title = "voting started", description = f'** {message.content [2:]} **',


    ([2:]IsvTo remove the part)
    Must be written.
    With the commands framework

    @ client.command (name = "v")
    async def vote (ctx, *, message): If it is # v, the variable name seems to be covered, so change it with name.
        embed = discord.Embed (title = "voting started", description = f'** {message} **', color = 0x0048ff)
        #Others

    Please write.