Skip to content

Added New Events and Endpoint

Created by: Neuheit

Summary

Fixes #522 (closed) by implementing support for these events and endpoint.

Details

As documented here, this PR adds 3 new events:

InviteCreated - Fired when an invite is created.

InviteDeleted - Fired when an invite is deleted.

MessageReactionRemovedEmoji - Fired when all of a specific reaction are deleted.

Additionally, added support for a new endpoint that directly causes the MessageReactionRemovedEmoji event, which is DiscordMessage.DeleteReactionsEmojiAsync(DiscordEmoji).

Because invite objects can now be sent via dispatch, I also created an invite cache to more reliably retrieve invites, this does a couple of things:

  1. Allows the InviteDeleted event to possibly return a more detailed object rather than the partial one.

  2. Could allow a user to get an invite from the cache, which is modeled by DiscordGuild.GetInvite(string).

Currently, the cache has invites added and removed from their respective events, and added automatically through DiscordGuild.GetInvitesAsync(). This change and DiscordGuild.GetInvite() may not be necessary, but I figured they may be nice to include.

Changes proposed

  • Added support for the 3 new events.
  • Added support for the new endpoint.
  • Added a method to delete all reactions from a specific emoji.
  • Added a cache for invites.
  • Added/modified a couple methods to interact with the invite cache.

Merge request reports

Loading