Can I check if the bot can send a message

to a particular chat_id, WITHOUT sending that message?

4 ответов

6 просмотров

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.

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

Обсуждают сегодня

А можно не обсуждать тут V?
Darkanronpa Goodbye Despair
18
Вот зачем писать о том, чего ты не знаешь? Стохастический это и есть вероятностный. И в этом и проблема, что один и тот алгоритм на одних и тех же данных выдает разный результ...
Aleksandr Druzhinin
37
Какая бы группа загнулась? Этот канал о Ди. Хотите поговорить о го/зиге/расте - добро пожаловать на каналы этих языков. Тут про Ди не говорят практически. Загнулась бы группа ...
Aleksandr Druzhinin
10
Кстате вопрос. Насколько я помню, был пост. Что в D nogc имеет накладные расходы. При работе с GC. Правда, нет? Разобраться толком времени не хватило.
Vi
3
Уолтер в коммунити zig-а суету наводит: https://news.ycombinator.com/item?id=41015588 С одной стороны, конешн, пиарится, с другой стороны, коркоманде и тому же Kelley, который...
Constantin F.
26
Warning Failed to apply the selected architecture x86_64-pc-windows-msvc. Got ["x86"]. Error Unsupported architecture: x86_64-pc-windows-msvc кто-нибудь знает, что с ldc2? вот...
quantumde1 Зубенко
3
@wintttr gdc, ldc2, dmd?
quantumde1 Зубенко
6
Этот V кто делает?
☭Тупо Лучше Император
3
Я кстате только в играх пока ,действительно вижу проблему от GC. А у вас какие задачи раз GC не нужен?
Vi
2
появился нормальный вывод зависимостей файла в стиле makefile?
Макс Воробьев
4
Карта сайта