Table of Contents

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 ulong

Member to timeout.

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(ulong, TimeSpan, string?)

Timeout a specified member in this guild.

public Task TimeoutAsync(ulong memberId, TimeSpan until, string? reason = null)

Parameters

memberId ulong

Member to timeout.

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(ulong, DateTime, string?)

Timeout a specified member in this guild.

public Task TimeoutAsync(ulong memberId, DateTime until, string? reason = null)

Parameters

memberId ulong

Member to timeout.

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.