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.

As Discord grows, we’re given two options: keep events centralized, where adding a reaction, attachment, embed or editing text would all be grouped under MessageUpdated, or we can add an event for every change (see JDA).

If we centralize them, maybe we should look into some sort of change list. Something like:

client.MessageUpdated += (msg, changes) =>
{
    if (changes.Content.Changed)
    {
        var before = changes.Content.Before;
        var after = changes.Content.After;
        //Do something
    }
    foreach (var reaction in changes.Reactions.Added)
    {
        //Do something
    }
};

Thoughts?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:13 (8 by maintainers)

github_iconTop GitHub Comments

5reactions
Auxcommented, Oct 27, 2016

It’d make sense to split message-related events into their own events. While it could work fine to combine message edits and adding and removing reactions into a single event, it’ll be cumbersome in the future as more message-related events are added. The MessageUpdated handler will just end up a long condition check to ignore all of the unnecessary information being thrown at them because someone didn’t feel like adding another event.

client.MessageUpdated += (msg) =>
{
    if (msg.ActionA)
        await OnActionA();
    else if (msg.ActionB)
        await OnActionB();
    else if (msg.ActionC)
        await OnActionC();
    else if (msg.ActionD)
        await OnActionD();
};

etc…

Compared to

client.ReactionAdded += (msg, reaction) =>
{
    Do();
    Stuff();
    Here();
};

I am, however, for keeping all of the UserUpdated information stored in it’s own event as long as the information provided in the event is entirely related to the user’s profile or settings in a guild.

2reactions
khionucommented, Oct 28, 2016

Attachments and Embeds shouldn’t be treated the same as Reactions, in that case. Attachments and Embeds are similar, but a Reaction is closer to an Edit than an Embed, imo, even though they are very much different. So, sure, but with some tweaking, to account for Reactions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Events.com Reviews - Pros & Cons, Ratings & more - GetApp
See the latest verified ratings & reviews for Events.com. Compare real user opinions on the pros and cons to make more informed decisions....
Read more >
Read Customer Service Reviews of events.com
How many stars would you give Events.com? ... Events.com Reviews. 46 • Poor. VERIFIED COMPANY. In the Event Technology Service category.
Read more >
Upcoming and Past Events
Annual Reviews online and live events explore diverse themes in the life, biomedical, physical, and social sciences to share specific, actionable, ...
Read more >
Events.com Reviews 2023: Details, Pricing, & Features
Event management solution that enables event organizers to plan and manage festivals, and interact with event attendees. Events.com Details. Discussions. Events ...
Read more >
Eventible: Your Best Source for Business Event Reviews
Find the most worthwhile events for you! Search top rated events for your industry or role, sort based on your top priorities, and...
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