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?)

Initializes a new instance of the MessageReference class.

public MessageReference(ulong? messageId = null, ulong? channelId = null, ulong? guildId = null, bool? failIfNotExists = null)

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.

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>

Methods

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.