ttstoy: announce images, files and links without the accessibility trigger

Accessibility mode speaks only `..`-triggered messages, so a posted image or
link went unmentioned and listeners could not follow the side chat. Those
posts are now announced regardless of the trigger, and the name prefix is
skipped for them because the announcement already names the speaker.
This commit is contained in:
2026-11-04 18:51:28 -06:00
parent 84feec2e2a
commit f7538574c7
2 changed files with 38 additions and 10 deletions
+7 -3
View File
@@ -14,7 +14,9 @@ Start and stop require the bot owner. Engine and name announcements also require
## The `..` trigger
A message is spoken only when it starts with `..`. The trigger and the whitespace after it are dropped before speaking, so `..good game` is read as "good game". A message without the trigger is ignored, so normal conversation is never spoken.
Plain text is spoken only when it starts with `..`. The trigger and the whitespace after it are dropped before speaking, so `..good game` is read as "good game".
Images, files, links and embeds are announced without the trigger, as "<name> sent an image", "<name> sent a file" or "<name> sent a link", so a listener still learns that something was posted. Every other message without the trigger is ignored, so normal conversation is never read aloud.
## Conditions for a message to be read
@@ -25,7 +27,7 @@ All of these must hold:
3. The message is in that voice channel's text chat, which Discord exposes as a text channel with the same ID as the voice channel.
4. The message is not from a bot.
5. The message does not parse as a command, so `[p]tts` invocations are not read twice.
6. The message starts with `..`.
6. The message starts with `..`, or it carries an image, file, link or embed, which are announced without the trigger.
## What gets spoken
@@ -38,11 +40,13 @@ All of these must hold:
| `..` alone, only emoji after it, or only whitespace | Nothing |
| Obvious keyboard mash or spam | Nothing |
Attachments, links and embeds are announced whether or not the message carries the trigger. Plain text needs the trigger.
The nonsense filter is conservative. It drops messages with a single character repeated over most of the text, one short token repeated five or more times, a long alphabetic run with almost no vowels, very low character variety over a long message, or a short unit repeated to fill the message. Short real messages such as "ok", "lol" or "brb" pass through.
## Name announcements
The first message from a speaker since anyone else last spoke is prefixed with "Name said:". A speaker who sends several messages in a row is announced once. The tracker resets when the bot joins, leaves or moves voice channels, so a stale state does not carry into a new session.
The first message from a speaker since anyone else last spoke is prefixed with "Name said:". A speaker who sends several messages in a row is announced once. Image, file and link announcements already contain the speaker's name, so they are not prefixed again. The tracker resets when the bot joins, leaves or moves voice channels, so a stale state does not carry into a new session.
`[p]ttstoy accessibility names off` removes the prefix. Names attached to attachments and links are part of the announcement text itself, so they are spoken regardless of this setting.