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
memberIdulongMember to timeout.
untilDateTimeOffsetThe datetime offset to time out the user. Up to 28 days.
reasonstringReason 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
memberIdulongMember to timeout.
untilTimeSpanThe timespan to time out the user. Up to 28 days.
reasonstringReason 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
memberIdulongMember to timeout.
untilDateTimeThe datetime to time out the user. Up to 28 days.
reasonstringReason 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.