Skip to content

Commit

Permalink
[Fix] Ready and Debug event
Browse files Browse the repository at this point in the history
  • Loading branch information
DevYukine committed Jun 27, 2018
1 parent 6c86021 commit 5bd2166
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
16 changes: 8 additions & 8 deletions Lavalink.NET/Client/Client.cs
Original file line number Diff line number Diff line change
Expand Up @@ -127,14 +127,10 @@ public Client(ClientOptions options)

if (options.UseLogging) Logger = new LoggerConfiguration().MinimumLevel.ControlledBy(new Serilog.Core.LoggingLevelSwitch( (Serilog.Events.LogEventLevel) _config.LogLevel)).WriteTo.Console().CreateLogger();


Debug += DebugHandler;
Ready += ReadyHandler;
Disconnect += DisconnectHandler;
Websocket.Message += WebsocketMessage;
Websocket.Ready += Ready;
Websocket.Debug += Debug;
Websocket.Close += Disconnect;
Websocket.Ready += ReadyHandler;
Websocket.Debug += DebugHandler;
Websocket.Close += DisconnectHandler;
Websocket.ConnectionFailed += ConnectionFailedHandler;
}

Expand Down Expand Up @@ -304,13 +300,15 @@ private Task ErrorHandler(Exception error)
private Task DebugHandler(string message)
{
EmitLogs(LogLevel.Debug, message);
Debug?.Invoke(message);

return Task.CompletedTask;
}

private Task ReadyHandler()
{
EmitLogs(LogLevel.Info, "LavalinkClient succesfully initialized");
Ready?.Invoke();

return Task.CompletedTask;
}
Expand All @@ -326,7 +324,9 @@ private Task ConnectionFailedHandler(Exception error)

private Task DisconnectHandler(WebSocketCloseStatus closeStatus, string closeReason)
{
EmitLogs(LogLevel.Error, $"Websocket Connection Closed with following reason \"{closeReason}\" and StatusCode \"{closeStatus}\"");
var message = $"Websocket Connection Closed with following reason \"{closeReason}\" and StatusCode \"{closeStatus}\"";
EmitLogs(LogLevel.Error, message);
Disconnect?.Invoke(closeStatus, closeReason);

return Task.CompletedTask;
}
Expand Down
2 changes: 1 addition & 1 deletion Lavalink.NET/Lavalink.NET.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<PackageTags>Lavalink</PackageTags>
<Description>A C# Library to interact with Lavalink</Description>
<PackageId>Lavalink.NET</PackageId>
<Version>1.2.0</Version>
<Version>1.2.1</Version>
<FileVersion>1.0.0</FileVersion>
<AssemblyVersion>1.0.0</AssemblyVersion>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion Lavalink.NET/Library/Libraryinfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ abstract class Libraryinfo
/// <summary>
/// The Version of this Library
/// </summary>
static public string Version = "1.2.0";
static public string Version = "1.2.1";
}
}

0 comments on commit 5bd2166

Please sign in to comment.