Has anyone figured out how to properly send periodic messages

to a group with topics?

Imagine your bot sends periodic messages, therefore not generated by any update containing thread_message_id, to a group (e.g to send the leaderboard of the most active members of the group), how would you send that message?

Even if you save thread_message_id from a previous update, that topic could be closed and by bot api you have no methods to get a list of available topics (and therefore send the message to one of the available topics)

5 ответов

13 просмотров

If the topic gets closed, you receive an update, and you can act accordingly. If a topic gets deleted while the bot is offline, sendMessage will return a TOPIC_DELETED error (403)

Mr Robot- Автор вопроса
davide. φ
If the topic gets closed, you receive an update, a...

Yes, but then you don’t get a topic where your bot can write. Imagine like: - "Use this command to set where you want that the bots send notification" *Topic gets deleted* How to inform group members that the bot can’t send messages to the previously selected topic (and therefore they should select a new topic) if the bot doesn’t have a list of available topics?

I think you can use the topic_id=0

Mr Robot- Автор вопроса
davide. φ
I think you can use the topic_id=0

Interesting, I will check this, thanks

Mr Robot- Автор вопроса
davide. φ
I think you can use the topic_id=0

Checked, it must contain an existing message_thread_id or an existing reply_to_message_id, otherwise it returns Bad Request: TOPIC_DELETED"

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

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

На работе пишем распределенное приложение, у которого сотни, если не тысячи настроек. Конфиги написаны на xml, расположены на разных хостах и должны быть согласованы друг с др...
Aleksandr Druzhinin
5
В общем. если я беру Ди при всех его проблемах, у меня возникает первая реальная задача. Сохранения к игре, гибкие сохранения. У нас нет легкого nosql хранилища, которое можно...
Vi
1
Мне интересно, скорее людей здесь используют D, Rust, C/C++ для решения реальных прикладных задач за деньги?)
Evil Satanson
49
что будем сегодня хвалить?
Neko Dark Nightwolfdarkanronpa
3
Всем привет, у меня вопрос, для чего юзают D?
Sir Jiga
3
А библиотеку на D как-то можно в C/C++ использовать?
Степан
5
Я правильно понимаю что партишены раскидываются по брокерам для отзазоустойчивости и только одна партиция всегда ведущая. Остальные фоловеры?
Dmitry Bubnenkov
3
а динамически увеличивать стек нельзя? а ну хотя да, откуда ты узнаешь что стек кончился...
Neko Dark Nightwolfdarkanronpa
2
Что по дедлайну? Я бы хотел попробовать, но у меня опыта мало..
Евгений
1
хотя... яб скорее просто бы написал себе тренажёр слепой печати, стырив идеи с существующих, а потом всем бы хвастался, мол, вот вы на чем учились печатать? воот... а я себе с...
Constantin F.
5
Карта сайта