Table of Contents

Method SendMessageAsync

Namespace
DSharpPlus.Entities
Assembly
DSharpPlus.dll

SendMessageAsync(string)

Sends a message to this channel.

public Task<DiscordMessage> SendMessageAsync(string content)

Parameters

content string

Content of the message to send.

Returns

Task<DiscordMessage>

The sent message.

Exceptions

UnauthorizedException

Thrown when the client does not have the SendMessages permission if TTS is false and SendTtsMessages if TTS is true.

NotFoundException

Thrown when the channel does not exist.

BadRequestException

Thrown when an invalid parameter was provided.

ServerErrorException

Thrown when Discord is unable to process the request.

SendMessageAsync(DiscordEmbed)

Sends a message to this channel.

public Task<DiscordMessage> SendMessageAsync(DiscordEmbed embed)

Parameters

embed DiscordEmbed

Embed to attach to the message.

Returns

Task<DiscordMessage>

The sent message.

Exceptions

UnauthorizedException

Thrown when the client does not have the SendMessages permission if TTS is false and SendTtsMessages if TTS is true.

NotFoundException

Thrown when the channel does not exist.

BadRequestException

Thrown when an invalid parameter was provided.

ServerErrorException

Thrown when Discord is unable to process the request.

SendMessageAsync(string, DiscordEmbed)

Sends a message to this channel.

public Task<DiscordMessage> SendMessageAsync(string content, DiscordEmbed embed)

Parameters

content string

Content of the message to send.

embed DiscordEmbed

Embed to attach to the message.

Returns

Task<DiscordMessage>

The sent message.

Exceptions

UnauthorizedException

Thrown when the client does not have the SendMessages permission if TTS is false and SendTtsMessages if TTS is true.

NotFoundException

Thrown when the channel does not exist.

BadRequestException

Thrown when an invalid parameter was provided.

ServerErrorException

Thrown when Discord is unable to process the request.

SendMessageAsync(DiscordMessageBuilder)

Sends a message to this channel.

public Task<DiscordMessage> SendMessageAsync(DiscordMessageBuilder builder)

Parameters

builder DiscordMessageBuilder

The builder with all the items to send.

Returns

Task<DiscordMessage>

The sent message.

Exceptions

UnauthorizedException

Thrown when the client does not have the SendMessages permission if TTS is false and SendTtsMessages if TTS is true.

NotFoundException

Thrown when the channel does not exist.

BadRequestException

Thrown when an invalid parameter was provided.

ServerErrorException

Thrown when Discord is unable to process the request.

SendMessageAsync(Action<DiscordMessageBuilder>)

Sends a message to this channel.

public Task<DiscordMessage> SendMessageAsync(Action<DiscordMessageBuilder> action)

Parameters

action Action<DiscordMessageBuilder>

The builder with all the items to send.

Returns

Task<DiscordMessage>

The sent message.

Exceptions

UnauthorizedException

Thrown when the client does not have the SendMessages permission if TTS is false and SendTtsMessages if TTS is true.

NotFoundException

Thrown when the channel does not exist.

BadRequestException

Thrown when an invalid parameter was provided.

ServerErrorException

Thrown when Discord is unable to process the request.