From bfad32946472efc94c313161bc3824fcd3f0db26 Mon Sep 17 00:00:00 2001 From: Steven Date: Sat, 15 Jan 2022 00:16:52 -0500 Subject: [PATCH] use IEnumerable instead of array for reactions --- src/Discord.Net.Core/Extensions/MessageExtensions.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Discord.Net.Core/Extensions/MessageExtensions.cs b/src/Discord.Net.Core/Extensions/MessageExtensions.cs index c187ecd5b..8fcc201d2 100644 --- a/src/Discord.Net.Core/Extensions/MessageExtensions.cs +++ b/src/Discord.Net.Core/Extensions/MessageExtensions.cs @@ -1,3 +1,4 @@ +using System.Collections.Generic; using System.Threading.Tasks; namespace Discord @@ -34,18 +35,19 @@ public static string GetJumpUrl(this IMessage msg) /// /// /// The message to add reactions to. - /// An array of reactions to add to the message. + /// An enumerable of reactions to add to the message. /// The options to be used when sending the request. /// /// A task that represents the asynchronous operation for adding a reaction to this message. /// /// /// - public static async Task AddReactionsAsync(this IUserMessage msg, IEmote[] reactions, RequestOptions options = null) + public static async Task AddReactionsAsync(this IUserMessage msg, IEnumerable reactions, RequestOptions options = null) { foreach (var rxn in reactions) await msg.AddReactionAsync(rxn, options).ConfigureAwait(false); } + /// /// Remove multiple reactions from a message. /// @@ -60,14 +62,14 @@ public static async Task AddReactionsAsync(this IUserMessage msg, IEmote[] react /// /// The message to remove reactions from. /// The user who removed the reaction. - /// An array of reactions to remove from the message. + /// An enumerable of reactions to remove from the message. /// The options to be used when sending the request. /// /// A task that represents the asynchronous operation for removing a reaction to this message. /// /// /// - public static async Task RemoveReactionsAsync(this IUserMessage msg, IUser user, IEmote[] reactions, RequestOptions options = null) + public static async Task RemoveReactionsAsync(this IUserMessage msg, IUser user, IEnumerable reactions, RequestOptions options = null) { foreach (var rxn in reactions) await msg.RemoveReactionAsync(rxn, user, options).ConfigureAwait(false);