{"id":15660308,"url":"https://github.com/yusufusta/boting","last_synced_at":"2025-05-05T20:12:12.358Z","repository":{"id":62532183,"uuid":"269634340","full_name":"yusufusta/Boting","owner":"yusufusta","description":"Simple but powerful Telegram Bot library","archived":false,"fork":false,"pushed_at":"2020-08-15T07:58:23.000Z","size":64,"stargazers_count":21,"open_issues_count":0,"forks_count":12,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-05-05T20:12:04.825Z","etag":null,"topics":["async","multithreading","phpasync","telegram","telegram-bot","telegram-bot-api","telegrambot"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yusufusta.png","metadata":{"files":{"readme":"README-tr.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-06-05T12:50:21.000Z","updated_at":"2025-01-23T04:02:29.000Z","dependencies_parsed_at":"2022-11-02T15:00:19.255Z","dependency_job_id":null,"html_url":"https://github.com/yusufusta/Boting","commit_stats":null,"previous_names":["quiec/boting"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yusufusta%2FBoting","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yusufusta%2FBoting/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yusufusta%2FBoting/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yusufusta%2FBoting/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yusufusta","download_url":"https://codeload.github.com/yusufusta/Boting/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252569646,"owners_count":21769517,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["async","multithreading","phpasync","telegram","telegram-bot","telegram-bot-api","telegrambot"],"created_at":"2024-10-03T13:20:59.775Z","updated_at":"2025-05-05T20:12:12.341Z","avatar_url":"https://github.com/yusufusta.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Boting\n\u003e Basit ama güçlü.\n\n[🇹🇷 Türkçe](https://github.com/Quiec/Boting/blob/master/README-tr.md) | [🇬🇧 English](https://github.com/Quiec/Boting/blob/master/README.md)\n\n![](https://img.shields.io/packagist/dt/quiec/boting) ![](https://img.shields.io/packagist/l/quiec/boting) ![](https://img.shields.io/packagist/php-v/quiec/boting) ![](https://img.shields.io/packagist/v/quiec/boting)\n\n\n_Boting_, PHP ile hızlı ve asenkron bot yazmanız için en iyi Telegram Bot kütüphanesi.\n\n## Özellikleri\n* %100 Async (😳)\n* Her zaman son BotApi'ye uygun\n* Tek dosya, küçük boyut, kurması basit.\n* Dosya indirme/yükleme\n* Olaylar\n* WebHook \u0026 GetUpdates desteği \n\n## Gereksinimler\nEğer [Guzzle](http://docs.guzzlephp.org/en/stable/overview.html#requirements) yükleyebiliyorsanız rahatlıkla kullanabilirsiniz.\n\n## Yükleme\nEğer [Composer](https://getcomposer.org/download/)'e sahipseniz, çok kolay kurabilirsiniz:\n\n``` sh\ncomposer require quiec/boting\n```\n\nBeta sürümünü kullanmak isterseniz:\n\n``` sh\ncomposer require quiec/boting:dev-master\n```\n\nEğer Composer yüklü değilse, [bu adresten](https://getcomposer.org/download/) kolaylıkla yükleyebilirsiniz.\n\n## Update Alma\nİki yol ile ile Update alabilirsiniz;\n\n### Webhook\nWebhook yöntemi ile Update'leri alacak iseniz handler'e \"true\" eklemeniz yeterli.\n\n```php\n...\n$Bot-\u003eHandler(\"Token\", true);\n```\n### Get Updates\nDefault olarak bu yöntem kullanılmaktadır. Ekstradan bir şey eklemenize gerek yoktur.\n```php\n...\n$Bot-\u003eHandler(\"Token\");\n```\n\n\n## Olaylar\nBoting 2.0 eklenen yeni özellikle artık kolaylık komut ekleyebilir, `on` ile mesaj türlerini yakalayabilirsiniz.\n### $bot-\u003ecommand\nKomut, **mutlaka regex olmalıdır.**\n\n**Örnek** (_/start komutunu yakalayalım_):\n\n```php\n$Bot-\u003ecommand(\"/\\/start/m\", function ($Update, $Match) use ($Bot) {\n    $ChatId = $Update[\"message\"][\"chat\"][\"id\"]; \n    $Bot-\u003esendMessage([\"chat_id\" =\u003e $ChatId, \"text\" =\u003e \"Started bot.\"]);\n});\n```\n**Başka komut handler'i ekleyelim:**\n```php\n$Bot-\u003ecommand(\"/[!.\\/]start/m\", function ($Update, $Match) use ($Bot) {\n    $ChatId = $Update[\"message\"][\"chat\"][\"id\"]; \n    $Bot-\u003esendMessage([\"chat_id\" =\u003e $ChatId, \"text\" =\u003e \"Started bot.\"]);\n});\n```\nBot artık `/start, !start, .start` komutlarına da yanıt verecektir.\n\n### $bot-\u003eon\nBot belirtilen türden bir mesaj gelirse fonksiyonu çalıştıracaktır.\n\n**On'da match kullanılmamaktadır.**\n\n**Örnek** (_fotoğraf gelirse_):\n```php\n$Bot-\u003eon(\"photo\", function ($Update) use ($Bot) {\n    $ChatId = $Update[\"message\"][\"chat\"][\"id\"]; \n    $Bot-\u003esendMessage([\"chat_id\" =\u003e $ChatId, \"text\" =\u003e \"Fotoğraf geldi\"]);\n});\n```\nOn Türlerine [buradan](https://core.telegram.org/bots/api#message) bakabilirsiniz.\n\n### $bot-\u003eanswer\n`inline_query` veya `callback_query` yanıt vermek için answer fonksiyonunu kullanabilirsiniz.\n\n**Örnek** (_Inline yanıt verelim_):\n```php\n$Bot-\u003eanswer(\"inline_query\", function ($Update) use ($Bot) {\n    $Bir = [\"type\" =\u003e \"article\", \"id\" =\u003e 0, \"title\" =\u003e \"test\", \"input_message_content\" =\u003e [\"message_text\" =\u003e \"This bot created by Boting...\"]];\n    $Bot-\u003eanswerInlineQuery([\"inline_query_id\" =\u003e $Update[\"inline_query\"][\"id\"], \"results\" =\u003e json_encode([$Bir])]);    \n});\n```\n\n### Özel Events\nHazır fonksiyonları kullanmak istemiyorsanız, kendi fonksiyonunuzu tanımlayabilirsiniz.\n```php\n$Main = function ($Update) {...};\n$Bot-\u003eHandler(\"Token\", $Main);\n```\n\n❗️Webhook kullanacaksanız `true`, GetUpdates ile alacaksanız `false` yazın.\n**Örnek** (_/start mesajına karşılık veren bir fonksiyon_):\n```php\n\u003c?php\nrequire __DIR__ . '/vendor/autoload.php'; //We include the base of the bot.\nuse Boting\\Boting; // We say we want to use the base.\n\n$Bot = new Boting(); // We start the base.\n$Main = function ($Update) use ($Bot) { // We create a function called Main.\n    if (!empty($Update[\"message\"])) { // We check if a message has arrived.\n        $Mesaj = $Update[\"message\"][\"text\"]; // We throw the message into the variable.\n        $ChatId = $Update[\"message\"][\"chat\"][\"id\"]; // We get the chat id to send messages.\n\n        if ($Mesaj === \"/start\") { // We check if the message is start.\n            $Bot-\u003esendMessage([\"chat_id\" =\u003e $ChatId, \"text\" =\u003e \"Bot'u başlattınız.\"]); // We use the sendMessage function.\n        }\n    }\n};\n$Bot-\u003eHandler(\"Here ur bot token\", false, $Main); // We define our bot token and function.\n```\n\nDaha fazla örnek için [bu dosyaya](https://github.com/Quiec/Boting/blob/master/example.php) bir göz atın.\n\n## Komut Çağırma\nKomutlar [BotAPI](https://core.telegram.org/bots/api) komutları ile aynı. BotAPI komutları aynı şekilde kullanabilirsiniz.\nÖrnek verelim mesaj göndermek istediniz, [BotAPI](https://core.telegram.org/bots/api#sendmessage)'den gerekli parametrelere bakıyoruz.\n\n\u003cimg src=\"https://i.hizliresim.com/CVaBQE.png\" width=600 height=300\u003e\n\nBize `chat_id` ve `text` lazım. O zaman kodumuzu yazalım.\n\n```php\n$Bot-\u003esendMessage([\"chat_id\" =\u003e \"@fusuf\", \"text\" =\u003e \"Merhaba\"]);\n```\n\nBu kadar.\n\n## Örnekler\nKütüphanenin kullanımı hakkında çok iyi bir örnek olarak [bu dosyayı](https://github.com/Quiec/Boting/blob/master/example.php) gösterebiliriz.\nAyrıca basit bir `/start` mesajına yanıt veren bir kod:\n\n```php\n\u003c?php\nrequire __DIR__ . '/vendor/autoload.php'; //We include the base of the bot.\nuse Boting\\Boting; // We say we want to use the base.\n\n$Bot = new Boting(); // We start the base.\n$Bot-\u003ecommand(\"/[!.\\/]start/m\", function ($Update, $Match) use ($Bot) {\n    $ChatId = $Update[\"message\"][\"chat\"][\"id\"]; \n    $Bot-\u003esendMessage([\"chat_id\" =\u003e $ChatId, \"text\" =\u003e \"Started bot.\"]);\n});\n$Bot-\u003eHandler(\"Here ur bot token\"); // We define our bot token.\n```\n\n## Lisans\nBu proje tamamen açık kaynaklı olup, MIT lisansı altında korunmaktadır. Lütfen LICENSE.md dosyasına bakın.\n\n## İletişim\nBana [Telegram](https://t.me/fusuf) üzerinden ulaşabilirsiniz ya da Issue açabilirsiniz.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyusufusta%2Fboting","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyusufusta%2Fboting","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyusufusta%2Fboting/lists"}