Skip to content

Commit

Permalink
press f when it goes rip
Browse files Browse the repository at this point in the history
  • Loading branch information
Radka Janek committed May 26, 2018
1 parent 59601b4 commit d98c28e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Bot.cs
Expand Up @@ -27,6 +27,7 @@ public SkywinderClient()
{
this.Client.MessageReceived += ClientOnMessageReceived;
this.Client.MessageUpdated += ClientOnMessageUpdated;
this.Client.Disconnected += ClientDisconnected;
}

public async Task Connect()
Expand Down Expand Up @@ -150,6 +151,12 @@ private void GetCommandAndParams(string message, out string command, out string
}
}

private async Task ClientDisconnected(Exception exception)
{
Console.WriteLine($"Discord Client died:\n{ exception.Message}\nShutting down.");
Environment.Exit(0); //HACK - The library often reconnects in really shitty way and no longer works
}

private async Task ClientOnMessageUpdated(Cacheable<IMessage, ulong> cacheable, SocketMessage socketMessage, ISocketMessageChannel arg3)
{
await ClientOnMessageReceived(socketMessage);
Expand Down

0 comments on commit d98c28e

Please sign in to comment.