(ifcbrk) feature: Add ModifyMessageAsync to IMessageChannel (#1830)
This commit is contained in:
@@ -286,6 +286,13 @@ namespace Discord.Rest
|
||||
return RestUserMessage.Create(client, channel, client.CurrentUser, model);
|
||||
}
|
||||
|
||||
public static async Task<RestUserMessage> ModifyMessageAsync(IMessageChannel channel, ulong messageId, Action<MessageProperties> func,
|
||||
BaseDiscordClient client, RequestOptions options)
|
||||
{
|
||||
var msgModel = await MessageHelper.ModifyAsync(channel.Id, messageId, client, func, options).ConfigureAwait(false);
|
||||
return RestUserMessage.Create(client, channel, msgModel.Author.IsSpecified ? RestUser.Create(client, msgModel.Author.Value) : client.CurrentUser, msgModel);
|
||||
}
|
||||
|
||||
public static Task DeleteMessageAsync(IMessageChannel channel, ulong messageId, BaseDiscordClient client,
|
||||
RequestOptions options)
|
||||
=> MessageHelper.DeleteAsync(channel.Id, messageId, client, options);
|
||||
|
||||
Reference in New Issue
Block a user