1#1
2message = ctx.send("text")
3#2
4message = channel.send("text")
5#3
6message = channel.fetch_message(messageid)
7#add reaction to message
8emoji = '\N{THUMBS UP SIGN}'
9await message.add_reaction(emoji)
1@client.event
2async def on_message(message):
3 #if the spotify command is triggered
4 #fetch from the API
5 spotifyEmbed = discord.Embed(title=resultName, ...)
6 spotifyEmbed.set_image(url=spotifyImgUrl)
7 spotifyMessage = await message.channel.send(embed=spotifyEmbed)
8 await spotifyMessage.add_reaction("⬅️")
9 await spotifyMessage.add_reaction("➡️")
10
11@client.event
12async def on_reaction_add(reaction, user):
13 if user != client.user:
14 if str(reaction.emoji) == "➡️":
15 #fetch new results from the Spotify API
16 newSearchResult = discord.Embed(...)
17 await reaction.message.edit(embed=newSearchResult)
18 if str(reaction.emoji) == "⬅️":
19 #fetch new results from the Spotify API
20 newSearchResult = discord.Embed(...)
21 await reaction.message.edit(embed=newSearchResult)
22
1#Get reactions from cached msg
2cache_msg = discord.utils.get(client.cached_messages, id=msg.id)
3n_players = await cache_msg.reactions[0].users().flatten()
4n_players = n_players[1:]