Table of Contents

Class MessageReference

Namespace
Discord
Assembly
Discord.Net.Core.dll

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

public class MessageReference
Inheritance
MessageReference
Inherited Members

Constructors

MessageReference(ulong?, ulong?, ulong?, bool?, MessageReferenceType)

Initializes a new instance of the MessageReference class.

public MessageReference(ulong? messageId = null, ulong? channelId = null, ulong? guildId = null, bool? failIfNotExists = null, MessageReferenceType referenceType = MessageReferenceType.Default)

Parameters

messageId ulong?

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

channelId ulong?

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

guildId ulong?

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

failIfNotExists bool?

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

referenceType MessageReferenceType

Properties

ChannelId

Gets the Channel ID of the original message.

public ulong ChannelId { get; }

Property Value

ulong

Remarks

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

FailIfNotExists

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

public Optional<bool> FailIfNotExists { get; }

Property Value

Optional<bool>

GuildId

Gets the Guild ID of the original message.

public Optional<ulong> GuildId { get; }

Property Value

Optional<ulong>

MessageId

Gets the Message ID of the original message.

public Optional<ulong> MessageId { get; }

Property Value

Optional<ulong>

ReferenceType

Gets the type of message reference.

public Optional<MessageReferenceType> ReferenceType { get; }

Property Value

Optional<MessageReferenceType>

Methods

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.