Method RespondAsync
- Namespace
- DSharpPlus.Entities
- Assembly
- DSharpPlus.dll
RespondAsync(string)
Responds to the message. This produces a reply.
public Task<DiscordMessage> RespondAsync(string content)
Parameters
content
stringMessage content to respond with.
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)
Responds to the message. This produces a reply.
public Task<DiscordMessage> RespondAsync(DiscordEmbed embed)
Parameters
embed
DiscordEmbedEmbed to attach to the message.
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)
Responds to the message. This produces a reply.
public Task<DiscordMessage> RespondAsync(string content, DiscordEmbed embed)
Parameters
content
stringMessage content to respond with.
embed
DiscordEmbedEmbed to attach to the message.
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)
Responds to the message. This produces a reply.
public Task<DiscordMessage> RespondAsync(DiscordMessageBuilder builder)
Parameters
builder
DiscordMessageBuilderThe Discord message builder.
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>)
Responds to the message. This produces a reply.
public Task<DiscordMessage> RespondAsync(Action<DiscordMessageBuilder> action)
Parameters
action
Action<DiscordMessageBuilder>The Discord message builder.
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.