question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

DiscordChannel.GetMessageAsync returns no Reactions when command is running from a replied message

See original GitHub issue

I’m trying to get the reactions of the message.

        [Command("reactions")]
        public async Task ReactionsCommand(CommandContext ctx)
        {
            var channel = ctx.Channel;
            var emoji =await channel.GetMessageAsync(817299244008210443);
        }

image image

It works fine unless i reply to some other message with this command. image image

Basically, I want to get the reactions of the replied message, but when i reply with “+reactions”, DiscordChannel.GetMessageAsync returns everything except Reactions.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Olimp666commented, Mar 5, 2021

Sure Using this code the msg.Reactions field will be “Count=0”

[Command("reactions")]
public async Task ReactionsCommand(CommandContext ctx)
{
    var msg = await ctx.Channel.GetMessageAsync(ctx.Message.ReferencedMessage.Id);
}
0reactions
Olimp666commented, Mar 5, 2021

Ok I figured out how to get the reactions but it’s a bit spaghetti

        var client = new DiscordClient(new DiscordConfiguration()
        {
            Token = "token",
            Intents = DiscordIntents.All,
            MinimumLogLevel = Microsoft.Extensions.Logging.LogLevel.Information
        });
        var ch = await client.GetChannelAsync(ctx.Channel.Id);
        
        var msg = await ch.GetMessageAsync(ctx.Message.ReferencedMessage.Id);
Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't get a message through RestUserMessage
The strange thing is that after restarting the program, if the command is not initialized, I can get messages from the channel.
Read more >
CloudQueue.GetMessageAsync Method - Storage
Initiates an asynchronous operation to get a single message from the queue. GetMessageAsync(Nullable<TimeSpan>, QueueRequestOptions, OperationContext).
Read more >
Reaction verify bot discord
Triggering the bot to send a PM to the user and giving him a rank.Discord Reaction Roles Bots Find the best Discord Reaction...
Read more >
C# (CSharp) IMessageChannel.SendMessageAsync ...
</returns> public static async Task Log(string message) ... SendMessageAsync($"The command `{command}` already has no roles assigned to it!
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found