Login-bot - ERROR: BOT_DOMAIN_INVALID - Login to the site via bot (telegraf)

See original GitHub issue

Hi, I’d like to use a bot to login for my site

  1. Request phone number
  2. Register via API
  3. Get user Token
  4. Login via login button

this code

Markup.loginButton('Login', 'http://localhost:3000', {
    bot_username: 'my_bot',
    request_write_access: 'true'

returns error:

Error: 400: Bad Request: can't parse inline keyboard button: Field "request_wr
ite_access" must be of type Boolean

this code

Markup.loginButton('Login', 'http://localhost:3000', {
    bot_username: 'my_bot',
    request_write_access: true

returns error:

Error: 400: Bad Request: wrong HTTP URL

though http://localhost:3000 is available in my localhost

what means options: { bot_username: ‘my_bot’, request_write_access: true } query params or headers?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
baurcommented, Nov 8, 2019

Now I’m set real domain

Markup.loginButton('Login', 'http://global_available_ip:3000', {
    bot_username: 'my_bot',
    request_write_access: true
  }),

node -v v12.8.1 npm -v 6.10.2

, but get next error:

C:\baur\node\node-bot>node bot.js

  Error: 400: Bad Request: BOT_DOMAIN_INVALID
      at C:\baur\node\node-bot\node_modules\telegraf\core\network\client.js:281:
17
      at processTicksAndRejections (internal/process/task_queues.js:85:5)
      at async Promise.all (index 0)

Failed to process updates. TelegramError: 400: Bad Request: BOT_DOMAIN_INVALID
    at C:\baur\node\node-bot\node_modules\telegraf\core\network\client.js:281:17

    at processTicksAndRejections (internal/process/task_queues.js:85:5)
    at async Promise.all (index 0) {
  code: 400,
  response: {
    ok: false,
    error_code: 400,
    description: 'Bad Request: BOT_DOMAIN_INVALID'
  },
  description: 'Bad Request: BOT_DOMAIN_INVALID',
  parameters: {},
  on: {
    method: 'sendMessage',
    payload: { chat_id: 525933426, text: 'Hello', reply_markup: [Object] }
  }
}
0reactions
baurcommented, Apr 21, 2020

Hi @Fortur, Just applied setdomain in botfather

Read more comments on GitHub >

github_iconTop Results From Across the Web

"Bot domain invalid" error in web telegram login. Django
I've been tinkering with this for a couple of days and just want to share a solution. The solution is simple and pretty...
Read more >
telegraf.js - v4.11.2
Documentation for telegraf.js - v4.11.2. ... To use the Telegram Bot API, you first have to get a bot account by chatting with...
Read more >
Can't login with Telegram with Firefox Preview
The website where I tried to login. If the login is successful, it should return a 404 error blank page with the text...
Read more >
Telegraf: Modern Telegram Bot Framework for Node.js
To use the Telegram Bot API, you first have to get a bot account by chatting with ... By default Telegraf will print...
Read more >
telegraf
Modern Telegram Bot Framework. Latest version: 4.10.0, last published: 11 days ago. Start using telegraf in your project by running `npm i ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found