Method ModifyAsync
- Namespace
- DisCatSharp.Entities
- Assembly
- DisCatSharp.dll
ModifyAsync(Optional<string>)
Edits the message.
public Task<DiscordMessage> ModifyAsync(Optional<string> content)
Parameters
Returns
Exceptions
- UnauthorizedException
Thrown when the client tried to modify a message not sent by them.
- 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.
ModifyAsync(Optional<DiscordEmbed>)
Edits the message.
public Task<DiscordMessage> ModifyAsync(Optional<DiscordEmbed> embed = default)
Parameters
embed
Optional<DiscordEmbed>New embed.
Returns
Exceptions
- UnauthorizedException
Thrown when the client tried to modify a message not sent by them.
- 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.
ModifyAsync(Optional<string>, Optional<DiscordEmbed>)
Edits the message.
public Task<DiscordMessage> ModifyAsync(Optional<string> content, Optional<DiscordEmbed> embed = default)
Parameters
content
Optional<string>New content.
embed
Optional<DiscordEmbed>New embed.
Returns
Exceptions
- UnauthorizedException
Thrown when the client tried to modify a message not sent by them.
- 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.
ModifyAsync(Optional<string>, Optional<IEnumerable<DiscordEmbed>>)
Edits the message.
public Task<DiscordMessage> ModifyAsync(Optional<string> content, Optional<IEnumerable<DiscordEmbed>> embeds = default)
Parameters
content
Optional<string>New content.
embeds
Optional<IEnumerable<DiscordEmbed>>New embeds.
Returns
Exceptions
- UnauthorizedException
Thrown when the client tried to modify a message not sent by them.
- 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.
ModifyAsync(DiscordMessageBuilder)
Edits the message.
public Task<DiscordMessage> ModifyAsync(DiscordMessageBuilder builder)
Parameters
builder
DiscordMessageBuilderThe builder of the message to edit.
Returns
Exceptions
- UnauthorizedException
Thrown when the client tried to modify a message not sent by them.
- 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.
ModifyAsync(Action<DiscordMessageBuilder>)
Edits the message.
public Task<DiscordMessage> ModifyAsync(Action<DiscordMessageBuilder> action)
Parameters
action
Action<DiscordMessageBuilder>The builder of the message to edit.
Returns
Exceptions
- UnauthorizedException
Thrown when the client tried to modify a message not sent by them.
- 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.