Class MessageReference
Contains the IDs sent from a crossposted message or inline reply.
Namespace: Discord
Assembly: Discord.Net.Core.dll
Syntax
public class MessageReference : object
Constructors
| Improve this Doc View SourceMessageReference(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 SourceChannelId
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.
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> |
GuildId
Gets the Guild ID of the original message.
Declaration
public Optional<ulong> GuildId { get; }
Property Value
Type | Description |
---|---|
Optional<UInt64> |
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 SourceToString()
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String |