I cant get my python discord bot polling command to send. All the other response commands work, so im not sure why the poll wont send

129 views Asked by At

Here is my code

@bot.command("poll")
async def poll(ctx, *args):
    # poll command:
    # !poll event_name event_date
    event_name = args[0]
    event_date = args[1]
    # retrieving the 'events' channel
    # sending the poll
    message = await ctx.send(f"@everyone Will you come to the **{event_name}** event the **{event_date}**?")
    # adding reactions to the poll
    await message.add_reaction('U00002705')
    await message.add_reaction('U0000274C')

I keep getting an error code called

discord.ext.commands.errors.CommandInvokeError: Command raised an exception: IndexError: tuple index out of range

and i dont know how to get my code to work

Ive been following a tutorial and for some reason my code wont work with it. i keep getting the discord.ext.commands.errors.CommandInvokeError: Command raised an exception: IndexError: tuple index out of range error message

1

There are 1 answers

0
AudioBubble On

https://media.discordapp.net/attachments/1019539306777415712/1039502797420376074/25f07d49ecf5de59.png u need to give arg and it work, but u will get unkonwn emoji error , beacuse u don't use \ in unicode


    await message.add_reaction('U00002705')

use ('\U00002705')