ModifyAsync will accept an EmbedBuilder

**This is not a breaking change**.

This change begins to implement #379, where IUserMessage.ModifyAsync will now accept a `Discord.ModifyMessageParams` func over a `Discord.API.Rest.ModifyMessageParams` func.
This commit is contained in:
Christopher F
2016-11-25 22:12:28 -05:00
parent 8ec80663f0
commit 6519b300d9
5 changed files with 22 additions and 4 deletions

View File

@@ -15,7 +15,12 @@ namespace Discord.Rest
{
var args = new ModifyMessageParams();
func(args);
return await client.ApiClient.ModifyMessageAsync(msg.Channel.Id, msg.Id, args, options).ConfigureAwait(false);
var apiArgs = new API.Rest.ModifyMessageParams
{
Content = args.Content,
Embed = args.Embed.IsSpecified ? args.Embed.Value.Build() : Optional.Create<API.Embed>()
};
return await client.ApiClient.ModifyMessageAsync(msg.Channel.Id, msg.Id, apiArgs, options).ConfigureAwait(false);
}
public static async Task DeleteAsync(IMessage msg, BaseDiscordClient client,
RequestOptions options)