Hi! Cant run simple webhook bot from your example ((((((
See original GitHub issueContext
On webserver:
- Telegraf.js Version: “telegraf”: “^3.24.0”
- Node.js Version: v9/2/0
- Operating System: Ubuntu 18
And winows local machine fails too:
- Telegraf.js Version: “telegraf”: “^3.24.0”
- Node.js Version: v9/2/0
- Operating System: Win 10 Pro x64
Expected Behavior
Bot listens and answers. I have Centos
Current Behavior
Bot not answers. Not listen (
Steps to Reproduce
This is my code:
const Telegraf = require('telegraf')
const bot = new Telegraf(process.env.BOT_TOKEN || 'xxxxxxx')
bot.command('image', (ctx) => ctx.replyWithPhoto({ url: 'https://picsum.photos/200/300/?random' }))
bot.on('text', ({ replyWithHTML }) => {console.log('Incoming');return replyWithHTML('<b>Hello</b>')})
// Set telegram webhook
// npm install -g localtunnel && lt --port 6000
bot.telegram.setWebhook('https://-----.localtunnel.me/secret-path')
// Start https webhook
bot.startWebhook('/secret-path', null, 6000)
On windows i see next text:
(node:11672) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): FetchError: request to https://api.telegram.org/botxxxxxxxx/setWebhook failed, reason: certificate has expired
Issue Analytics
- State:
- Created 5 years ago
- Comments:31 (11 by maintainers)
Top Results From Across the Web
Intro to Webhooks - Real Time App Automation (Discord Bot ...
Your browser can't play this video. Learn more. Switch camera ... Intro to Webhooks - Real Time App Automation (Discord Bot, Slack, GitHub)....
Read more >Sending messages using Incoming Webhooks - Slack API
Incoming Webhooks are a simple way to post messages from apps into Slack. Creating an Incoming Webhook gives you a unique URL to...
Read more >How to Get Started with Webhooks by Zapier
Create your Zap and configure your webhook URL but don't enable your Zap quite yet! · Go into the triggering app and do...
Read more >Got problems with webhook to Telegram Bot API
It means, that your bot can't react to your text messages, and you will not receive any webhooks! You can note, that "allowed_updates"...
Read more >Setting your Telegram Bot WebHook the easy way
That being said, the quickest and easiest way to set a WebHook for your Bot is to issue a GET request to the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
https://github.com/telegraf/telegraf/issues/524#issuecomment-427011881
When you are trying to use localtunnel, you need to run
lt --port 3000
first Then it generate you your private link, which you should use instead of"https://-----.localtunnel.me"
This will proxy all queries and apply them at 127.0.0.1:3000@eugen35, Nope If you are using Localtunnel, you don’t need to install tls and send cert to the telegram. Because it should provide own valid certificate
But if you run your own web server on white IP address, you can run https server (express, nginx, … or inside
startWebhook
) with your TLS options without using Localtunnel proxy If you don’t have white IP, try to use Polling mode or forward portSecond thing/ When you send selfsinged certificate, you should send content of file, not that file name Mb that thing raise cert expired error, but it is invalid certificate also
It should be looks like
If you are using port forwarding
Notes
NEW! If you’re having any trouble setting up webhooks, please check out this amazing guide to Webhooks .