Method AddDmRecipientAsync
- Namespace
- DisCatSharp.Entities
- Assembly
- DisCatSharp.dll
AddDmRecipientAsync(ulong, string, string, CancellationToken)
Only use for Group DMs! Whitelisted bots only. Requires user's oauth2 access token.
public Task AddDmRecipientAsync(ulong userId, string accessToken, string nickname, CancellationToken cancellationToken = default)
Parameters
userIdulongThe id of the user to add.
accessTokenstringThe OAuth2 access token.
nicknamestringThe nickname to give to the user.
cancellationTokenCancellationTokenA token to cancel the request.
Returns
Exceptions
- NotFoundException
Thrown when the channel does not exist.
- BadRequestException
Thrown when an invalid parameter was provided.
- ServerErrorException
Thrown when Discord is unable to process the request.