Telegram Bots Anyone?

AI-generated summary

In a discussion titled “Telegram Bots Anyone?” under the Feature category, users explore integrating Telegram bots with Discourse. ddigh praises Discourse but highlights the growing role of mobile messaging apps like Telegram, suggesting a plugin that pushes forum topic summaries to Telegram bots — a feature they find more practical than maintaining a dedicated app. david agrees and references a related discussion on a common event system for chatrooms. erlend_sh adds another relevant thread on connecting Telegram bots to Discourse. meglio offers a concrete implementation idea: a Telegram bot that periodically sends welcome messages to new users in a channel. The bot uses the Longman\TelegramBot library, fetches new users via the admin/users/list/new.json API, filters out inactive or privileged users, and sends a randomized welcome message to a specified Telegram channel — avoiding repeats by tracking previously announced users. This example demonstrates a practical, low-maintenance way to bridge Discourse communities with Telegram’s real-time, read-only channel experience.

I like what Discourse represents. I however have also noted the impact of mobile messaging apps. Telegram in this case.

I am not a developer, and neither am I quite well versed on some things, but I know what a good thing looks like. And I think outside of email, someone would take up on a plugin to fetch summaries of interesting forum topics and push to Telegram bots. Someone has implemented that quite well and we use it for Telegram channels, to alert channel members on things they want to stay connected to.

This may perform better than an app IMO. My team decided again’st developing and maintaining an app and a Telegram channel comes in quite handy. I think Discourse on Telegram would be a super awesome thing.

إعجابَين (2)

I agree it would be an awesome feature. There’s some related discussion here:

إعجاب واحد (1)

Also see this:

إعجابَين (2)

Idea for telegram bot — “welcome new users” summary

Here is an idea that you can build on top of.

I developed a simple Telegram bot that will send the list of new users once every few days in our community channel.

Channels are read-only in Telegram, i.e. like a news feed.

The bot will build a random “welcome” text like this:

Welcome our new users user1, user2, user3 and user4

Where user1, 2 etc are usernames of the newly registered users.

The bot keeps track of which users it announced already, so it does not repeat itself.


Implementation:

Use Longman\TelegramBot library.

Fetche new users by issuing a GET request to admin/users/list/new.json.

Filter out non-active users, admins, mods and blocked users.

Sending a message to a Telegram channel is then as simple as:

$telegram = new Telegram(TELEGRAM_BOT_AUTH_TOKEN);
        
$result = Request::sendMessage([
    'chat_id' => TELEGRAM_CHANNEL,
    'text' => $text
]);
3 إعجابات