Skip to content

Added DiscordGuild properties for several event args

Mateusz Brawański requested to merge github/fork/Neuheit/master into master

Created by: Neuheit

Summary

Added/Edited several new DiscordGuild properties to the events that now send back a guild_id?. These properties are wrapped around an Optional class. This resolves issue #448 (closed).

Details

I decided to wrap these in an optional because there may be times where these values could be null. This also helps the user know that they should take extra precautions when handling these values, and gives them an easier way to check if there are values with .HasValue.

Changes proposed

  • Added a guild_id indexer in dispatch and passed that as a parameter to each internal event handler.
  • Created a new internal method that returns the DiscordGuild if found in the cache, or null if not.
  • Created a new internal constructor for the Optional class that initializes the .Value and .HasValue properties.
  • Added Optional<DiscordGuild> as a new Property for several EventArgs.

Merge request reports

Loading