Method ModifyAsync
- Namespace
- DisCatSharp.Entities
- Assembly
- DisCatSharp.dll
ModifyAsync(DiscordMessageBuilder, ModifyMode)
Edits the message.
public Task<DiscordMessage> ModifyAsync(DiscordMessageBuilder builder, ModifyMode modifyMode = ModifyMode.Update)
Parameters
builderDiscordMessageBuilderThe builder of the message to edit.
modifyModeModifyModeThe mode of modification.
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>, ModifyMode)
Edits the message.
public Task<DiscordMessage> ModifyAsync(Action<DiscordMessageBuilder> action, ModifyMode modifyMode = ModifyMode.Update)
Parameters
actionAction<DiscordMessageBuilder>The builder of the message to edit.
modifyModeModifyModeThe mode of modification.
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(string)
Modifies the message by editing the content.
public Task<DiscordMessage> ModifyAsync(string content)
Parameters
contentstringThe content 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(DiscordEmbed)
Modifies the message by adding an embed.
public Task<DiscordMessage> ModifyAsync(DiscordEmbed embed)
Parameters
embedDiscordEmbedThe embed to add.
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(IEnumerable<DiscordEmbed>)
Modifies the message by adding embeds.
public Task<DiscordMessage> ModifyAsync(IEnumerable<DiscordEmbed> embeds)
Parameters
embedsIEnumerable<DiscordEmbed>The embeds to add.
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(string, DiscordEmbed)
Modifies the message by modifying the content an embed.
public Task<DiscordMessage> ModifyAsync(string content, DiscordEmbed embed)
Parameters
contentstringThe content to edit.
embedDiscordEmbedThe embed to add.
Returns
ModifyAsync(string, IEnumerable<DiscordEmbed>)
Modifies the message by modifying the content and adding embeds.
public Task<DiscordMessage> ModifyAsync(string content, IEnumerable<DiscordEmbed> embeds)
Parameters
contentstringThe content to edit.
embedsIEnumerable<DiscordEmbed>The embeds to add.
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.