Skip to content

Added suppress embeds method + new Lavalink event

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

Created by: Neuheit

Summary

Implemented support for the new Suppress embeds endpoint, and also created a new event when a Lavalink stats op is received.

Details

The suppress embeds support was attached as a new method to the DiscordMessage class, which resolves issue #434 (closed). Also added this. to the parameters in ApiClient#ModifyAsync() in DiscordMessage.cs because they were missing. In addition, I felt that having the Lavalink stats emitted is important for debugging, and can give the user additional control when it comes to managing Lavalink nodes.

Changes proposed

  • Added StatsReceivedEventArgs.cs as a new Event Argument with a property of Statistics, which are the lavalink stats sent.
  • Added support for the event in LavalinkNodeConnection.cs, invoked in LavalinkNodeConnection#WebSocket_OnMessage after the statistics are updated.
  • Added .this to the parameters of ApiClient.EditMessageAsync() in DiscordMessage.cs`
  • Added the SuppressEmbeds method for both DiscordMessage.cs and DiscordApiClient.cs and created a new endpoint constant and payload class. The payload class has a boolean property, which is assigned to true to suppress embeds.

Merge request reports

Loading