# Telegram

## 👀 Hızlı Bakış

* Whatapp alternatifi mesajlaşma uygulamasıdır, grup üye sayısı sınırsızdır
* Açık kaynak bir uygulama olduğundan yazılımlar ile erişebilen bir API hizmeti sunar
* API üzerinden kişisel botlar oluşturabilir ve kendi iş akışınızı geliştirebilirsiniz

{% hint style="info" %}
👨‍💻 Programlama işleri ile ilgilenenler için telegram ideal bir chat uygulamasıdır.
{% endhint %}

## 🤖 Bot Oluşturma

* Telegram üzerinden [BotFather](https://telegram.me/botfather) kanalına mesaj atmalısın
* `/newbot` komutu ile bot oluşturma isteğinde bulun
* İlk önce botun için isim oluştur, bu isim **türkçe karakter içerebilir ve uzun olabili**r
* Ardından botun için **eşsiz** bir kullanıcı adı belirlemen gerekir
* Bot oluşturulduktan sonra sana **token** bilgisi verilecek bu bilgiyi kopyalamalı ve saklamalısın
* Botuna erişmek için `t.me/<botkullanıcı_adı>` bağlantısına bakmalısın

## 🆔 Bot için Chat ID Alma

* Chat ID, botunuza her mesaj atan kullanıcının id bilgisidir
* Chat ID ile istediğiniz kullanıcıya mesaj gönderebilirsiniz
* Chat ID değerini almak için .<https://api.telegram.org/botXXX:YYYY/getUpdates> bağlantısındaki
  * XXX:YYYY alanına daha önceden kopyaladığınız token bilginizi yapıştırın
  * Örneğin: `https://api.telegram.org/bot12345:TOKEN_DEVAMI/getUpdates`
* Döndürülen JSON metninde `id:` alanı içerisinde Chat ID bilgisini alabilirsiniz

{% code title="Örnek JSON çıktısı" %}

```javascript
{
    "ok": true,
    "result": [
        {
            "update_id": 0,
            "message": {
                "message_id": 0,
                "from": {
                    "id": 0,
                    "is_bot": false,
                    "first_name": "",
                    "last_name": "",
                    "language_code": ""
                },
                "chat": {
                    "id": 0,
                    "first_name": "",
                    "last_name": "",
                    "type": ""
                },
                "date": 0,
                "text": ""
            }
        }
    ]
}
```

{% endcode %}

## 🔗 Harici Bağlantılar

* [5dk'da Telegram Bot'u Oluşturma](https://medium.com/@fatihsarhan/5-dk-da-telegram-botu-nasil-yapilir-1873f18bf59b)
* [Telegram Bot API](https://core.telegram.org/bots/api#formatting-options)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.yemreak.com/arsiv/uygulamalar/telegram.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
