He creado un bot usando Telegraf. Quiero que cuando un usuario envíe un mensaje, el bot le envíe el mensaje anterior. Así que quiero tomar la publicación anterior en id con Gram JS pero arroja este error
aquí está mi código:
bot.on("message", async (ctx) => { const { text, message_id } = ctx.message; const userId = ctx.from.id; const replyToMessage = await client.invoke( new Api.channels.GetMessages({ channel: `${ctx.chat.id}`, id: [message_id - 1], }) ); console.log(1234, replyToMessage); ctx.reply(replyToMessage); });