Table of Contents

Method RespondAsync

Namespace
DisCatSharp.Entities
Assembly
DisCatSharp.dll

RespondAsync(string, bool, CancellationToken)

Responds to the message. This produces a reply.

public Task<DiscordMessage> RespondAsync(string content, bool mention = true, CancellationToken cancellationToken = default)

Parameters

content string

Message content to respond with.

mention bool

Whether to mention on reply.

cancellationToken CancellationToken

A token to cancel the request.

Returns

Task<DiscordMessage>

The sent message.

Exceptions

UnauthorizedException

Thrown when the client does not have the SendMessages 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.

RespondAsync(DiscordEmbed, bool, CancellationToken)

Responds to the message. This produces a reply.

public Task<DiscordMessage> RespondAsync(DiscordEmbed embed, bool mention = true, CancellationToken cancellationToken = default)

Parameters

embed DiscordEmbed

Embed to attach to the message.

mention bool

Whether to mention on reply.

cancellationToken CancellationToken

A token to cancel the request.

Returns

Task<DiscordMessage>

The sent message.

Exceptions

UnauthorizedException

Thrown when the client does not have the SendMessages 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.

RespondAsync(string, DiscordEmbed, bool, CancellationToken)

Responds to the message. This produces a reply.

public Task<DiscordMessage> RespondAsync(string content, DiscordEmbed embed, bool mention = true, CancellationToken cancellationToken = default)

Parameters

content string

Message content to respond with.

embed DiscordEmbed

Embed to attach to the message.

mention bool

Whether to mention on reply.

cancellationToken CancellationToken

A token to cancel the request.

Returns

Task<DiscordMessage>

The sent message.

Exceptions

UnauthorizedException

Thrown when the client does not have the SendMessages 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.

RespondAsync(DiscordMessageBuilder, bool, CancellationToken)

Responds to the message. This produces a reply.

public Task<DiscordMessage> RespondAsync(DiscordMessageBuilder builder, bool mention = true, CancellationToken cancellationToken = default)

Parameters

builder DiscordMessageBuilder

The Discord message builder.

mention bool

Whether to mention on reply.

cancellationToken CancellationToken

A token to cancel the request.

Returns

Task<DiscordMessage>

The sent message.

Exceptions

UnauthorizedException

Thrown when the client does not have the SendMessages 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.

RespondAsync(Action<DiscordMessageBuilder>, bool, CancellationToken)

Responds to the message. This produces a reply.

public Task<DiscordMessage> RespondAsync(Action<DiscordMessageBuilder> action, bool mention = true, CancellationToken cancellationToken = default)

Parameters

action Action<DiscordMessageBuilder>

The Discord message builder.

mention bool

Whether to mention on reply.

cancellationToken CancellationToken

A token to cancel the request.

Returns

Task<DiscordMessage>

The sent message.

Exceptions

UnauthorizedException

Thrown when the client does not have the SendMessages 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.