Replies: 2 comments 11 replies
-
Are there any errors? |
Beta Was this translation helpful? Give feedback.
-
Revisiting the old thread as I found the problem comes again, and it has nothing to do with sending long messages, but merely just sending consecutive messages. I've been trying several days to pinpoint where the problem is, but so far I'm unable to. Here is what I found so far, hope it can ring a bell and get me to the right direction to pinpoint the problem. First of all, sending consecutive messages works perfectly if done directly within the handler function, like the following (the code is written this way (handing command within the bot.on('text', async (ctx) => {
let cmd = ctx.message.text
if (cmd) cmd = cmd.trim()
app.log.silly(app.progprompt, `Got: '${cmd}'`)
if (/\/(start|help) *$/.test(cmd)) {
await ctx.reply('..')
await ctx.reply('...')
//app.log.silly(app.progprompt, `Replying with '${helpCmdStart}'`)
await app.sendTgMessage(ctx, null, helpCmdStart)
//ctx.reply(helpCmdStart)
return
}
if (/\/(other|commands) *$/.test(cmd)) {
. . . It works great. However, it is the following app.log.silly(app.progprompt, 'DEBUG, calling app.sendTgMessage')
await ctx.reply('..')
await ctx.reply('...')
await app.sendTgMessage(ctx, chatID, usage) where only the first reply is sent. (I first suspect it was my Here is what happened when the
I.e., right after the first There is no error. The following Let me stress again that the code I'm porting from is a production code that has been running reliably for several years. It is only when I'm starting to port it to AWS lambda with web-hook and the new telegram client that such problem occurs. If it can ring a bell, please point me to the right direction to pinpoint the problem. Thanks. |
Beta Was this translation helpful? Give feedback.
-
Hi,
How to reply with multiple long messages within single command?
I did two (or more) consecutive
await ctx.replyWithMarkdown()
calls within a single command, and I get only one reply in TG.Maybe it's because my command handling is through a web-hook, but I hope there is a way to send multiple long messages within single command. thx.
Beta Was this translation helpful? Give feedback.
All reactions