Request for not found token : `bot_token`
See original GitHub issueFirst, I should thank you for your great app. In polling mode on my local machine the module works like charm. However when I use the web hook mode, sometimes I get the
Request for not found token : bot_token
error and no response is given by the bot. I didn’t setup the cert file in my settings.py . I am using nginx with combination of gunicorn to serve my web app. The server os is ubuntu 16.04. Below is the settings I’ve used:
DJANGO_TELEGRAMBOT = {
'MODE' : 'WEBHOOK', #(Optional [str]) # The default value is WEBHOOK,
# otherwise you may use 'POLLING'
# NB: if use polling you must provide to run
# a management command that starts a worker
'WEBHOOK_SITE' : 'https://www.shipup.ir',
'WEBHOOK_PREFIX' : '/telegram-bot/', # (Optional[str]) # If this value is specified,
# a prefix is added to webhook url
# 'WEBHOOK_CERTIFICATE' : '', # If your site use self-signed
#certificate, must be set with location of your public key
#certificate.(More info at https://core.telegram.org/bots/self-signed )
'BOTS' : [
{
'TOKEN': 'bot_token', #Your bot token.
},
],
}
The thing that intrigues is the point that sometimes my bot works. Any advice to solve the issue is appreciated.
Issue Analytics
- State:
- Created 6 years ago
- Comments:11 (3 by maintainers)
Top Results From Across the Web
python - Discord.py - Bot token failing - Stack Overflow
The problem is you haven't enabled some permissions in the developer portal, not because of the TOKEN. First you go to the dev...
Read more >How to Get a Discord Bot Token - WriteBots
If you already have a bot created, click it in the list. If you don't have any discord bots, click the “New Application”...
Read more >Telegram Bot Token | GitGuardian documentation
Summary: Telegram is a messaging app. This detectors aims at catching tokens used by bots to authenticate requests. IPs allowlist: This feature is...
Read more >Why can't I copy my bot's token? - Developers - Discord
TL;DR If you are not seeing the Copy button located in your bot settings to copy your bot's token, this means the token...
Read more >Create and regenerate API tokens - Slack
Scroll to find the workspace and user that you'd like to re-issue a token for. Click Re-issue token. (You may see Request token...
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
@JungDev @mrabedini Ok, that’s what i found
This error is mainly caused by TelegramError (Flood control), which is caused by rapid setWebhook queries. Perhaps,
if bot.getWebhookInfo().url != hookurl: <set webhook>
check will help.I found the problem. In gunicorn the number of workers were set to 3. Just one of them could have bot_tokens and two of them didn’t have the tokens. When I set the number of workers to 1, everything is ok. Now the question is what should I do to get it to work with number of workers 3 in gunicorn.