diff --git a/src/Discord.Net.Core/Entities/Messages/IMessage.cs b/src/Discord.Net.Core/Entities/Messages/IMessage.cs
index a53ae71e4..36fa602a7 100644
--- a/src/Discord.Net.Core/Entities/Messages/IMessage.cs
+++ b/src/Discord.Net.Core/Entities/Messages/IMessage.cs
@@ -31,6 +31,13 @@ namespace Discord
///
bool IsPinned { get; }
///
+ /// Gets the value that indicates whether or not this message's embeds are suppressed.
+ ///
+ ///
+ /// true if the embeds in this message have been suppressed (made invisible); otherwise false.
+ ///
+ bool IsSuppressed { get; }
+ ///
/// Gets the content for this message.
///
///
diff --git a/src/Discord.Net.Core/Entities/Messages/IUserMessage.cs b/src/Discord.Net.Core/Entities/Messages/IUserMessage.cs
index 1a8c54ab1..b3d6430d3 100644
--- a/src/Discord.Net.Core/Entities/Messages/IUserMessage.cs
+++ b/src/Discord.Net.Core/Entities/Messages/IUserMessage.cs
@@ -29,6 +29,18 @@ namespace Discord
///
Task ModifyAsync(Action func, RequestOptions options = null);
///
+ /// Modifies the suppression of this message.
+ ///
+ ///
+ /// This method modifies whether or not embeds in this message are suppressed (hidden).
+ ///
+ /// Whether or not embeds in this message should be suppressed.
+ /// The options to be used when sending the request.
+ ///
+ /// A task that represents the asynchronous modification operation.
+ ///
+ Task ModifySuppressionAsync(bool suppressEmbeds, RequestOptions options = null);
+ ///
/// Adds this message to its channel's pinned messages.
///
/// The options to be used when sending the request.
diff --git a/src/Discord.Net.Rest/API/Common/Message.cs b/src/Discord.Net.Rest/API/Common/Message.cs
index 10bdbe568..a5016f923 100644
--- a/src/Discord.Net.Rest/API/Common/Message.cs
+++ b/src/Discord.Net.Rest/API/Common/Message.cs
@@ -50,5 +50,7 @@ namespace Discord.API
// sent with Rich Presence-related chat embeds
[JsonProperty("application")]
public Optional Application { get; set; }
+ [JsonProperty("flags")]
+ public Optional Flags { get; set; }
}
}
diff --git a/src/Discord.Net.Rest/DiscordRestApiClient.cs b/src/Discord.Net.Rest/DiscordRestApiClient.cs
index 777ed8e99..2757c0f34 100644
--- a/src/Discord.Net.Rest/DiscordRestApiClient.cs
+++ b/src/Discord.Net.Rest/DiscordRestApiClient.cs
@@ -608,6 +608,16 @@ namespace Discord.API
return await SendJsonAsync("PATCH", () => $"channels/{channelId}/messages/{messageId}", args, ids, clientBucket: ClientBucketType.SendEdit, options: options).ConfigureAwait(false);
}
+ public async Task SuppressEmbedAsync(ulong channelId, ulong messageId, Rest.SuppressEmbedParams args, RequestOptions options = null)
+ {
+ Preconditions.NotEqual(channelId, 0, nameof(channelId));
+ Preconditions.NotEqual(messageId, 0, nameof(messageId));
+ options = RequestOptions.CreateOrClone(options);
+
+ var ids = new BucketIds(channelId: channelId);
+ await SendJsonAsync("POST", () => $"channels/{channelId}/messages/{messageId}/suppress-embeds", args, ids, options: options).ConfigureAwait(false);
+ }
+
public async Task AddReactionAsync(ulong channelId, ulong messageId, string emoji, RequestOptions options = null)
{
Preconditions.NotEqual(channelId, 0, nameof(channelId));
diff --git a/src/Discord.Net.Rest/Entities/Messages/MessageHelper.cs b/src/Discord.Net.Rest/Entities/Messages/MessageHelper.cs
index a132eca52..2d137a131 100644
--- a/src/Discord.Net.Rest/Entities/Messages/MessageHelper.cs
+++ b/src/Discord.Net.Rest/Entities/Messages/MessageHelper.cs
@@ -20,6 +20,7 @@ namespace Discord.Rest
var args = new MessageProperties();
func(args);
+
var apiArgs = new API.Rest.ModifyMessageParams
{
Content = args.Content,
@@ -35,6 +36,15 @@ namespace Discord.Rest
await client.ApiClient.DeleteMessageAsync(channelId, msgId, options).ConfigureAwait(false);
}
+ public static async Task SuppressEmbedsAsync(IMessage msg, BaseDiscordClient client, bool suppress, RequestOptions options)
+ {
+ var apiArgs = new API.Rest.SuppressEmbedParams
+ {
+ Suppressed = suppress
+ };
+ await client.ApiClient.SuppressEmbedAsync(msg.Channel.Id, msg.Id, apiArgs, options).ConfigureAwait(false);
+ }
+
public static async Task AddReactionAsync(IMessage msg, IEmote emote, BaseDiscordClient client, RequestOptions options)
{
await client.ApiClient.AddReactionAsync(msg.Channel.Id, msg.Id, emote is Emote e ? $"{e.Name}:{e.Id}" : emote.Name, options).ConfigureAwait(false);
diff --git a/src/Discord.Net.Rest/Entities/Messages/RestMessage.cs b/src/Discord.Net.Rest/Entities/Messages/RestMessage.cs
index fae1aff99..330db97f8 100644
--- a/src/Discord.Net.Rest/Entities/Messages/RestMessage.cs
+++ b/src/Discord.Net.Rest/Entities/Messages/RestMessage.cs
@@ -33,6 +33,8 @@ namespace Discord.Rest
///
public virtual bool IsPinned => false;
///
+ public virtual bool IsSuppressed => false;
+ ///
public virtual DateTimeOffset? EditedTimestamp => null;
///
/// Gets a collection of the 's on the message.
diff --git a/src/Discord.Net.Rest/Entities/Messages/RestUserMessage.cs b/src/Discord.Net.Rest/Entities/Messages/RestUserMessage.cs
index dfef960c2..a6951aa34 100644
--- a/src/Discord.Net.Rest/Entities/Messages/RestUserMessage.cs
+++ b/src/Discord.Net.Rest/Entities/Messages/RestUserMessage.cs
@@ -14,7 +14,7 @@ namespace Discord.Rest
[DebuggerDisplay(@"{DebuggerDisplay,nq}")]
public class RestUserMessage : RestMessage, IUserMessage
{
- private bool _isMentioningEveryone, _isTTS, _isPinned;
+ private bool _isMentioningEveryone, _isTTS, _isPinned, _isSuppressed;
private long? _editedTimestampTicks;
private ImmutableArray _attachments = ImmutableArray.Create();
private ImmutableArray