Search Results for

    Show / Hide Table of Contents

    Class MessageReference

    Contains the IDs sent from a crossposted message or inline reply.

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

    Constructors

    | Improve this Doc View Source

    MessageReference(Nullable<UInt64>, Nullable<UInt64>, Nullable<UInt64>, Nullable<Boolean>)

    Initializes a new instance of the MessageReference class.

    Declaration
    public MessageReference(ulong? messageId = null, ulong? channelId = null, ulong? guildId = null, bool? failIfNotExists = null)
    Parameters
    Type Name Description
    Nullable<UInt64> messageId

    The ID of the message that will be referenced. Used to reply to specific messages and the only parameter required for it.

    Nullable<UInt64> channelId

    The ID of the channel that will be referenced. It will be validated if sent.

    Nullable<UInt64> guildId

    The ID of the guild that will be referenced. It will be validated if sent.

    Nullable<Boolean> failIfNotExists

    Whether to error if the referenced message doesn't exist instead of sending as a normal (non-reply) message. Defaults to true.

    Properties

    | Improve this Doc View Source

    ChannelId

    Gets the Channel ID of the original message.

    Declaration
    public ulong ChannelId { get; }
    Property Value
    Type Description
    UInt64
    Remarks

    It only will be the default value (zero) if it was instantiated with a null in the constructor.

    | Improve this Doc View Source

    FailIfNotExists

    Gets whether to error if the referenced message doesn't exist instead of sending as a normal (non-reply) message Defaults to true.

    Declaration
    public Optional<bool> FailIfNotExists { get; }
    Property Value
    Type Description
    Optional<Boolean>
    | Improve this Doc View Source

    GuildId

    Gets the Guild ID of the original message.

    Declaration
    public Optional<ulong> GuildId { get; }
    Property Value
    Type Description
    Optional<UInt64>
    | Improve this Doc View Source

    MessageId

    Gets the Message ID of the original message.

    Declaration
    public Optional<ulong> MessageId { get; }
    Property Value
    Type Description
    Optional<UInt64>

    Methods

    | Improve this Doc View Source

    ToString()

    Declaration
    public override string ToString()
    Returns
    Type Description
    String

    Theme

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