3

I have created several Telegram bots. They work for my account and also on several other accounts that I have tested with.

But I get reports from several users saying the bots never respond.

It there some user setting that would prevent an account from getting messages from bots? Or any other idea why it would not work for some accounts?

The Vee
  • 11,420
  • 5
  • 27
  • 60
James
  • 17,965
  • 11
  • 91
  • 146

2 Answers2

1

Okay, found the issue, it was pebcak.

This issue was it was failing for users that had no last name set in their account because our code was accessing the last_name from the json data.

So make sure your code does not rely on a first or last name.

James
  • 17,965
  • 11
  • 91
  • 146
  • Doesn't sound like a pebcak.. Considering the code failed to consider the possibility that users may not have set the last_name. – Hrishikesh Apr 13 '23 at 13:21
0

But I get reports from several users saying the bots never respond.

This is very unusable information. In default all users are equal for the bot usage and no difference between any users if you don't implement it programmatically. But if they says so then try send the POST query to those users in Postman for example and take a look in response. After this it must be clear what kind of problem there.

An example of POST:

https://api.telegram.org/bot{your_bot_token}/sendMessage?chat_id={user_chat_id}&text=test

Note that chat_id those users required.

anatol
  • 1,680
  • 2
  • 24
  • 47