Implement IMessageChannel#DeleteMessageAsync (#996)

* Implement DeleteMessageAsync

* Refer to MessageHelper instead of duplicating call

* Fix refactor error
This commit is contained in:
Still Hsu
2018-05-25 08:08:51 +08:00
committed by Christopher F
parent cee71ef35a
commit bc6009ec72
10 changed files with 48 additions and 2 deletions

View File

@@ -25,10 +25,12 @@ namespace Discord.Rest
};
return await client.ApiClient.ModifyMessageAsync(msg.Channel.Id, msg.Id, apiArgs, options).ConfigureAwait(false);
}
public static async Task DeleteAsync(IMessage msg, BaseDiscordClient client,
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)
{
await client.ApiClient.DeleteMessageAsync(msg.Channel.Id, msg.Id, options).ConfigureAwait(false);
await client.ApiClient.DeleteMessageAsync(channelId, msgId, options).ConfigureAwait(false);
}
public static async Task AddReactionAsync(IMessage msg, IEmote emote, BaseDiscordClient client, RequestOptions options)