I've been trying to work with firebase and Telegram bot API. Just as everywhere - I have to debug, but at the moment when I deploy my webhooks with logs - they are just being ignored.
Here is the code that I'm trying to invoke:
import * as functions from 'firebase-functions';
app.post('/', async (req, res) => {
const isTelegramMessage =
req.body
&& req.body.message
&& req.body.message.chat
&& req.body.message.chat.id
&& req.body.message.from
&& req.body.message.from.first_name
if (isTelegramMessage) {
const chat_id = req.body.message.chat.id
const isUpdate = !!req.body.update_id
const defaultSendMessageOptions = sendMessageDefaultOptionsFactory(chat_id);
functions.logger.log(req.body);
functions.logger.log([isUpdate]);
functions.logger.debug([isUpdate]);
}
The other code is skipped, but I'm 100% sure that it goes as a Telegram message.
At the moment, my firebase console logs something (I believe it's req.body), but not other requests.
What am I doing wrong?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…