Discord: a typed @name never pings anyone #61

Closed
opened 2026-09-02 00:04:07 -04:00 by Salastil · 1 comment
Owner

Incoming <@id> mentions are resolved to @name (discord.rs:2068), but nothing does the reverse. send_message posts the raw string as content (discord.rs:3194), so typing @someone sends the literal text and notifies nobody.

There is also no mention autocomplete in Composer.tsx, so there is no way to produce a real mention at all.

Role mentions <@&id>, channel mentions <#id> and @everyone/@here are likewise neither produced outbound nor resolved inbound (channel mentions are resolved — see the closed #37 — roles are not).

Done looks like: an autocomplete in the composer that inserts <@id>, and/or resolving @name against the buffer's member list on send. Worth pairing with allowed_mentions so a reply does not always ping.

Incoming `<@id>` mentions are resolved to `@name` (`discord.rs:2068`), but nothing does the reverse. `send_message` posts the raw string as `content` (`discord.rs:3194`), so typing `@someone` sends the literal text and notifies nobody. There is also no mention autocomplete in `Composer.tsx`, so there is no way to produce a real mention at all. Role mentions `<@&id>`, channel mentions `<#id>` and `@everyone`/`@here` are likewise neither produced outbound nor resolved inbound (channel mentions *are* resolved — see the closed #37 — roles are not). **Done looks like:** an autocomplete in the composer that inserts `<@id>`, and/or resolving `@name` against the buffer's member list on send. Worth pairing with `allowed_mentions` so a reply does not always ping.
Salastil added the bugcritical labels 2026-09-03 13:11:26 -04:00
Author
Owner

Finished, and widened past Discord on the way.

Discord. A typed name is resolved against the channel's roster at send time and becomes <@id> — longest name first, so "@Sam Vimes" is one person rather than Sam and a loose word, and bounded so "@sam" inside an email address is left alone. @everyone and @here stay literal, since Discord reads those itself. Roles resolve too, to <@&id>, limited to the ones a guild marks mentionable.

Matrix now sends m.mentions and honours it inbound — that is the whole reason intentional mentions exist, since the old way left every client scanning every message for its own name, and the same mention could be seen by one client and missed by another.

Being addressed with everybody else counts as being addressed: @everyone/@here on Discord, @room on Matrix, @everyone on Sneedchat. Not on IRC or Kick, where the word is just a word and highlighting it would be inventing a mention the network never sent.

The picker. Typing "@" lists the people here, this service's mentionable roles, and its whole-room words. Arrows move, Enter or Tab takes, Escape dismisses. Matching is fuzzy rather than prefix — a prefix wins, then a word start, then a run of adjacent letters — because the names are long and full of punctuation nobody types in order. What gets inserted is what the service wants: "@name", except IRC where a name at the start of a line becomes "name: ".

Verified live in a Discord guild: typing @a offered eight ranked matches including fuzzy ones, arrow keys moved the selection, and Enter inserted @Aki-x .

nobilis c4cdb04, moho https://git.salastil.com/Salastil/moho/commit/541d18d

Finished, and widened past Discord on the way. **Discord.** A typed name is resolved against the channel's roster at send time and becomes `<@id>` — longest name first, so "@Sam Vimes" is one person rather than Sam and a loose word, and bounded so "@sam" inside an email address is left alone. `@everyone` and `@here` stay literal, since Discord reads those itself. **Roles resolve too**, to `<@&id>`, limited to the ones a guild marks mentionable. **Matrix** now sends `m.mentions` and honours it inbound — that is the whole reason intentional mentions exist, since the old way left every client scanning every message for its own name, and the same mention could be seen by one client and missed by another. **Being addressed with everybody else** counts as being addressed: `@everyone`/`@here` on Discord, `@room` on Matrix, `@everyone` on Sneedchat. Not on IRC or Kick, where the word is just a word and highlighting it would be inventing a mention the network never sent. **The picker.** Typing "@" lists the people here, this service's mentionable roles, and its whole-room words. Arrows move, Enter or Tab takes, Escape dismisses. Matching is fuzzy rather than prefix — a prefix wins, then a word start, then a run of adjacent letters — because the names are long and full of punctuation nobody types in order. What gets inserted is what the service wants: "@name", except IRC where a name at the start of a line becomes "name: ". Verified live in a Discord guild: typing `@a` offered eight ranked matches including fuzzy ones, arrow keys moved the selection, and Enter inserted `@Aki-x `. nobilis c4cdb04, moho https://git.salastil.com/Salastil/moho/commit/541d18d
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Salastil/moho#61