|
@@ -257,7 +257,11 @@ namespace Discord |
|
|
/// <summary> Blocking call that will not return until client has been stopped. This is mainly intended for use in console applications. </summary> |
|
|
/// <summary> Blocking call that will not return until client has been stopped. This is mainly intended for use in console applications. </summary> |
|
|
public void Run(Func<Task> asyncAction) |
|
|
public void Run(Func<Task> asyncAction) |
|
|
{ |
|
|
{ |
|
|
asyncAction().Wait(); |
|
|
|
|
|
|
|
|
try |
|
|
|
|
|
{ |
|
|
|
|
|
asyncAction().Wait(); |
|
|
|
|
|
} |
|
|
|
|
|
catch (AggregateException ex) when (ex.InnerException is TaskCanceledException) { } |
|
|
_disconnectedEvent.WaitOne(); |
|
|
_disconnectedEvent.WaitOne(); |
|
|
} |
|
|
} |
|
|
/// <summary> Blocking call that will not return until client has been stopped. This is mainly intended for use in console applications. </summary> |
|
|
/// <summary> Blocking call that will not return until client has been stopped. This is mainly intended for use in console applications. </summary> |
|
|