Method UnbanMemberAsync
- Namespace
- DSharpPlus.Entities
- Assembly
- DSharpPlus.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
- Task
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
userId
ulongID of the user to unban.
reason
stringReason for audit logs.
Returns
- Task
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.