@rhizogrip/spore-plugin-telegram 0.6.1 → 0.7.0

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.
Files changed (2) hide show
  1. package/package.json +3 -3
  2. package/src/adapter.js +5 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rhizogrip/spore-plugin-telegram",
3
- "version": "0.6.1",
3
+ "version": "0.7.0",
4
4
  "description": "Telegram for spores: a bot of yours in chats, each chat reaching its spore, run as a service",
5
5
  "author": {
6
6
  "name": "Christophe Le Bars",
@@ -31,13 +31,13 @@
31
31
  "marked": "^18.0.11"
32
32
  },
33
33
  "peerDependencies": {
34
- "@rhizogrip/spore": "^1.19.0"
34
+ "@rhizogrip/spore": "^1.20.0"
35
35
  },
36
36
  "scripts": {
37
37
  "test": "vitest run"
38
38
  },
39
39
  "spore": {
40
- "works": "^1.19.0",
40
+ "works": "^1.20.0",
41
41
  "services": {
42
42
  "telegram": {
43
43
  "what": "a bot of yours in Telegram chats, each chat reaching its spore",
package/src/adapter.js CHANGED
@@ -53,7 +53,7 @@ function routes (raw, path) {
53
53
  if (typeof spore !== 'string' || !spore || (typeof entry === 'object' && entry.details !== undefined && typeof entry.details !== 'boolean')) {
54
54
  throw invalid(path, `maps ${chat} to something that is not a spore`, 'each chat is a chat id against the name of a spore it may reach, or { "spore": "<name>", "details": true, "show": "react" }')
55
55
  }
56
- table.set(chat, { spores: [spore], details: typeof entry === 'object' && entry.details === true, show: typeof entry === 'object' ? entry.show ?? null : null })
56
+ table.set(chat, { spores: [spore], details: typeof entry === 'object' && entry.details === true, show: typeof entry === 'object' ? entry.show ?? null : null, people: null })
57
57
  }
58
58
  return table
59
59
  }
@@ -73,7 +73,8 @@ export const TELEGRAM = {
73
73
  routes,
74
74
  usage: { help: HELP, extend: '/extend wall 30m, /extend cost 1.50 or /extend rounds 20' },
75
75
  limits: { message: 4096, file: 50 * 1024 * 1024, editEveryMs: 2500, typingEveryMs: 4000 },
76
- can: { upload: true, remove: true, react: true, typing: true },
76
+ can: { upload: true, remove: true, react: true, typing: true, reply: true },
77
+ showShared: 'react',
77
78
  reactions: REACTIONS,
78
79
  hint (err, { file, bot }) {
79
80
  if (err.type === 'TELEGRAM_NO_BOT') {
@@ -100,7 +101,8 @@ export function normalize (update, bot) {
100
101
  id: `${bot}:${update.update_id}`,
101
102
  conversation: String(message.chat.id),
102
103
  message: message.message_id,
103
- person: { id: String(message.from.id), name: `${[first, last].filter(Boolean).join(' ')}${username ? ` (@${username})` : ''}`, username },
104
+ person: { id: String(message.from.id), name: `${[first, last].filter(Boolean).join(' ')}${username ? ` (@${username})` : ''}`, username, groups: [] },
105
+ spore: null,
104
106
  where: message.chat.type === 'private' ? 'a private chat on Telegram' : `the Telegram group "${message.chat.title}"`,
105
107
  shared: message.chat.type !== 'private',
106
108
  text,