Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How disable old webHook? #458

Closed
cawa-93 opened this issue Nov 9, 2017 · 2 comments
Closed

How disable old webHook? #458

cawa-93 opened this issue Nov 9, 2017 · 2 comments
Labels

Comments

@cawa-93
Copy link

cawa-93 commented Nov 9, 2017

First I ran the first bot. He worked. Then I changed the token and launched the second bot.
The second bot works fine. But the problem is that the server constantly accepts POST requests for the first bot and returns 401. How can I fix this? How to disable incoming messages from the telegram server from the first bot?

2017-11-09T12:27:28.564017+00:00 heroku[router]: at=info method=POST path="/bot<FIRST_TOKEN>" host=vast-temple-51936.herokuapp.com request_id=f4ff001c-501b-42a2-9794-df191ed8f467 fwd="149.154.167.231" dyno=web.1 connect=0ms service=1ms status=401 bytes=104 protocol=https

I disable dino. And get this 501 error:

2017-11-09T12:32:28.992496+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=POST path="/bot<FIRST_TOKEN>" host=vast-temple-51936.herokuapp.com request_id=46b26d20-060d-443f-a81e-05b781c62b44 fwd="149.154.167.231" dyno= connect= service= status=503 bytes= protocol=https

How stop webhook?

@cawa-93
Copy link
Author

cawa-93 commented Nov 9, 2017

I need to manually run TelegramBot.deleteWebHook() on exit?

process.on('exit', () => TelegramBot.deleteWebHook());

@yagop
Copy link
Owner

yagop commented Nov 20, 2017

When you setup a webhook, Telegram stores your URL. In order to disable the webhook you must call deleteWebHook.

Calling that on exit is a perfect solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants