Added suppress embeds method + new Lavalink event
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 ofStatistics
, which are the lavalink stats sent. - Added support for the event in
LavalinkNodeConnection.cs
, invoked inLavalinkNodeConnection#WebSocket_OnMessage
after the statistics are updated. - Added
.this
to the parameters ofApiClient.EditMessageAsync() in
DiscordMessage.cs` - Added the SuppressEmbeds method for both
DiscordMessage.cs
andDiscordApiClient.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.