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

error handling when /eita is invoked from a private chat #18

Open
armand1m opened this issue Aug 29, 2022 · 0 comments
Open

error handling when /eita is invoked from a private chat #18

armand1m opened this issue Aug 29, 2022 · 0 comments
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@armand1m
Copy link
Owner

Describe the bug

When someone invoked the /eita command in a private conversation, the bot instance errors with a 400 and the instance gets terminated.

Unhandled error while processing {
  update_id: 3627372363,
  message: {
    message_id: 8383,
    from: {
      id: 12312312312,
      is_bot: false,
      first_name: 'xxx',
      last_name: '.',
      username: 'yyy',
      language_code: 'en'
    },
    chat: {
      id: 11111222222,
      first_name: 'xxx',
      last_name: '.',
      username: 'yyy',
      type: 'private'
    },
    date: 1661782466,
    text: '/eita',
    entities: [ [Object] ]
  }
}
/app/node_modules/telegraf/lib/core/network/client.js:258
            throw new error_1.default(data, { method, payload });
                  ^

TelegramError: 400: Bad Request: there are no administrators in the private chat
    at Telegram.callApi (/app/node_modules/telegraf/lib/core/network/client.js:258:19)
    at processTicksAndRejections (node:internal/process/task_queues:96:5) {
  response: {
    ok: false,
    error_code: 400,
    description: 'Bad Request: there are no administrators in the private chat'
  },
  on: { method: 'getChatAdministrators', payload: { chat_id: 1284516730 } }
}

To Reproduce
Steps to reproduce the behavior:

  1. Open a private chat with a gringobot instance
  2. Invoke /eita
  3. Check instance logs

Expected behavior
The server should know how to handle specific commands based on the chat type. If it's private, some commands should be disabled.

@armand1m armand1m added bug Something isn't working good first issue Good for newcomers labels Aug 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant