Table of Contents

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

builder DiscordMessageBuilder

The builder of the message to edit.

modifyMode ModifyMode

The mode of modification.

Returns

Task<DiscordMessage>

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

action Action<DiscordMessageBuilder>

The builder of the message to edit.

modifyMode ModifyMode

The mode of modification.

Returns

Task<DiscordMessage>

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

content string

The content to edit.

Returns

Task<DiscordMessage>

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

embed DiscordEmbed

The embed to add.

Returns

Task<DiscordMessage>

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

embeds IEnumerable<DiscordEmbed>

The embeds to add.

Returns

Task<DiscordMessage>

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

content string

The content to edit.

embed DiscordEmbed

The embed to add.

Returns

Task<DiscordMessage>

ModifyAsync(string, IEnumerable<DiscordEmbed>)

Modifies the message by modifying the content and adding embeds.

public Task<DiscordMessage> ModifyAsync(string content, IEnumerable<DiscordEmbed> embeds)

Parameters

content string

The content to edit.

embeds IEnumerable<DiscordEmbed>

The embeds to add.

Returns

Task<DiscordMessage>

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.