* Public method: send a message to a specific Telegram chat. * channelId format: telegram-
(channelId: string, text: string)
| 84 | * channelId format: telegram-<chatId> |
| 85 | */ |
| 86 | async sendMessage(channelId: string, text: string): Promise<void> { |
| 87 | if (!this.bot) throw new Error("[Telegram] Bot not initialized"); |
| 88 | const chatId = Number(channelId.replace("telegram-", "")); |
| 89 | if (isNaN(chatId)) { |
| 90 | throw new Error(`[Telegram] Invalid channelId: ${channelId}`); |
| 91 | } |
| 92 | await this.sendLongMessage(chatId, text); |
| 93 | } |
| 94 | |
| 95 | // ------------------------------------------------------------------------- |
| 96 | // Message handler |
nothing calls this directly
no test coverage detected