@@ -44,8 +44,10 @@ namespace Discord.Rest
};
return await client.ApiClient.ModifyMessageAsync(msg.Channel.Id, msg.Id, apiArgs, options).ConfigureAwait(false);
}
public static Task DeleteAsync(IMessage msg, BaseDiscordClient client, RequestOptions options)
=> DeleteAsync(msg.Channel.Id, msg.Id, client, options);
public static async Task DeleteAsync(ulong channelId, ulong msgId, BaseDiscordClient client,
RequestOptions options)
{
@@ -115,6 +117,7 @@ namespace Discord.Rest
{
await client.ApiClient.AddPinAsync(msg.Channel.Id, msg.Id, options).ConfigureAwait(false);
}
public static async Task UnpinAsync(IMessage msg, BaseDiscordClient client,
RequestOptions options)
{
@@ -240,6 +243,7 @@ namespace Discord.Rest
return tags.ToImmutable();
}
private static int? FindIndex(IReadOnlyList<ITag> tags, int index)
{
int i = 0;
@@ -253,6 +257,7 @@ namespace Discord.Rest
return null; //Overlaps tag before this
return i;
}
public static ImmutableArray<ulong> FilterTagsByKey(TagType type, ImmutableArray<ITag> tags)
{
return tags
@@ -260,6 +265,7 @@ namespace Discord.Rest
.Select(x => x.Key)
.ToImmutableArray();
}
public static ImmutableArray<T> FilterTagsByValue<T>(TagType type, ImmutableArray<ITag> tags)
{
return tags
@@ -279,5 +285,14 @@ namespace Discord.Rest
return MessageSource.Bot;
return MessageSource.User;
}
public static Task PublishAsync(IMessage msg, BaseDiscordClient client, RequestOptions options)
=> PublishAsync(msg.Channel.Id, msg.Id, client, options);
public static async Task PublishAsync(ulong channelId, ulong msgId, BaseDiscordClient client,
RequestOptions options)
{
await client.ApiClient.PublishAsync(channelId, msgId, options).ConfigureAwait(false);
}
}
}