МШ
Size: a a a
МШ
M
E
const WEBHOOK_URL = 'https://1.test.ru';
const PORT = process.env.PORT || 3000;
const SECRET_PATH = '/__tgbot';
JB
const WEBHOOK_URL = 'https://1.test.ru';
const PORT = process.env.PORT || 3000;
const SECRET_PATH = '/__tgbot';
E
JB
E
const WEBHOOK_URL = 'https://1.test.ru';
const PORT = process.env.PORT || 3000;
const SECRET_PATH = '/__tgbot';
bot.telegram.setWebhook(WEBHOOK_URL).then(() => {
console.log('Webhook is set on', WEBHOOK_URL)
})
E
I
mkdir xyinoku && cd xyinoku'use strict';
touch index.js
touch .gitignore
echo "node_modules" > .gitignore
touch Procfile
echo "web: node index.js" > Procfile
npm init
npm i telegraf
/bot${API_TOKEN}
;git init
git config --local user.name xyinoku
git config --local user.email xyinoku@cum.com
heroku apps:create xyinoku
heroku git:remote -a xyinoku
heroku config:set API_TOKEN=114232126:AAHDgUIj-kEM6YzmHuV4Aa7yCRHavtouXnw BASE_URL=https://xyinoku.herokuapp.com/ -a xyinoku
git add .
git commit -m "first blood"
git push heroku master
P.S. Чтобы продолжить разрабатывать в поллинг режиме, нужно удалить вебхук. new Telegram(API_TOKEN).deleteWebhook().then(console.log)
или вручную 'https://api.telegram.org/bot114232126:AAHDgUIj-kEM6YzmHuV4Aa7yCRHavtouXnw/deleteWebhook
'.E
I
JB
JD
i
I
V
NN
VK
VK