Method TimeoutAsync
- Namespace
- DisCatSharp.Entities
- Assembly
- DisCatSharp.dll
TimeoutAsync(ulong, DateTimeOffset, string?)
Timeout a specified member in this guild.
public Task TimeoutAsync(ulong memberId, DateTimeOffset until, string? reason = null)
Parameters
memberId
ulongMember to timeout.
until
DateTimeOffsetThe datetime offset to time out the user. Up to 28 days.
reason
stringReason for audit logs.
Returns
Exceptions
- UnauthorizedException
Thrown when the client does not have the ModerateMembers permission.
- NotFoundException
Thrown when the member does not exist.
- BadRequestException
Thrown when an invalid parameter was provided.
- ServerErrorException
Thrown when Discord is unable to process the request.
TimeoutAsync(ulong, TimeSpan, string?)
Timeout a specified member in this guild.
public Task TimeoutAsync(ulong memberId, TimeSpan until, string? reason = null)
Parameters
memberId
ulongMember to timeout.
until
TimeSpanThe timespan to time out the user. Up to 28 days.
reason
stringReason for audit logs.
Returns
Exceptions
- UnauthorizedException
Thrown when the client does not have the ModerateMembers permission.
- NotFoundException
Thrown when the member does not exist.
- BadRequestException
Thrown when an invalid parameter was provided.
- ServerErrorException
Thrown when Discord is unable to process the request.
TimeoutAsync(ulong, DateTime, string?)
Timeout a specified member in this guild.
public Task TimeoutAsync(ulong memberId, DateTime until, string? reason = null)
Parameters
memberId
ulongMember to timeout.
until
DateTimeThe datetime to time out the user. Up to 28 days.
reason
stringReason for audit logs.
Returns
Exceptions
- UnauthorizedException
Thrown when the client does not have the ModerateMembers permission.
- NotFoundException
Thrown when the member does not exist.
- BadRequestException
Thrown when an invalid parameter was provided.
- ServerErrorException
Thrown when Discord is unable to process the request.