Method UnbanMemberAsync
- Namespace
- DisCatSharp.Entities
- Assembly
- DisCatSharp.dll
UnbanMemberAsync(DiscordUser, string?)
Unbans a user from this guild.
public Task UnbanMemberAsync(DiscordUser user, string? reason = null)
Parameters
user
DiscordUserUser to unban.
reason
stringReason for audit logs.
Returns
Exceptions
- UnauthorizedException
Thrown when the client does not have the BanMembers permission.
- NotFoundException
Thrown when the user does not exist.
- BadRequestException
Thrown when an invalid parameter was provided.
- ServerErrorException
Thrown when Discord is unable to process the request.
UnbanMemberAsync(ulong, string?)
Unbans a user by ID.
public Task UnbanMemberAsync(ulong userId, string? reason = null)
Parameters
Returns
Exceptions
- UnauthorizedException
Thrown when the client does not have the BanMembers permission.
- NotFoundException
Thrown when the user does not exist.
- BadRequestException
Thrown when an invalid parameter was provided.
- ServerErrorException
Thrown when Discord is unable to process the request.