Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
180 views
in Technique[技术] by (71.8m points)

node.js - Firebase logging only first log

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.

Firebase function logs

What am I doing wrong?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...