private static async void WaitForInfoEvent(BotBitsClient botBits, TaskCompletionSource <bool> result, CancellationToken token) { try { var e = await InfoEvent.Of(botBits).WaitOneAsync(token); result.SetException(new MapLoadException(e.Title, e.Text)); } catch (TaskCanceledException) { } }
private async void WaitForInfoEvent() { var e = await InfoEvent.Of(BotBits).WaitOneAsync(); connectResult.SetException(new MapLoadException(e.Title, e.Text)); }