我可以将heroku用于必须始终运行的nodejs应用程序吗?现在,我想创建没有webhook的电报bot,它必须一直运行。
const TelegramBot = require('node-telegram-bot-api');
const token = 'MY TELEGRAM BOT KEY';
const bot = new TelegramBot(token, {polling: true});
bot.on('message', (msg) => {
const chatId = msg.chat.id;
// send a message to the chat acknowledging receipt of their message
bot.sendMessage(chatId, 'Received your message');
});
答案 0 :(得分:0)