Can I check if the bot can send a message

to a particular chat_id, WITHOUT sending that message?

4 ответов

8 просмотров

It took me 15 minutes to dig both bot and mtproto api. So here is the best solution i was able to find: getChat on a user who blocked a bot won't return his profilepic. This is a bad way to check if you can send a message to a user yet you can try to rely on it in some cases There's also a second idea: using this mtproto method. It should return a chat object, and if it is an instance of chatForbidden you will not be able to send a message That's the best I could find. Sorry :(

Yegor- Автор вопроса
s0m31 🇷🇺
It took me 15 minutes to dig both bot and mtproto ...

Wow, thx for your time. Is there a difference between user blocked a bot and user stopped a bot? Cause stopping + registering the ones who “started” would be sufficient. My best idea was to try sending a message silently + deleting it in case it went through. Should go unnoticed + give the info needed.

s0m31 🇷🇺
It took me 15 minutes to dig both bot and mtproto ...

Use /getChatMember with chat id of bot and check its status.

Похожие вопросы

Карта сайта