Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Throw when attempting to modify a message not made by the current user #992

Merged
merged 3 commits into from Mar 24, 2018

Conversation

Joe4evr
Copy link
Contributor

@Joe4evr Joe4evr commented Mar 23, 2018

Too many times people forget that they cannot change the contents of another user's message, and we are not communicating that fact properly.

@@ -13,6 +13,9 @@ internal static class MessageHelper
public static async Task<Model> ModifyAsync(IMessage msg, BaseDiscordClient client, Action<MessageProperties> func,
RequestOptions options)
{
if (msg.Author.Id != client.CurrentUser.Id)
throw new InvalidOperationException("Discord allows only the author of a message to change it.");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this would look better if it dropped the 'Discord' part and instead read Only the author of a message may change it. Passive-aggressive jabs at Discord look better in commit messages than public-facing errors :^)

@foxbot foxbot merged commit d50fc3b into discord-net:dev Mar 24, 2018
@Joe4evr Joe4evr deleted the ModifyMessageCheck branch March 24, 2018 17:30
FiniteReality pushed a commit to FiniteReality/Discord.Net that referenced this pull request May 5, 2018
discord-net#992)

* Throw when attempting to modify a message not made by the current user

* Didn't realize the client is passed into the MessageHelper function

* Respond to feedback
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants