in Education by
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)

1 Answer

0 votes
by
Here are two methods for finding a message by id. I hope this is what you meant @bot.event async def on_message(msg): if 'conditoin' == True: message=await bot.get_message(msg.channel,'message_id') print(message.content) @bot.command(pass_context=True) async def get_msg(con,msg_id:int): message=await bot.get_message(con.message.channel,msg_id) print(message.content)

Related questions

0 votes
    I'm creating my first program on python. The objective is to get an output of trip cost. In the ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 21, 2022 in Education by JackTerrance
0 votes
    I am looking to write a pop-up window which asks the user to select a specific option, and if ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 17, 2022 in Education by JackTerrance
0 votes
    Can anyone tell me how I can represent the equivalent of an Enum in Python? Select the correct answer from above options...
asked Jan 22, 2022 in Education by JackTerrance
0 votes
    I have multiple xlsx files with data in it that i want to import to separate dataframes in Python. ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 3, 2022 in Education by JackTerrance
0 votes
    I have multiple xlsx files with data in it that i want to import to separate dataframes in Python. ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 7, 2022 in Education by JackTerrance
0 votes
    I want to get the values of col1 in 3 different columns with separate headers. Date/Time col1 0 ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 21, 2022 in Education by JackTerrance
0 votes
    I have a dataset, say: DateJoined Name Number DateLeft 11/03/2015 Tom 001199 11/03/2019 11/03/ ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 16, 2022 in Education by JackTerrance
0 votes
    When I try to run this pygame code it instantly closes?? The window doesn't close instantly when I ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 13, 2022 in Education by JackTerrance
0 votes
    I've been trying to get my discord bot to work, but it will only become online on discord and ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 7, 2022 in Education by JackTerrance
0 votes
    I want to log the user session. Currently the code is as follows (setting formatter and handlers is omitted ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 11, 2022 in Education by JackTerrance
0 votes
    I want to log the user session. Currently the code is as follows (setting formatter and handlers is omitted ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 30, 2022 in Education by JackTerrance
0 votes
    I want to log the user session. Currently the code is as follows (setting formatter and handlers is omitted ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 23, 2022 in Education by JackTerrance
0 votes
    I want to log the user session. Currently the code is as follows (setting formatter and handlers is omitted ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 12, 2022 in Education by JackTerrance
0 votes
    I have a legit situation like this where I need to implement a method that changes the incoming object ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 16, 2022 in Education by JackTerrance
0 votes
    Is there a way to to disable intellisense in ax2012's code editor? sometimes when writing selecting ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 30, 2022 in Education by JackTerrance
...