diff --git a/src/Discord.Net.Commands/ModuleBase.cs b/src/Discord.Net.Commands/ModuleBase.cs
index ec1722c70..6ec2db54d 100644
--- a/src/Discord.Net.Commands/ModuleBase.cs
+++ b/src/Discord.Net.Commands/ModuleBase.cs
@@ -35,9 +35,10 @@ namespace Discord.Commands
/// Specifies if notifications are sent for mentioned users and roles in the .
/// If null, all mentioned roles and users will be notified.
///
- protected virtual async Task ReplyAsync(string message = null, bool isTTS = false, Embed embed = null, RequestOptions options = null, AllowedMentions allowedMentions = null)
+ /// The message references to be included. Used to reply to specific messages.
+ protected virtual async Task ReplyAsync(string message = null, bool isTTS = false, Embed embed = null, RequestOptions options = null, AllowedMentions allowedMentions = null, MessageReference messageReference = null)
{
- return await Context.Channel.SendMessageAsync(message, isTTS, embed, options, allowedMentions).ConfigureAwait(false);
+ return await Context.Channel.SendMessageAsync(message, isTTS, embed, options, allowedMentions, messageReference).ConfigureAwait(false);
}
///
/// The method to execute before executing the command.
diff --git a/src/Discord.Net.Core/Entities/Channels/IMessageChannel.cs b/src/Discord.Net.Core/Entities/Channels/IMessageChannel.cs
index 030a278bc..abd20e4f0 100644
--- a/src/Discord.Net.Core/Entities/Channels/IMessageChannel.cs
+++ b/src/Discord.Net.Core/Entities/Channels/IMessageChannel.cs
@@ -27,11 +27,12 @@ namespace Discord
/// Specifies if notifications are sent for mentioned users and roles in the message .
/// If null, all mentioned roles and users will be notified.
///
+ /// The message references to be included. Used to reply to specific messages.
///
/// A task that represents an asynchronous send operation for delivering the message. The task result
/// contains the sent message.
///
- Task SendMessageAsync(string text = null, bool isTTS = false, Embed embed = null, RequestOptions options = null, AllowedMentions allowedMentions = null);
+ Task SendMessageAsync(string text = null, bool isTTS = false, Embed embed = null, RequestOptions options = null, AllowedMentions allowedMentions = null, MessageReference messageReference = null);
///
/// Sends a file to this message channel with an optional caption.
///
@@ -63,11 +64,12 @@ namespace Discord
/// Specifies if notifications are sent for mentioned users and roles in the message .
/// If null, all mentioned roles and users will be notified.
///
+ /// The message references to be included. Used to reply to specific messages.
///
/// A task that represents an asynchronous send operation for delivering the message. The task result
/// contains the sent message.
///
- Task SendFileAsync(string filePath, string text = null, bool isTTS = false, Embed embed = null, RequestOptions options = null, bool isSpoiler = false, AllowedMentions allowedMentions = null);
+ Task SendFileAsync(string filePath, string text = null, bool isTTS = false, Embed embed = null, RequestOptions options = null, bool isSpoiler = false, AllowedMentions allowedMentions = null, MessageReference messageReference = null);
///
/// Sends a file to this message channel with an optional caption.
///
@@ -96,11 +98,12 @@ namespace Discord
/// Specifies if notifications are sent for mentioned users and roles in the message .
/// If null, all mentioned roles and users will be notified.
///
+ /// The message references to be included. Used to reply to specific messages.
///
/// A task that represents an asynchronous send operation for delivering the message. The task result
/// contains the sent message.
///
- Task SendFileAsync(Stream stream, string filename, string text = null, bool isTTS = false, Embed embed = null, RequestOptions options = null, bool isSpoiler = false, AllowedMentions allowedMentions = null);
+ Task SendFileAsync(Stream stream, string filename, string text = null, bool isTTS = false, Embed embed = null, RequestOptions options = null, bool isSpoiler = false, AllowedMentions allowedMentions = null, MessageReference messageReference = null);
///
/// Gets a message from this message channel.
diff --git a/src/Discord.Net.Core/Entities/Messages/AllowedMentions.cs b/src/Discord.Net.Core/Entities/Messages/AllowedMentions.cs
index d52feaa7d..0206ad7b1 100644
--- a/src/Discord.Net.Core/Entities/Messages/AllowedMentions.cs
+++ b/src/Discord.Net.Core/Entities/Messages/AllowedMentions.cs
@@ -49,6 +49,14 @@ namespace Discord
///
public List UserIds { get; set; } = new List();
+ ///
+ /// Gets or sets whether to mention the author of the message you are replying to or not.
+ ///
+ ///
+ /// Specifically for inline replies.
+ ///
+ public bool? MentionRepliedUser { get; set; } = null;
+
///
/// Initializes a new instance of the class.
///
diff --git a/src/Discord.Net.Core/Entities/Messages/MessageReference.cs b/src/Discord.Net.Core/Entities/Messages/MessageReference.cs
index 57a508a7c..533239f4a 100644
--- a/src/Discord.Net.Core/Entities/Messages/MessageReference.cs
+++ b/src/Discord.Net.Core/Entities/Messages/MessageReference.cs
@@ -3,7 +3,7 @@ using System.Diagnostics;
namespace Discord
{
///
- /// Contains the IDs sent from a crossposted message.
+ /// Contains the IDs sent from a crossposted message or inline reply.
///
[DebuggerDisplay(@"{DebuggerDisplay,nq}")]
public class MessageReference
@@ -16,6 +16,9 @@ namespace Discord
///
/// Gets the Channel ID of the original message.
///
+ ///
+ /// If there is no referenced channel id, it will be the default value (zero).
+ ///
public ulong ChannelId { get; internal set; }
///
@@ -23,6 +26,25 @@ namespace Discord
///
public Optional GuildId { get; internal set; }
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ /// The ID of the message that will be referenced. Used to reply to specific messages and the only parameter required for it.
+ ///
+ ///
+ /// The ID of the channel that will be referenced. It will be validated if sent.
+ ///
+ ///
+ /// The ID of the guild that will be referenced. It will be validated if sent.
+ ///
+ public MessageReference(ulong? messageId = null, ulong? channelId = null, ulong? guildId = null)
+ {
+ MessageId = messageId ?? Optional.Create();
+ ChannelId = channelId ?? default(ulong);
+ GuildId = guildId ?? Optional.Create();
+ }
+
private string DebuggerDisplay
=> $"Channel ID: ({ChannelId}){(GuildId.IsSpecified ? $", Guild ID: ({GuildId.Value})" : "")}" +
$"{(MessageId.IsSpecified ? $", Message ID: ({MessageId.Value})" : "")}";
diff --git a/src/Discord.Net.Core/Entities/Messages/MessageType.cs b/src/Discord.Net.Core/Entities/Messages/MessageType.cs
index ee5f4fb4d..bdbd8e534 100644
--- a/src/Discord.Net.Core/Entities/Messages/MessageType.cs
+++ b/src/Discord.Net.Core/Entities/Messages/MessageType.cs
@@ -57,5 +57,12 @@ namespace Discord
/// The message for when a news channel subscription is added to a text channel.
///
ChannelFollowAdd = 12,
+ ///
+ /// The message is an inline reply.
+ ///
+ ///
+ /// Only available in API v8.
+ ///
+ InlineReply = 19,
}
}
diff --git a/src/Discord.Net.Rest/API/Common/Message.cs b/src/Discord.Net.Rest/API/Common/Message.cs
index b4529d457..b781de346 100644
--- a/src/Discord.Net.Rest/API/Common/Message.cs
+++ b/src/Discord.Net.Rest/API/Common/Message.cs
@@ -56,5 +56,7 @@ namespace Discord.API
public Optional Flags { get; set; }
[JsonProperty("allowed_mentions")]
public Optional AllowedMentions { get; set; }
+ [JsonProperty("referenced_message")]
+ public Optional ReferencedMessage { get; set; }
}
}
diff --git a/src/Discord.Net.Rest/API/Common/MessageReference.cs b/src/Discord.Net.Rest/API/Common/MessageReference.cs
index 8c0f8fe14..c21f0158a 100644
--- a/src/Discord.Net.Rest/API/Common/MessageReference.cs
+++ b/src/Discord.Net.Rest/API/Common/MessageReference.cs
@@ -8,7 +8,7 @@ namespace Discord.API
public Optional MessageId { get; set; }
[JsonProperty("channel_id")]
- public ulong ChannelId { get; set; }
+ public Optional ChannelId { get; set; }
[JsonProperty("guild_id")]
public Optional GuildId { get; set; }
diff --git a/src/Discord.Net.Rest/API/Rest/CreateMessageParams.cs b/src/Discord.Net.Rest/API/Rest/CreateMessageParams.cs
index 4b56658d6..e64532864 100644
--- a/src/Discord.Net.Rest/API/Rest/CreateMessageParams.cs
+++ b/src/Discord.Net.Rest/API/Rest/CreateMessageParams.cs
@@ -17,6 +17,8 @@ namespace Discord.API.Rest
public Optional