I need to find a message the bot has previously posted, then see the reactions on it. I don't think I'm using: discord.utils.find() correctly.
I've looked around but haven't been able to find anything for Discord.py, all the stuff I could find was for Discord.js.
Here's my code:
import discord
TOKEN = '[I have a token here]'
client = discord.Client()
m_id = 0
@client.event
async def on_message(message):
if message.author == client.user:
global m_id
m_id = message.id
if not message.author == client.user:
if message.content.startswith('!poll'):
msg = 'Test poll \nMessage ID: {0.id}'.format(message)
await client.send_message(message.channel, msg)
if message.content.startswith('!endpoll'):
new_message = discord.utils.find(lambda m: m.id(m_id), client.messages)
print(new_message.reactions)
@client.event
async def on_ready():
print('Logged in as')
print(client.user.name)
print(client.user.id)
print('------')
client.run(TOKEN)
I need my bot to print a list of reactions to it's initial message.
JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)