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

Editing a reply message which didn't mention makes it mention #833

Closed
Emzi0767 opened this issue Apr 10, 2021 · 6 comments · Fixed by #1054
Closed

Editing a reply message which didn't mention makes it mention #833

Emzi0767 opened this issue Apr 10, 2021 · 6 comments · Fixed by #1054
Projects

Comments

@Emzi0767
Copy link
Contributor

Emzi0767 commented Apr 10, 2021

Summary

If you send a reply message that does not mention, then edit it, it will make it mention. This is not normal behaviour.

Details

No idea why that is, I reckon @VelvetThePanda and @ProfDoof will have some input as they are the ones who originally implemented the feature in D#+

Steps to reproduce

[Command]
public async Task TestReplyBork(CommandContext ctx)
{
    var msg = await ctx.RespondAsync("nope"); // sends a non-mentioning reply by default
    await msg.ModifyAsync(x => x.Content = "yep"); // now it mentions
}

Notes

This has to be resolved before 4.0 release.

@Emzi0767 Emzi0767 added this to the v4.0 release milestone Apr 10, 2021
@Emzi0767 Emzi0767 added this to Bugs in v4.0 Apr 10, 2021
@VelvetToroyashi
Copy link
Member

If I'm not mistaken this is undefined behavior in the API? This same behavior is expressed in the desktop and mobile client. It's likely to do with mentions being overrided or the likes. Using the MessageBuilder does not have this problem last I checked.

@Emzi0767
Copy link
Contributor Author

I tried editing as a user and that did not happen.

@MerlijnVanherck
Copy link

This seems to be a case of Discord lying in their documentation. They say replied_user defaults to false, but that doesn't seem to be the case.

I changed the code in EditMessageAsync to include this else:

if (mentions != null)
    pld.Mentions = new DiscordMentions(mentions);
else
    pld.Mentions = new DiscordMentions(Mentions.None);

And that fixes it in the sense that the message no longer mentions after an edit, if you want to allow users to change whether an existing reply can mention you'd have to add an additional parameter probably.

@VelvetToroyashi
Copy link
Member

This could be changed to a null coalescing operator.

@VelvetToroyashi
Copy link
Member

Furthermore, @Emzi0767, it does seem to have inconsistent behavior across clients. Mobile for example still has this issue image

@Neuheit
Copy link
Contributor

Neuheit commented Apr 11, 2021

This seems to be a case of Discord lying in their documentation. They say replied_user defaults to false, but that doesn't seem to be the case.

This appears to be correct, this example sends a null mentions object when sending, but Discord still makes it mention.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
v4.0
Bugs
4 participants