Search Results for

    Show / Hide Table of Contents

    Class MessageProperties

    Properties that are used to modify an IUserMessage with the specified changes.

    Inheritance
    Object
    MessageProperties
    Namespace: Discord
    Assembly: Discord.Net.Core.dll
    Syntax
    public class MessageProperties : object
    Remarks

    The content of a message can be cleared with if and only if an Embed is present.

    Examples

    The following example uses ModifyAsync to apply changes specified in the properties,

    var message = await channel.SendMessageAsync("boo");
    await Task.Delay(TimeSpan.FromSeconds(1));
    await message.ModifyAsync(x => x.Content = "boi");
    

    Properties

    | Improve this Doc View Source

    AllowedMentions

    Gets or sets the allowed mentions of the message.

    Declaration
    public Optional<AllowedMentions> AllowedMentions { get; set; }
    Property Value
    Type Description
    Optional<AllowedMentions>
    | Improve this Doc View Source

    Attachments

    Gets or sets the attachments for the message.

    Declaration
    public Optional<IEnumerable<FileAttachment>> Attachments { get; set; }
    Property Value
    Type Description
    Optional<IEnumerable<FileAttachment>>
    | Improve this Doc View Source

    Components

    Gets or sets the components for this message.

    Declaration
    public Optional<MessageComponent> Components { get; set; }
    Property Value
    Type Description
    Optional<MessageComponent>
    | Improve this Doc View Source

    Content

    Gets or sets the content of the message.

    Declaration
    public Optional<string> Content { get; set; }
    Property Value
    Type Description
    Optional<String>
    Remarks

    This must be less than the constant defined by MaxMessageSize.

    | Improve this Doc View Source

    Embed

    Gets or sets a single embed for this message.

    Declaration
    public Optional<Embed> Embed { get; set; }
    Property Value
    Type Description
    Optional<Embed>
    Remarks

    This property will be added to the Embeds array, in the future please use the array rather than this property.

    | Improve this Doc View Source

    Embeds

    Gets or sets the embeds of the message.

    Declaration
    public Optional<Embed[]> Embeds { get; set; }
    Property Value
    Type Description
    Optional<Embed[]>
    | Improve this Doc View Source

    Flags

    Gets or sets the flags of the message.

    Declaration
    public Optional<MessageFlags?> Flags { get; set; }
    Property Value
    Type Description
    Optional<Nullable<MessageFlags>>
    Remarks

    Only SuppressEmbeds can be set/unset and you need to be the author of the message.

    See Also

    ModifyAsync(Action<MessageProperties>, RequestOptions)

    Theme

    • Improve this Doc
    • View Source
    In This Article
    Back to top Discord.Net (c) 2015-2022 3.9.0