# Telegram Bots Anyone?

**URL:** <https://meta.discourse.org/t/telegram-bots-anyone/60216>\
**Category:** Feature\
**Created:** [Mars 31, 2017, 5:49 UTC](https://meta.discourse.org/t/telegram-bots-anyone/60216 "2017-03-31T05:49:55Z")\
**Posts on this page:** 1\
**Showing post:** 4

<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:** [Mai 22, 2017, 3: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
]);

```

---

_[View the full topic](https://meta.discourse.org/t/telegram-bots-anyone/60216)._
