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)
1emoji = "" # some emoji as a string
2if any(reaction.emoji == emoji for reaction in message.reactions):
3 # there is at least one reaction of the specified 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