Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
"highlight.js": "11.12.0",
"lottie-web": "5.13.0",
"markdown-it": "15.0.0",
"mermaid": "11.17.0",
"node-telegram-bot-api": "2.0.0",
"mermaid": "11.17.1",
"node-telegram-bot-api": "2.1.0",
"pinia": "4.0.3",
"quasar": "2.26.0",
"vue": "3.5.41",
Expand Down
28 changes: 14 additions & 14 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 3 additions & 10 deletions server/passerelle/telegram.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
// `guard.ts` n'a rien de nouveau à trancher. Aucun port ne s'ouvre pour ceci.

import { Api, Bot } from 'node-telegram-bot-api'
import type { InlineKeyboardMarkup, InputRichBlock as InputRichBlockLib } from 'node-telegram-bot-api'
import type { InlineKeyboardMarkup } from 'node-telegram-bot-api'
import { MAX_RICHE, type InputRichBlock } from './riche.ts'

/** Ce qu'un message ordinaire accepte. Le riche en prend huit fois plus. */
Expand Down Expand Up @@ -327,10 +327,7 @@ export class Telegram {
await this.api.sendRichMessage({
chat_id: chatId,
rich_message: {
// Même conversion que `brouillon`, et pour la même raison : le
// `RichText` de la bibliothèque n'admet pas la chaîne nue, que l'API
// accepte pourtant — sans quoi aucun titre simple ne serait exprimable.
blocks: [{ type: 'details', summary: titre, blocks: blocs }] as unknown as InputRichBlockLib[],
blocks: [{ type: 'details', summary: titre, blocks: blocs }],
skip_entity_detection: true,
},
})
Expand Down Expand Up @@ -504,11 +501,7 @@ export class Telegram {
chat_id: chatId,
draft_id: draftId,
rich_message: {
// La première des deux corrections de `riche.ts` : le `RichText` de la
// bibliothèque n'admet pas la chaîne nue, que l'API accepte pourtant
// — sans quoi aucun texte simple ne serait exprimable. La conversion
// ne porte que sur ce point-là.
blocks: [{ type: 'thinking', text: texte } as unknown as InputRichBlockLib],
blocks: [{ type: 'thinking', text: texte }],
skip_entity_detection: true,
},
})
Expand Down