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 when handling updates sent by bot without username #772

Closed
InsanusMokrassar opened this issue Jun 30, 2023 · 0 comments
Closed

Error when handling updates sent by bot without username #772

InsanusMokrassar opened this issue Jun 30, 2023 · 0 comments
Assignees

Comments

@InsanusMokrassar
Copy link
Owner

этот аккаунт работае сломанно в ботапи:

  1. При пересылке в бота выдаёт такое:
{
 "update_id": 934677351,
 "message": {
  "message_id": 1423862,
  "from": {
   "id": 478620023,
   "is_bot": false,
   "first_name": "Aλex",
   "last_name": "Sokol",
   "username": "y9san9",
   "language_code": "en",
   "is_premium": true
  },
  "chat": {
   "id": 478620023,
   "first_name": "Aλex",
   "last_name": "Sokol",
   "username": "y9san9",
   "type": "private"
  },
  "date": 1688108304,
  "forward_from": {
   "id": 470000,
   "is_bot": true,
   "first_name": "Volunteer Support"
  },
  "forward_date": 1677619431,
  "text": "Приветствуем! К сожалению, мы не владеем такой информацией, но большое спасибо за ваши пожелания!"
 }
}
  1. При получении через getChat выдает type: "private"
{
    "ok": true,
    "result": {
        "id": 470000,
        "first_name": "Volunteer Support",
        "type": "private",
        "photo": {
            "small_file_id": "AQADAQADk6gxG_ArBwAJAgAD8CsHAAUS2GoOtaUDdS8E",
            "small_file_unique_id": "AQADk6gxG_ArBwAC",
            "big_file_id": "AQADAQADk6gxG_ArBwAJAwAD8CsHAAUS2GoOtaUDdS8E",
            "big_file_unique_id": "AQADk6gxG_ArBwABAQ"
        }
    }
}

С одной стороны is_bot: true, с другой стороны type: "private". Это в моём боте выдаёт краш, т.к. если is_bot: true, то ожидается юзернейм, а у этого "бота" юзернейма нет

@InsanusMokrassar InsanusMokrassar self-assigned this Jun 30, 2023
@InsanusMokrassar InsanusMokrassar linked a pull request Jun 30, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant