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
- messageIdulong?
- The ID of the message that will be referenced. Used to reply to specific messages and the only parameter required for it. 
- channelIdulong?
- The ID of the channel that will be referenced. It will be validated if sent. 
- guildIdulong?
- The ID of the guild that will be referenced. It will be validated if sent. 
- failIfNotExistsbool?
- Whether to error if the referenced message doesn't exist instead of sending as a normal (non-reply) message. Defaults to true. 
- referenceTypeMessageReferenceType
Properties
ChannelId
Gets the Channel ID of the original message.
public ulong ChannelId { get; }Property Value
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
GuildId
Gets the Guild ID of the original message.
public Optional<ulong> GuildId { get; }Property Value
MessageId
Gets the Message ID of the original message.
public Optional<ulong> MessageId { get; }Property Value
ReferenceType
Gets the type of message reference.
public Optional<MessageReferenceType> ReferenceType { get; }Property Value
Methods
ToString()
Returns a string that represents the current object.
public override string ToString()Returns
- string
- A string that represents the current object.