[ifcbrk] feature: suppress messages

yeah man I support the first amendment
This commit is contained in:
Christopher Felegy
2019-06-21 17:17:54 -04:00
parent 1e8aa080ab
commit cd288923c3
9 changed files with 65 additions and 2 deletions

View File

@@ -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);