@rhizogrip/spore-plugin-telegram 0.8.0 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -11
- package/package.json +1 -1
- package/src/adapter.js +3 -2
package/README.md
CHANGED
|
@@ -143,8 +143,8 @@ refused chat 148392011 (@alice) — to allow it, add "148392011": "<a spore>" to
|
|
|
143
143
|
```
|
|
144
144
|
|
|
145
145
|
which is also how you learn your own user id: start with `"people": {}` and message the bot. A
|
|
146
|
-
group the file does not name is told nothing either, when someone there
|
|
147
|
-
says the `groups` entry to add, its id negative. Where a spore's `replyTo` default is one of this
|
|
146
|
+
group the file does not name is told nothing either, when someone there writes `/status@<the bot>`;
|
|
147
|
+
the log says the `groups` entry to add, its id negative. Where a spore's `replyTo` default is one of this
|
|
148
148
|
bot's chats, that chat is told the same line, once per chat the file does not name, so you hear of
|
|
149
149
|
someone trying the bot without reading its log.
|
|
150
150
|
|
|
@@ -152,11 +152,14 @@ someone trying the bot without reading its log.
|
|
|
152
152
|
|
|
153
153
|
A group has one spore — in a group the bot speaks as itself, so a second spore there is a second
|
|
154
154
|
bot — and `people`, who may address it: user ids, or `"*"` for everyone in the group, written out.
|
|
155
|
-
A message reaches the spore when it
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
155
|
+
A message reaches the spore when it replies to one of the bot's messages, is a command for it —
|
|
156
|
+
`/status`, or `/status@triage_bot` where several bots share the group; a command naming another bot
|
|
157
|
+
is not seen — or mentions the bot (`@triage_bot what failed?`). Telegram hands a bot a mention only
|
|
158
|
+
with its privacy mode off — `/setprivacy` in @BotFather, then the bot added to the group again — or
|
|
159
|
+
as an admin of the group; with neither, the service says so for each of its groups when it starts.
|
|
160
|
+
Anything else said there is not for the spore, and the bot's mention is not part of what the spore
|
|
161
|
+
is told. Someone the entry does not list who addresses the bot gets silence, and the log gets the
|
|
162
|
+
line that would let them in.
|
|
160
163
|
|
|
161
164
|
`/status` is for anyone listed; `/stop`, `/wrap` and `/extend` are for the people the entry names
|
|
162
165
|
by id — not everyone `"*"` lets talk — and anyone else is told so.
|
|
@@ -170,10 +173,8 @@ A group can let its spore hear what is said there that is not to it:
|
|
|
170
173
|
What the people it lists say in the group then reaches the spore as overheard: no turn starts for
|
|
171
174
|
it and no answer is owed, and the next turn the spore runs reads it as what was said around it, the
|
|
172
175
|
latest 100 messages at a time. It is everything they say there, kept in the spore's records and
|
|
173
|
-
read by its next turn, so choose it for a group whose talk the spore should follow.
|
|
174
|
-
bot
|
|
175
|
-
bot added to the group again — or as an admin of the group; with neither, the service says so for
|
|
176
|
-
each group that overhears when it starts.
|
|
176
|
+
read by its next turn, so choose it for a group whose talk the spore should follow. It needs the
|
|
177
|
+
bot's privacy mode off, or the bot an admin of the group, as a mention does.
|
|
177
178
|
|
|
178
179
|
## What it keeps
|
|
179
180
|
|
package/package.json
CHANGED
package/src/adapter.js
CHANGED
|
@@ -173,11 +173,12 @@ export function createAdapter ({ telegram, bot, me }) {
|
|
|
173
173
|
return {
|
|
174
174
|
...TELEGRAM,
|
|
175
175
|
|
|
176
|
-
/** Each group
|
|
176
|
+
/** Each group, said when the bot's privacy mode keeps mentions — and what it would overhear — from it. */
|
|
177
177
|
prepare: async (table, log) => {
|
|
178
178
|
if (me.can_read_all_group_messages) return
|
|
179
179
|
for (const [group, { overhear }] of table) {
|
|
180
|
-
if (
|
|
180
|
+
if (Number(group) >= 0) continue
|
|
181
|
+
log(`group ${group}: @${me.username} gets only commands for it and replies to its messages there, no mention${overhear ? ' and nothing to overhear' : ''} — turn its privacy mode off with /setprivacy in @BotFather and add it to the group again, or make it an admin of the group`)
|
|
181
182
|
}
|
|
182
183
|
},
|
|
183
184
|
|