TextsHQ / platform-discord

MIT License
1 stars 0 forks source link

resolve pomelo username mentions properly #20

Closed slice closed 8 months ago

slice commented 8 months ago

the vast majority of users are on the new "pomelo" system (no more #0000, just plain usernames) - but we didn't map mentions properly, making most users completely unmentionable. ATM, this is practically only applicable to group DMs as we don't have fleshed out server support yet.

this fixes not being able to mention people and centralizes our user → username mapping (just uses pomelo username, but does + `#${user.discriminator}` for old users).

discord is actually starting to give old users pomelo usernames, so this isn't too much of a concern for now, but some bots i use still have discriminators

2024_03_06-03-45-15-AM@2x

fixes PLT-1181

linear[bot] commented 8 months ago
PLT-1181 Discord: mentions are not sent properly

tab-complete works to send "username", but it doesn't actually resolve to the proper mention syntax.

slice commented 8 months ago

regex matching behavior:

2024_03_06-03-53-35-AM@2x

slice commented 8 months ago

hmm it's a bit unfortunate that it matches on @foo., because foo. is totally a valid username but if you put a period right after a mention such as when you are ending a sentence, it could mismatch when the user intends to mention @foo. i wonder if we can attach data to mentions at compose time, instead of mapping afterwards

KishanBagaria commented 8 months ago

yeah we should make the client send in more info like the indices of the mentions