# Telegram Bots Anyone?

**URL:** https://meta.discourse.org/t/telegram-bots-anyone/60216
**Category:** Feature
**Created:** [2017年三月31日 05:49 UTC](https://meta.discourse.org/t/telegram-bots-anyone/60216 "2017-03-31T05:49:55Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![ddigh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ddigh/32/64136_2.png) [@ddigh](https://meta.discourse.org/u/ddigh)
#### Post date: [2017年三月31日 05:49 UTC](https://meta.discourse.org/t/telegram-bots-anyone/60216/1 "2017-03-31T05:49:55Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [2017年三月31日 08:48 UTC](https://meta.discourse.org/t/telegram-bots-anyone/60216/2 "2017-03-31T08:48:10Z")

</div>

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

> [@Common event system for chatrooms - a specification](https://meta.discourse.org/t/common-event-system-for-chatrooms-a-specification/59245):
>
> One of the GSOC ideas on GitHub is creating a “[Common Event System for Chatrooms](https://github.com/discourse/discourse/wiki/Summer-of-Code-2017-Ideas-List#common-event-system-for-chatrooms)” I like the sound of this idea, so this is an attempt at a more comprehensive description of how it could be implemented. Hopefully this will give a starting point for some discussion about what people would like to get out of a feature like this. Edit 17/03/2017: I've added and removed some stuff based on comments below. What we already have [https://meta.discourse.org/t/the-official-discourse-slack-plugin/5141…](https://meta.discourse.org/t/the-official-discourse-slack-plugin/51412)

---

<div class="post-metadata">

### Author: ![erlend\_sh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/erlend_sh/32/119475_2.png) [@erlend\_sh](https://meta.discourse.org/u/erlend_sh)
#### Post date: [2017年四月1日 21:31 UTC](https://meta.discourse.org/t/telegram-bots-anyone/60216/3 "2017-04-01T21:31:07Z")

</div>

Also see this:

> [@Connecting telegram bot to discourse](https://meta.discourse.org/t/connecting-telegram-bot-to-discourse/55962):
>
> I have written a telegram bot : @padporsbot In our country telegram messenger is using the most. We have a discourse [website](http://padpors.com).So we created a bot with following features: You can sign up in website without even opening website even if you aren’t our website user, your content will send to website and you will receive your likes for your content as score after signing up in website. all of your content created before signing up will be yours. you won’t lose any previous content. crea…

---

<div class="post-metadata">

### Author: ![meglio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/meglio/32/71444_2.png) [@meglio](https://meta.discourse.org/u/meglio)
#### Post date: [2017年五月22日 15:54 UTC](https://meta.discourse.org/t/telegram-bots-anyone/60216/4 "2017-05-22T15:54:42Z")

</div>

# 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:

```php
$telegram = new Telegram(TELEGRAM_BOT_AUTH_TOKEN);
        
$result = Request::sendMessage([
    'chat_id' => TELEGRAM_CHANNEL,
    'text' => $text
]);

```
