Method UpdatePresenceAsync
| Improve this Doc View SourceUpdatePresenceAsync(PresenceOptions, CancellationToken?)
Updates the presence/status of the bot user.
Declaration
Task UpdatePresenceAsync(PresenceOptions options, CancellationToken? cancellationToken = null)
Parameters
| Type | Name | Description |
|---|---|---|
| PresenceOptions | options | Options for the new presence. |
| CancellationToken? | cancellationToken | A token used to cancel the update. |
Returns
| Type | Description |
|---|---|
| Task |
Remarks
Note: This method can only be called 5 times per minute and will wait if this is exceeded.
Note: This method will also throw an OperationCanceledException if the Gateway's shard is stopped while sending.
This method will wait until the underlying Gateway connection is ready as well as retry if the connection closes unexpectedly until the given cancellation token is cancelled or the Gateway's shard is stopped.Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | Thrown if |
| InvalidOperationException | Thrown if the Gateway's shard has not been fully started. |
| ObjectDisposedException | Thrown if the Gateway's shard has been disposed. |
| OperationCanceledException | Thrown if the cancellation token is cancelled or the Gateway's shard is stopped while sending. |