Currently I am working on a new Discord bot, specifically within the MessageReactionAdded Event Handler. I am trying to look at all of the reactions on a message whenever a new one is added.
The wording of the DiscordMessage.Reactions field is "gets reactions used on this message" and it returns a read only list of DiscordReaction objects. From all of the testing I have done so far, it seems to only return one single react every time, regardless of the number of reactions on a message.
I am using the following code to test:
private static async Task OnReactionAdded(DiscordClient sender, MessageReactionAddEventArgs args)
{
var message = args.Message;
Console.WriteLine($"Total message reactions {message.Reactions.Count}");
foreach (DiscordReaction reaction in message.Reactions)
{
Console.WriteLine($":{reaction.Emoji.Name}: was reacted by {reaction.Count} users!");
}
Console.WriteLine("--------------------------------------------------------------------");
}
Adding a new reaction to an empty message (expect 1, 1)
Adding a new reaction to a message with one reaction already (expect 2, 1 1)
Adding a second reaction to a message with one reaction already (expect 1, 2)
Adding a second reaction to a message with two reactions already (expect 2, 2 2)
Every output is the same: https://hst.sh/xatadiyuya.md
My question is, if the MessageReactionAddEventArgs includes the DiscordMessage object, why does it not also include the other reactions that were there before this new event? It seems as though it only includes the reaction from the event itself. Thanks in advance for the help!