Method DisconnectAsync
| Improve this Doc View SourceDisconnectAsync(CancellationToken?)
Closes this voice connection.
Note: The connection will still be closed if the passed cancellation token is cancelled.
Declaration
public Task DisconnectAsync(CancellationToken? cancellationToken = null)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken? | cancellationToken | A token which will force close the connection when cancelled. |
Returns
| Type | Description |
|---|---|
| Task | Returns whether the operation was successful. |
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException | Thrown if this voice connection is not connected. |
| OperationCanceledException |