Basically, I'm trying to create a poll/vote command that allows you to add the reactions ":thumbsup:" for agree and ":thumbsdown:" for disagree. For example:
User: Am I male?
Reactions: :thumbsup:, :thumbsdown:
Meaning of Reactions: [yes:no]
This is my full code:
@client.command()
async def poll(ctx, *, message):
await ctx.send(f"{message}")
await Message.add_reaction(emoji=u"\U0001F44D")
Whenever I call the command, the message is sent but the reaction is not added. This error pops up instead
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: TypeError: add_reaction() missing 1 required positional argument: 'self'
The full error is here:
Ignoring exception in on_command_error
Traceback (most recent call last):
File "C:\Users\danie\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\ext\commands\core.py", line 85, in wrapped
ret = await coro(*args, **kwargs)
File "C:\Users\danie\Documents\Scripts\Bots\DiscordBot\skybot.py", line 53, in poll
await discord.Message.add_reaction(emoji=u"\U0001F44D")
TypeError: add_reaction() missing 1 required positional argument: 'self'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\danie\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\client.py", line 312, in _run_event
await coro(*args, **kwargs)
File "C:\Users\danie\Documents\Scripts\Bots\DiscordBot\skybot.py", line 189, in on_command_error
raise error
File "C:\Users\danie\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\ext\commands\bot.py", line 903, in invoke
await ctx.command.invoke(ctx)
File "C:\Users\danie\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\ext\commands\core.py", line 855, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "C:\Users\danie\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\ext\commands\core.py", line 94, in wrapped
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: TypeError: add_reaction() missing 1 required positional argument: 'self'
Ignoring exception in on_command_error
Traceback (most recent call last):
File "C:\Users\danie\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\ext\commands\core.py", line 85, in wrapped
ret = await coro(*args, **kwargs)
File "C:\Users\danie\Documents\Scripts\Bots\DiscordBot\skybot.py", line 53, in poll
await discord.Message.add_reaction(emoji=u"\U0001F44D")
TypeError: add_reaction() missing 1 required positional argument: 'self'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\danie\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\client.py", line 312, in _run_event
await coro(*args, **kwargs)
File "C:\Users\danie\Documents\Scripts\Bots\DiscordBot\skybot.py", line 189, in on_command_error
raise error
File "C:\Users\danie\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\ext\commands\bot.py", line 903, in invoke
await ctx.command.invoke(ctx)
File "C:\Users\danie\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\ext\commands\core.py", line 855, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "C:\Users\danie\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\ext\commands\core.py", line 94, in wrapped
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: TypeError: add_reaction() missing 1 required positional argument: 'self'
This is my source for the emoji unicode