Skip to content
This repository has been archived by the owner on Apr 20, 2022. It is now read-only.

Change AddReactionsAsync() and RemoveReactionsAsync() signature #427

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions src/Discord.Net.Core/Extensions/MessageExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System.Collections.Generic;
using System.Threading.Tasks;

namespace Discord
Expand Down Expand Up @@ -34,18 +35,19 @@ public static string GetJumpUrl(this IMessage msg)
/// </code>
/// </example>
/// <param name="msg">The message to add reactions to.</param>
/// <param name="reactions">An array of reactions to add to the message.</param>
/// <param name="reactions">An enumerable of reactions to add to the message.</param>
/// <param name="options">The options to be used when sending the request.</param>
/// <returns>
/// A task that represents the asynchronous operation for adding a reaction to this message.
/// </returns>
/// <seealso cref="IMessage.AddReactionAsync(IEmote, RequestOptions)"/>
/// <seealso cref="IEmote"/>
public static async Task AddReactionsAsync(this IUserMessage msg, IEmote[] reactions, RequestOptions options = null)
public static async Task AddReactionsAsync(this IUserMessage msg, IEnumerable<IEmote> reactions, RequestOptions options = null)
{
foreach (var rxn in reactions)
await msg.AddReactionAsync(rxn, options).ConfigureAwait(false);
}

/// <summary>
/// Remove multiple reactions from a message.
/// </summary>
Expand All @@ -60,14 +62,14 @@ public static async Task AddReactionsAsync(this IUserMessage msg, IEmote[] react
/// </example>
/// <param name="msg">The message to remove reactions from.</param>
/// <param name="user">The user who removed the reaction.</param>
/// <param name="reactions">An array of reactions to remove from the message.</param>
/// <param name="reactions">An enumerable of reactions to remove from the message.</param>
/// <param name="options">The options to be used when sending the request.</param>
/// <returns>
/// A task that represents the asynchronous operation for removing a reaction to this message.
/// </returns>
/// <seealso cref="IMessage.RemoveReactionAsync(IEmote, IUser, RequestOptions)"/>
/// <seealso cref="IEmote"/>
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<IEmote> reactions, RequestOptions options = null)
{
foreach (var rxn in reactions)
await msg.RemoveReactionAsync(rxn, user, options).ConfigureAwait(false);
Expand Down