Method AddRoleAsync
- Namespace
- DisCatSharp.Entities
- Assembly
- DisCatSharp.dll
AddRoleAsync(ulong, CancellationToken)
Adds a role to this thread. Only applicable to private threads.
public Task AddRoleAsync(ulong roleId, CancellationToken cancellationToken = default)
Parameters
roleIdulongThe role id to be added.
cancellationTokenCancellationTokenA token to cancel the request.
Returns
Exceptions
- NotFoundException
Thrown when the thread does not exist.
- BadRequestException
Thrown when an invalid parameter was provided.
- ServerErrorException
Thrown when Discord is unable to process the request.
AddRoleAsync(DiscordRole, CancellationToken)
Adds a role to this thread. Only applicable to private threads.
public Task AddRoleAsync(DiscordRole role, CancellationToken cancellationToken = default)
Parameters
roleDiscordRoleThe role to be added.
cancellationTokenCancellationTokenA token to cancel the request.
Returns
Exceptions
- NotFoundException
Thrown when the thread does not exist.
- BadRequestException
Thrown when an invalid parameter was provided.
- ServerErrorException
Thrown when Discord is unable to process the request.