| @@ -1,4 +1,4 @@ | |||||
| using Discord.API.Rest; | |||||
| using Discord.API.Rest; | |||||
| using System; | using System; | ||||
| using System.Collections.Generic; | using System.Collections.Generic; | ||||
| using System.Collections.Immutable; | using System.Collections.Immutable; | ||||
| @@ -13,6 +13,9 @@ namespace Discord.Rest | |||||
| public static async Task<Model> ModifyAsync(IMessage msg, BaseDiscordClient client, Action<MessageProperties> func, | public static async Task<Model> ModifyAsync(IMessage msg, BaseDiscordClient client, Action<MessageProperties> func, | ||||
| RequestOptions options) | RequestOptions options) | ||||
| { | { | ||||
| if (msg.Author.Id != client.CurrentUser.Id) | |||||
| throw new InvalidOperationException("Discord allows only the author of a message to change it."); | |||||
| var args = new MessageProperties(); | var args = new MessageProperties(); | ||||
| func(args); | func(args); | ||||
| var apiArgs = new API.Rest.ModifyMessageParams | var apiArgs = new API.Rest.ModifyMessageParams | ||||
| @@ -126,8 +126,6 @@ namespace Discord.Rest | |||||
| public async Task ModifyAsync(Action<MessageProperties> func, RequestOptions options = null) | public async Task ModifyAsync(Action<MessageProperties> func, RequestOptions options = null) | ||||
| { | { | ||||
| if (Author.Id != Discord.CurrentUser.Id) | |||||
| throw new InvalidOperationException("Discord allows only the author of a message to change it."); | |||||
| var model = await MessageHelper.ModifyAsync(this, Discord, func, options).ConfigureAwait(false); | var model = await MessageHelper.ModifyAsync(this, Discord, func, options).ConfigureAwait(false); | ||||
| Update(model); | Update(model); | ||||
| } | } | ||||
| @@ -122,11 +122,7 @@ namespace Discord.WebSocket | |||||
| } | } | ||||
| public Task ModifyAsync(Action<MessageProperties> func, RequestOptions options = null) | public Task ModifyAsync(Action<MessageProperties> func, RequestOptions options = null) | ||||
| { | |||||
| if (Author.Id != Discord.CurrentUser.Id) | |||||
| throw new InvalidOperationException("Discord allows only the author of a message to change it."); | |||||
| return MessageHelper.ModifyAsync(this, Discord, func, options); | |||||
| } | |||||
| => MessageHelper.ModifyAsync(this, Discord, func, options); | |||||
| public Task AddReactionAsync(IEmote emote, RequestOptions options = null) | public Task AddReactionAsync(IEmote emote, RequestOptions options = null) | ||||
| => MessageHelper.AddReactionAsync(this, emote, Discord, options); | => MessageHelper.AddReactionAsync(this, emote, Discord, options); | ||||