Discord notices are not rendering #328

Closed
opened 2026-10-08 22:24:39 -04:00 by Salastil · 2 comments
Owner

image.pngimage.png

![image.png](/attachments/5c7abeae-f088-4c86-9fde-b2a96c2d3a42)![image.png](/attachments/b7d72ec3-5a17-46e2-8ea5-9a2b10187779)
168 KiB
176 KiB
Salastil added this to the v1.0 milestone 2026-10-08 22:24:39 -04:00
Author
Owner

Progress: ff7d313. Not finished - the second half is done, the first half needs one more look at what Discord sends.

Can we write here? (done). The daemon now says why a conversation cannot be written in, and the window puts a banner where the message box would be:

  • Discord's own notices: a DM whose one recipient is the platform's system account (also recognised from system on its messages) reads "This chat is reserved for official Discord notifications." with "Discord will never ask you for your password or account token." under it.
  • Guild channels: permissions are worked out from the roles and the channel's overwrites, as the view check already was (owner and administrators always can; a role can allow what @everyone is denied). Where this account has no Send Messages the banner reads "You do not have permission to send messages in this channel." Re-asked whenever the guild is read, since permissions change under a channel that is already open.
  • Tests: the permission cases and the system-DM detection (nobilis).

The notices' contents (not done). The stored copies of those messages hold only a title ("Important message from Discord regarding your account"), so whatever carries the text, the "Learn more" button and the red or neutral card is not in the fields moho reads. I did not call Discord from outside the app to find out - the account is restricted already and I would rather not add traffic from a second client. Instead, embeds now keep their fields and footer (a real gap: bots' labelled lines were dropped), and an embed that arrives with nothing but a title is written whole to the log (~/.cache/moho/moho.log, "an embed with only a title, as sent"). Opening that DM once after this build will leave the raw shape there, and the rest is a rendering job.

Before (left), after (right):

official

channel

Progress: [ff7d313](https://git.salastil.com/Salastil/moho/commit/ff7d313b46360d0667200c0c75a9f7f0063f43e7). **Not finished** - the second half is done, the first half needs one more look at what Discord sends. **Can we write here? (done).** The daemon now says why a conversation cannot be written in, and the window puts a banner where the message box would be: - **Discord's own notices:** a DM whose one recipient is the platform's `system` account (also recognised from `system` on its messages) reads "This chat is reserved for official Discord notifications." with "Discord will never ask you for your password or account token." under it. - **Guild channels:** permissions are worked out from the roles and the channel's overwrites, as the view check already was (owner and administrators always can; a role can allow what @everyone is denied). Where this account has no Send Messages the banner reads "You do not have permission to send messages in this channel." Re-asked whenever the guild is read, since permissions change under a channel that is already open. - Tests: the permission cases and the system-DM detection (nobilis). **The notices' contents (not done).** The stored copies of those messages hold only a title ("Important message from Discord regarding your account"), so whatever carries the text, the "Learn more" button and the red or neutral card is not in the fields moho reads. I did not call Discord from outside the app to find out - the account is restricted already and I would rather not add traffic from a second client. Instead, embeds now keep their **fields** and **footer** (a real gap: bots' labelled lines were dropped), and an embed that arrives with nothing but a title is written **whole** to the log (`~/.cache/moho/moho.log`, "an embed with only a title, as sent"). Opening that DM once after this build will leave the raw shape there, and the rest is a rendering job. Before (left), after (right): ![official](https://git.salastil.com/attachments/d98bdc12-a0f4-45c4-a72e-dde95697c3b1) ![channel](https://git.salastil.com/attachments/4f30288d-d8c9-48bd-9cc9-e5fef9ccd8e8)
Author
Owner

Finished: d7c4215.

Finished. (Both halves; the earlier progress comment has the banner half.)

What Discord was sending. Reading your log after you opened the DM: these notices are embeds of type safety_system_notification, whose content is not the usual title and description but a list of labelled values - header, body, icon_type, theme, a timestamp in seconds, ctas (what the button is) and learn_more_link. The embed's own title ("Important message from Discord regarding your account") is only a stand-in for clients too old to read it, which is the one line moho was drawing.

Now:

  • Read as cards (nobilis 7561b88): the header is the title, the body the description, a warning glyph for the ones that act on the account, the time, and a button along the foot - "Learn more" opens the support page; "See details in Discord" (a page inside Discord's own app) is drawn with nowhere to go, since there is nowhere to go from here. Red accent and button where the notice acts on the account (theme danger), Discord's blue otherwise.
  • The ones already saved were stored title-only and saved history is not fetched again, so the daemon reads the latest page of that conversation again once per run, a few seconds after connecting (one request, what opening it costs anyway), and replaces any card that reads better. Verified live against your daemon: it updated 9 messages.
  • Fields and footer on ordinary embeds are drawn too (they were dropped for every bot).
  • Plus the banner half: where the message box would be, Discord's notices DM and every channel this account may read but not write now say why - live in your daemon the DM and the rules/announcements channels (11 in all) are flagged correctly.
  • Tests: the safety-notice reading (title, body, link, colour, the button with nowhere to go), embed fields and footer, and the permission and system-DM detection.
  • Left out: the "OFFICIAL" tag beside the sender's name, and the relative "7 days ago" is shown as a date for older ones.

Before (left), after (right; staged from the shape in your log):

notices

Finished: [d7c4215](https://git.salastil.com/Salastil/moho/commit/d7c4215473accfe6d13b4311e601bb800ed41885). Finished. (Both halves; the earlier progress comment has the banner half.) **What Discord was sending.** Reading your log after you opened the DM: these notices are embeds of type `safety_system_notification`, whose content is not the usual title and description but a list of labelled values - `header`, `body`, `icon_type`, `theme`, a `timestamp` in seconds, `ctas` (what the button is) and `learn_more_link`. The embed's own title ("Important message from Discord regarding your account") is only a stand-in for clients too old to read it, which is the one line moho was drawing. **Now:** - **Read as cards** (nobilis 7561b88): the header is the title, the body the description, a warning glyph for the ones that act on the account, the time, and a button along the foot - "Learn more" opens the support page; "See details in Discord" (a page inside Discord's own app) is drawn with nowhere to go, since there is nowhere to go from here. Red accent and button where the notice acts on the account (theme danger), Discord's blue otherwise. - **The ones already saved** were stored title-only and saved history is not fetched again, so the daemon reads the latest page of that conversation again once per run, a few seconds after connecting (one request, what opening it costs anyway), and replaces any card that reads better. Verified live against your daemon: it updated 9 messages. - **Fields and footer** on ordinary embeds are drawn too (they were dropped for every bot). - Plus the banner half: where the message box would be, Discord's notices DM and every channel this account may read but not write now say why - live in your daemon the DM and the rules/announcements channels (11 in all) are flagged correctly. - Tests: the safety-notice reading (title, body, link, colour, the button with nowhere to go), embed fields and footer, and the permission and system-DM detection. - Left out: the "OFFICIAL" tag beside the sender's name, and the relative "7 days ago" is shown as a date for older ones. Before (left), after (right; staged from the shape in your log): ![notices](https://git.salastil.com/attachments/e508efae-388a-4f34-8550-0b1294622909)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Salastil/moho#328