Method TimeoutAsync
- Namespace
- DisCatSharp.Entities
- Assembly
- DisCatSharp.dll
TimeoutAsync(DateTimeOffset, string?)
Adds a timeout to a member.
public Task TimeoutAsync(DateTimeOffset until, string? reason = null)
Parameters
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(TimeSpan, string?)
Adds a timeout to a member.
public Task TimeoutAsync(TimeSpan until, string? reason = null)
Parameters
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(DateTime, string?)
Adds a timeout to a member.
public Task TimeoutAsync(DateTime until, string? reason = null)
Parameters
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.