public async Task RunAsync() { discord.DebugLogger.LogMessage(LogLevel.Info, ApplicationName, "Connecting", DateTime.Now); await discord.ConnectAsync(); creator = await discord.GetUserAsync(IDs.Users.Ski); discord.DebugLogger.LogMessage(LogLevel.Info, ApplicationName, "Connected", DateTime.Now); await WaitForCancellationAsync(); discord.DebugLogger.LogMessage(LogLevel.Info, ApplicationName, "Disconnecting", DateTime.Now); await discord.DisconnectAsync(); discord.DebugLogger.LogMessage(LogLevel.Info, ApplicationName, $"Disconnected{Environment.NewLine}", DateTime.Now); }
public async Task ShutdownAsync() { await _client.DisconnectAsync(); }
static void OnProcessExit(object sender, EventArgs e) { _discord.DisconnectAsync().GetAwaiter().GetResult(); }