Telegram Bot - how to get a group chat id?

后端 未结 12 1113
北海茫月
北海茫月 2020-11-30 16:42

I\'ve been using telegram_bot, and trying to get groupChat id to send notifications to group chat, but don\'t know which methods I have to use for it.

For getting ch

12条回答
  •  谎友^
    谎友^ (楼主)
    2020-11-30 17:34

    function doPost(e) {
        var contents = JSON.parse(e.postData.contents);
        //  GmailApp.sendEmail(Session.getEffectiveUser().getEmail(), "Telegram Bot Update",     JSON.stringify(contents, null, 4));
        var chat_id = contents.message.chat.id;
        var text = contents.message.text;
        var name = contents.message.from.first_name + " " +  contents.message.from.last_name;
        var sResponse = telegramBotMachine( chat_id, text, name );
    }
    

提交回复
热议问题