Table of Contents

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 DateTimeOffset

The datetime offset to time out the user. Up to 28 days.

reason string

Reason for audit logs.

Returns

Task

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 TimeSpan

The timespan to time out the user. Up to 28 days.

reason string

Reason for audit logs.

Returns

Task

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 DateTime

The datetime to time out the user. Up to 28 days.

reason string

Reason for audit logs.

Returns

Task

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.