[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-8441":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":17,"stars30d":18,"stars90d":16,"forks30d":16,"starsTrendScore":18,"compositeScore":19,"rankGlobal":10,"rankLanguage":10,"license":20,"archived":21,"fork":21,"defaultBranch":22,"hasWiki":23,"hasPages":21,"topics":24,"createdAt":10,"pushedAt":10,"updatedAt":33,"readmeContent":34,"aiSummary":35,"trendingCount":16,"starSnapshotCount":16,"syncStatus":36,"lastSyncTime":37,"discoverSource":38},8441,"core","php-telegram-bot\u002Fcore","php-telegram-bot","PHP Telegram Bot based on the official Telegram Bot API","",null,"PHP",4021,958,192,71,0,1,3,63.75,"MIT License",false,"develop",true,[25,26,27,7,28,29,30,31,32],"bot-api","hacktoberfest","php","sdk","sdk-php","telegram","telegram-api","telegram-bot","2026-06-12 04:00:39","\n\u003Ch1 align=\"center\">The development of the project is currently on hold until further notice. We will provide updates as soon as they become available.\u003C\u002Fh1>\n\u003Ch1 align=\"center\">\n    PHP Telegram Bot\u003Cbr>\n\t\u003Cbr>\n    \u003Cimg src=\"https:\u002F\u002Fraw.githubusercontent.com\u002Fphp-telegram-bot\u002Fassets\u002Fmaster\u002Flogo\u002F512px\u002Flogo_plain.png\" title=\"PHP Telegram Bot\" alt=\"PHP Telegram Bot logo\">\n\t\u003Cbr>\n\u003C\u002Fh1>\n\nA Telegram Bot based on the official [Telegram Bot API]\n\n[![API Version](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FBot%20API-7.1%20%28February%202024%29-32a2da.svg)](https:\u002F\u002Fcore.telegram.org\u002Fbots\u002Fapi-changelog#february-16-2024)\n[![Join the bot support group on Telegram](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Ftelegram-@PHP__Telegram__Bot__Support-64659d.svg)](https:\u002F\u002Ftelegram.me\u002FPHP_Telegram_Bot_Support)\n[![Donate](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002F%F0%9F%92%99-Donate%20%2F%20Support%20Us-blue.svg)](#donate)\n\n[![Tests](https:\u002F\u002Fgithub.com\u002Fphp-telegram-bot\u002Fcore\u002Factions\u002Fworkflows\u002Ftests.yaml\u002Fbadge.svg)](https:\u002F\u002Fgithub.com\u002Fphp-telegram-bot\u002Fcore\u002Factions\u002Fworkflows\u002Ftests.yaml)\n[![Code Coverage](https:\u002F\u002Fimg.shields.io\u002Fscrutinizer\u002Fcoverage\u002Fg\u002Fphp-telegram-bot\u002Fcore\u002Fmaster.svg?style=flat)](https:\u002F\u002Fscrutinizer-ci.com\u002Fg\u002Fphp-telegram-bot\u002Fcore\u002F?b=master)\n[![Code Quality](https:\u002F\u002Fimg.shields.io\u002Fscrutinizer\u002Fg\u002Fphp-telegram-bot\u002Fcore\u002Fmaster.svg?style=flat)](https:\u002F\u002Fscrutinizer-ci.com\u002Fg\u002Fphp-telegram-bot\u002Fcore\u002F?b=master)\n[![Latest Stable Version](https:\u002F\u002Fimg.shields.io\u002Fpackagist\u002Fv\u002Flongman\u002Ftelegram-bot.svg)](https:\u002F\u002Fpackagist.org\u002Fpackages\u002Flongman\u002Ftelegram-bot)\n[![Dependencies](https:\u002F\u002Ftidelift.com\u002Fbadges\u002Fgithub\u002Fphp-telegram-bot\u002Fcore?style=flat)][Tidelift]\n[![Total Downloads](https:\u002F\u002Fimg.shields.io\u002Fpackagist\u002Fdt\u002Flongman\u002Ftelegram-bot.svg)](https:\u002F\u002Fpackagist.org\u002Fpackages\u002Flongman\u002Ftelegram-bot)\n[![Downloads Month](https:\u002F\u002Fimg.shields.io\u002Fpackagist\u002Fdm\u002Flongman\u002Ftelegram-bot.svg)](https:\u002F\u002Fpackagist.org\u002Fpackages\u002Flongman\u002Ftelegram-bot)\n[![Minimum PHP Version](http:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fphp-%3E%3D8.1-8892BF.svg)](https:\u002F\u002Fphp.net\u002F)\n[![License](https:\u002F\u002Fimg.shields.io\u002Fpackagist\u002Fl\u002Flongman\u002Ftelegram-bot.svg)](https:\u002F\u002Fgithub.com\u002Fphp-telegram-bot\u002Fcore\u002FLICENSE)\n\n## Table of Contents\n- [Introduction](#introduction)\n- [Instructions](#instructions)\n    - [Create your first bot](#create-your-first-bot)\n    - [Require this package with Composer](#require-this-package-with-composer)\n    - [Choose how to retrieve Telegram updates](#choose-how-to-retrieve-telegram-updates)\n- [Using a custom Bot API server](#using-a-custom-bot-api-server)\n- [Webhook installation](#webhook-installation)\n    - [Self Signed Certificate](#self-signed-certificate)\n    - [Unset Webhook](#unset-webhook)\n- [getUpdates installation](#getupdates-installation)\n    - [getUpdates without database](#getupdates-without-database)\n- [Filter Update](#filter-update)\n- [Support](#support)\n    - [Types](#types)\n    - [Inline Query](#inline-query)\n    - [Methods](#methods)\n    - [Send Message](#send-message)\n    - [Send Photo](#send-photo)\n    - [Send Chat Action](#send-chat-action)\n    - [getUserProfilePhoto](#getuserprofilephoto)\n    - [getFile and downloadFile](#getfile-and-downloadfile)\n    - [Send message to all active chats](#send-message-to-all-active-chats)\n- [Utils](#utils)\n    - [MySQL storage (Recommended)](#mysql-storage-recommended)\n        - [External Database connection](#external-database-connection)\n    - [Channels Support](#channels-support)\n- [Commands](#commands)\n    - [Predefined Commands](#predefined-commands)\n    - [Custom Commands](#custom-commands)\n    - [Commands Configuration](#commands-configuration)\n    - [Admin Commands](#admin-commands)\n        - [Set Admins](#set-admins)\n        - [Channel Administration](#channel-administration)\n- [Upload and Download directory path](#upload-and-download-directory-path)\n- [Logging](doc\u002F01-utils.md)\n- [Documentation](#documentation)\n- [Assets](#assets)\n- [Example bot](#example-bot)\n- [Projects with this library](#projects-with-this-library)\n- [Troubleshooting](#troubleshooting)\n- [Contributing](#contributing)\n- [Security](#security)\n- [Donate](#donate)\n- [For enterprise](#for-enterprise)\n- [License](#license)\n- [Credits](#credits)\n\n## Introduction\n\nThis is a pure PHP Telegram Bot, fully extensible via plugins.\n\nTelegram announced official support for a [Bot API](https:\u002F\u002Ftelegram.org\u002Fblog\u002Fbot-revolution), allowing integrators of all sorts to bring automated interactions to the mobile platform.\nThis Bot aims to provide a platform where one can simply write a bot and have interactions in a matter of minutes.\n\nThe Bot can:\n- Retrieve updates with [webhook](#webhook-installation) and [getUpdates](#getupdates-installation) methods.\n- Supports all types and methods according to Telegram Bot API 7.1 (February 2024).\n- Supports supergroups.\n- Handle commands in chat with other bots.\n- Manage Channel from the bot admin interface.\n- Full support for **inline bots**.\n- Inline keyboard.\n- Messages, InlineQuery and ChosenInlineQuery are stored in the Database.\n- Conversation feature.\n\n---\n\nThis code is available on [GitHub](https:\u002F\u002Fgithub.com\u002Fphp-telegram-bot\u002Fcore). Pull requests are welcome.\n\n## Instructions\n\n### Create your first bot\n\n1. Message [`@BotFather`](https:\u002F\u002Ftelegram.me\u002FBotFather) with the following text: `\u002Fnewbot`\n\n   If you don't know how to message by username, click the search field on your Telegram app and type `@BotFather`, where you should be able to initiate a conversation. Be careful not to send it to the wrong contact, because some users have similar usernames to `BotFather`.\n\n   ![BotFather initial conversation](https:\u002F\u002Fuser-images.githubusercontent.com\u002F9423417\u002F60736229-bc2aeb80-9f45-11e9-8d35-5b53145347bc.png)\n\n2. `@BotFather` replies with:\n\n    ```\n    Alright, a new bot. How are we going to call it? Please choose a name for your bot.\n    ```\n\n3. Type whatever name you want for your bot.\n\n4. `@BotFather` replies with:\n\n    ```\n    Good. Now let's choose a username for your bot. It must end in `bot`. Like this, for example: TetrisBot or tetris_bot.\n    ```\n\n5. Type whatever username you want for your bot, minimum 5 characters, and must end with `bot`. For example: `telesample_bot`\n\n6. `@BotFather` replies with:\n\n    ```\n    Done! Congratulations on your new bot. You will find it at\n    telegram.me\u002Ftelesample_bot. You can now add a description, about\n    section and profile picture for your bot, see \u002Fhelp for a list of\n    commands.\n\n    Use this token to access the HTTP API:\n    123456789:AAG90e14-0f8-40183D-18491dDE\n\n    For a description of the Bot API, see this page:\n    https:\u002F\u002Fcore.telegram.org\u002Fbots\u002Fapi\n    ```\n\n7. Note down the 'token' mentioned above.\n\n*Optionally set the bot privacy:*\n\n1. Send `\u002Fsetprivacy` to `@BotFather`.\n\n   ![BotFather later conversation](https:\u002F\u002Fuser-images.githubusercontent.com\u002F9423417\u002F60736340-26439080-9f46-11e9-970f-8f33bbe39c5f.png)\n\n2. `@BotFather` replies with:\n\n    ```\n    Choose a bot to change group messages settings.\n    ```\n\n3. Type (or select) `@telesample_bot` (change to the username you set at step 5\nabove, but start it with `@`)\n\n4. `@BotFather` replies with:\n\n    ```\n    'Enable' - your bot will only receive messages that either start with the '\u002F' symbol or mention the bot by username.\n    'Disable' - your bot will receive all messages that people send to groups.\n    Current status is: ENABLED\n    ```\n\n5. Type (or select) `Disable` to let your bot receive all messages sent to a group.\n\n6. `@BotFather` replies with:\n\n    ```\n    Success! The new status is: DISABLED. \u002Fhelp\n    ```\n\n### Require this package with Composer\n\nInstall this package through [Composer].\nEdit your project's `composer.json` file to require `longman\u002Ftelegram-bot`.\n\nCreate *composer.json* file\n```json\n{\n    \"name\": \"yourproject\u002Fyourproject\",\n    \"type\": \"project\",\n    \"require\": {\n        \"php\": \"^8.1\",\n        \"longman\u002Ftelegram-bot\": \"*\"\n    }\n}\n```\nand run `composer update`\n\n**or**\n\nrun this command in your command line:\n\n```bash\ncomposer require longman\u002Ftelegram-bot\n```\n\n### Choose how to retrieve Telegram updates\n\nThe bot can handle updates with [**Webhook**](#webhook-installation) or [**getUpdates**](#getupdates-installation) method:\n\n|      | Webhook | getUpdates |\n| ---- | :----: | :----: |\n| Description | Telegram sends the updates directly to your host | You have to fetch Telegram updates manually |\n| Host with https | Required | Not required |\n| MySQL | Not required | ([Not](#getupdates-without-database)) Required  |\n\n## Using a custom Bot API server\n\n**For advanced users only!**\n\nAs from Telegram Bot API 5.0, users can [run their own Bot API server] to handle updates.\nThis means, that the PHP Telegram Bot needs to be configured to serve that custom URI.\nAdditionally, you can define the URI where uploaded files to the bot can be downloaded (note the `{API_KEY}` placeholder).\n\n```php\nLongman\\TelegramBot\\Request::setCustomBotApiUri(\n    $api_base_uri          = 'https:\u002F\u002Fyour-bot-api-server', \u002F\u002F Default: https:\u002F\u002Fapi.telegram.org\n    $api_base_download_uri = '\u002Fpath\u002Fto\u002Ffiles\u002F{API_KEY}'     \u002F\u002F Default: \u002Ffile\u002Fbot{API_KEY}\n);\n```\n\n**Note:** If you are running your bot in `--local` mode, you won't need the `Request::downloadFile()` method, since you can then access your files directly from the absolute path returned by `Request::getFile()`.\n\n## Webhook installation\n\nNote: For a more detailed explanation, head over to the [example-bot repository] and follow the instructions there.\n\nIn order to set a [Webhook][api-setwebhook] you need a server with HTTPS and composer support.\n(For a [self signed certificate](#self-signed-certificate) you need to add some extra code)\n\nCreate *[set.php]* with the following contents:\n```php\n\u003C?php\n\u002F\u002F Load composer\nrequire __DIR__ . '\u002Fvendor\u002Fautoload.php';\n\n$bot_api_key  = 'your:bot_api_key';\n$bot_username = 'username_bot';\n$hook_url     = 'https:\u002F\u002Fyour-domain\u002Fpath\u002Fto\u002Fhook.php';\n\ntry {\n    \u002F\u002F Create Telegram API object\n    $telegram = new Longman\\TelegramBot\\Telegram($bot_api_key, $bot_username);\n\n    \u002F\u002F Set webhook\n    $result = $telegram->setWebhook($hook_url);\n    if ($result->isOk()) {\n        echo $result->getDescription();\n    }\n} catch (Longman\\TelegramBot\\Exception\\TelegramException $e) {\n    \u002F\u002F log telegram errors\n    \u002F\u002F echo $e->getMessage();\n}\n```\n\nOpen your *set.php* via the browser to register the webhook with Telegram.\nYou should see `Webhook was set`.\n\nNow, create *[hook.php]* with the following contents:\n```php\n\u003C?php\n\u002F\u002F Load composer\nrequire __DIR__ . '\u002Fvendor\u002Fautoload.php';\n\n$bot_api_key  = 'your:bot_api_key';\n$bot_username = 'username_bot';\n\ntry {\n    \u002F\u002F Create Telegram API object\n    $telegram = new Longman\\TelegramBot\\Telegram($bot_api_key, $bot_username);\n\n    \u002F\u002F Handle telegram webhook request\n    $telegram->handle();\n} catch (Longman\\TelegramBot\\Exception\\TelegramException $e) {\n    \u002F\u002F Silence is golden!\n    \u002F\u002F log telegram errors\n    \u002F\u002F echo $e->getMessage();\n}\n```\n\n### Self Signed Certificate\n\nUpload the certificate and add the path as a parameter in *set.php*:\n```php\n$result = $telegram->setWebhook($hook_url, ['certificate' => '\u002Fpath\u002Fto\u002Fcertificate']);\n```\n\n### Unset Webhook\n\nEdit *[unset.php]* with your bot credentials and execute it.\n\n## getUpdates installation\n\nFor best performance, the MySQL database should be enabled for the `getUpdates` method!\n\nCreate *[getUpdatesCLI.php]* with the following contents:\n```php\n#!\u002Fusr\u002Fbin\u002Fenv php\n\u003C?php\nrequire __DIR__ . '\u002Fvendor\u002Fautoload.php';\n\n$bot_api_key  = 'your:bot_api_key';\n$bot_username = 'username_bot';\n\n$mysql_credentials = [\n   'host'     => 'localhost',\n   'port'     => 3306, \u002F\u002F optional\n   'user'     => 'dbuser',\n   'password' => 'dbpass',\n   'database' => 'dbname',\n];\n\ntry {\n    \u002F\u002F Create Telegram API object\n    $telegram = new Longman\\TelegramBot\\Telegram($bot_api_key, $bot_username);\n\n    \u002F\u002F Enable MySQL\n    $telegram->enableMySql($mysql_credentials);\n\n    \u002F\u002F Handle telegram getUpdates request\n    $telegram->handleGetUpdates();\n} catch (Longman\\TelegramBot\\Exception\\TelegramException $e) {\n    \u002F\u002F log telegram errors\n    \u002F\u002F echo $e->getMessage();\n}\n```\n\nNext, give the file permission to execute:\n```bash\n$ chmod +x getUpdatesCLI.php\n```\n\nLastly, run it!\n```bash\n$ .\u002FgetUpdatesCLI.php\n```\n\n### getUpdates without database\n\nIf you choose to \u002F or are obliged to use the `getUpdates` method without a database, you can replace the `$telegram->enableMySql(...);` line above with:\n```php\n$telegram->useGetUpdatesWithoutDatabase();\n```\n\n## Filter Update\n\n:exclamation: Note that by default, Telegram will send any new update types that may be added in the future. This may cause commands that don't take this into account to break!\n\nIt is suggested that you specifically define which update types your bot can receive and handle correctly.\n\nYou can define which update types are sent to your bot by defining them when setting the [webhook](#webhook-installation) or passing an array of allowed types when using [getUpdates](#getupdates-installation).\n\n```php\nuse Longman\\TelegramBot\\Entities\\Update;\n\n\u002F\u002F For all update types currently implemented in this library:\n\u002F\u002F $allowed_updates = Update::getUpdateTypes();\n\n\u002F\u002F Define the list of allowed Update types manually:\n$allowed_updates = [\n    Update::TYPE_MESSAGE,\n    Update::TYPE_CHANNEL_POST,\n    \u002F\u002F etc.\n];\n\n\u002F\u002F When setting the webhook.\n$telegram->setWebhook($hook_url, ['allowed_updates' => $allowed_updates]);\n\n\u002F\u002F When handling the getUpdates method.\n$telegram->handleGetUpdates(['allowed_updates' => $allowed_updates]);\n```\n\nAlternatively, Update processing can be allowed or denied by defining a custom update filter.\n\nLet's say we only want to allow messages from a user with ID `428`, we can do the following before handling the request:\n\n```php\n$telegram->setUpdateFilter(function (Update $update, Telegram $telegram, &$reason = 'Update denied by update_filter') {\n    $user_id = $update->getMessage()->getFrom()->getId();\n    if ($user_id === 428) {\n        return true;\n    }\n\n    $reason = \"Invalid user with ID {$user_id}\";\n    return false;\n});\n```\n\nThe reason for denying an update can be defined with the `$reason` parameter. This text gets written to the debug log.\n\n## Support\n\n### Types\n\nAll types are implemented according to Telegram API 7.1 (February 2024).\n\n### Inline Query\n\nFull support for inline query according to Telegram API 7.1 (February 2024).\n\n### Methods\n\nAll methods are implemented according to Telegram API 7.1 (February 2024).\n\n#### Send Message\n\nMessages longer than 4096 characters are split up into multiple messages.\n\n```php\n$result = Request::sendMessage([\n    'chat_id' => $chat_id,\n    'text'    => 'Your utf8 text 😜 ...',\n]);\n```\n\n#### Send Photo\n\nTo send a local photo, add it properly to the `$data` parameter using the file path:\n\n```php\n$result = Request::sendPhoto([\n    'chat_id' => $chat_id,\n    'photo'   => Request::encodeFile('\u002Fpath\u002Fto\u002Fpic.jpg'),\n]);\n```\n\nIf you know the `file_id` of a previously uploaded file, just use it directly in the data array:\n\n```php\n$result = Request::sendPhoto([\n    'chat_id' => $chat_id,\n    'photo'   => 'AAQCCBNtIhAoAAss4tLEZ3x6HzqVAAqC',\n]);\n```\n\nTo send a remote photo, use the direct URL instead:\n\n```php\n$result = Request::sendPhoto([\n    'chat_id' => $chat_id,\n    'photo'   => 'https:\u002F\u002Fexample.com\u002Fpath\u002Fto\u002Fpic.jpg',\n]);\n```\n\n*sendAudio*, *sendDocument*, *sendAnimation*, *sendSticker*, *sendVideo*, *sendVoice* and *sendVideoNote* all work in the same way, just check the [API documentation](https:\u002F\u002Fcore.telegram.org\u002Fbots\u002Fapi#sendphoto) for the exact usage.\nSee the *[ImageCommand.php]* for a full example.\n\n#### Send Chat Action\n\n```php\nRequest::sendChatAction([\n    'chat_id' => $chat_id,\n    'action'  => Longman\\TelegramBot\\ChatAction::TYPING,\n]);\n```\n\n#### getUserProfilePhoto\n\nRetrieve the user photo. (see *[WhoamiCommand.php]* for a full example)\n\n#### getFile and downloadFile\n\nGet the file path and download it. (see *[WhoamiCommand.php]* for a full example)\n\n#### Send message to all active chats\n\nTo do this you have to enable the MySQL connection.\nHere's an example of use (check [`DB::selectChats()`][DB::selectChats] for parameter usage):\n\n```php\n$results = Request::sendToActiveChats(\n    'sendMessage', \u002F\u002F Callback function to execute (see Request.php methods)\n    ['text' => 'Hey! Check out the new features!!'], \u002F\u002F Param to evaluate the request\n    [\n        'groups'      => true,\n        'supergroups' => true,\n        'channels'    => false,\n        'users'       => true,\n    ]\n);\n```\n\nYou can also broadcast a message to users, from the private chat with your bot. Take a look at the [admin commands](#admin-commands) below.\n\n## Utils\n\n### MySQL storage (Recommended)\n\nIf you want to save messages\u002Fusers\u002Fchats for further usage in commands, create a new database (`utf8mb4_unicode_520_ci`), import *[structure.sql]* and enable MySQL support BEFORE `handle()` method:\n\n```php\n$mysql_credentials = [\n   'host'     => 'localhost',\n   'port'     => 3306, \u002F\u002F optional\n   'user'     => 'dbuser',\n   'password' => 'dbpass',\n   'database' => 'dbname',\n];\n\n$telegram->enableMySql($mysql_credentials);\n```\n\nYou can set a custom prefix to all the tables while you are enabling MySQL:\n\n```php\n$telegram->enableMySql($mysql_credentials, $bot_username . '_');\n```\n\nYou can also store inline query and chosen inline query data in the database.\n\n#### External Database connection\n\nIt is possible to provide the library with an external MySQL PDO connection.\nHere's how to configure it:\n\n```php\n$telegram->enableExternalMySql($external_pdo_connection);\n\u002F\u002F$telegram->enableExternalMySql($external_pdo_connection, $table_prefix)\n```\n### Channels Support\n\nAll methods implemented can be used to manage channels.\nWith [admin commands](#admin-commands) you can manage your channels directly with your bot private chat.\n\n## Commands\n\n### Predefined Commands\n\nThe bot is able to recognise commands in a chat with multiple bots (\u002Fcommand@mybot).\n\nIt can also execute commands that get triggered by events, so-called Service Messages.\n\n### Custom Commands\n\nMaybe you would like to develop your own commands.\nThere is a guide to help you [create your own commands][wiki-create-your-own-commands].\n\nAlso, be sure to have a look at the [example commands][ExampleCommands-folder] to learn more about custom commands and how they work.\n\nYou can add your custom commands in different ways:\n\n```php\n\u002F\u002F Add a folder that contains command files\n$telegram->addCommandsPath('\u002Fpath\u002Fto\u002Fcommand\u002Ffiles');\n\u002F\u002F$telegram->addCommandsPaths(['\u002Fpath\u002Fto\u002Fcommand\u002Ffiles', '\u002Fanother\u002Fpath']);\n\n\u002F\u002F Add a command directly using the class name\n$telegram->addCommandClass(MyCommand::class);\n\u002F\u002F$telegram->addCommandClasses([MyCommand::class, MyOtherCommand::class]);\n```\n\n### Commands Configuration\n\nWith this method you can set some command specific parameters, for example:\n\n```php\n\u002F\u002F Google geocode\u002Ftimezone API key for \u002Fdate command\n$telegram->setCommandConfig('date', [\n    'google_api_key' => 'your_google_api_key_here',\n]);\n\n\u002F\u002F OpenWeatherMap API key for \u002Fweather command\n$telegram->setCommandConfig('weather', [\n    'owm_api_key' => 'your_owm_api_key_here',\n]);\n```\n\n### Admin Commands\n\nEnabling this feature, the bot admin can perform some super user commands like:\n- List all the chats started with the bot *\u002Fchats*\n- Clean up old database entries *\u002Fcleanup*\n- Show debug information about the bot *\u002Fdebug*\n- Send message to all chats *\u002Fsendtoall*\n- Post any content to your channels *\u002Fsendtochannel*\n- Inspect a user or a chat with *\u002Fwhois*\n\nTake a look at all default admin commands stored in the *[src\u002FCommands\u002FAdminCommands\u002F][AdminCommands-folder]* folder.\n\n#### Set Admins\n\nYou can specify one or more admins with this option:\n\n```php\n\u002F\u002F Single admin\n$telegram->enableAdmin(your_telegram_user_id);\n\n\u002F\u002F Multiple admins\n$telegram->enableAdmins([\n    your_telegram_user_id,\n    other_telegram_user_id,\n]);\n```\nTelegram user id can be retrieved with the *[\u002Fwhoami][WhoamiCommand.php]* command.\n\n#### Channel Administration\n\nTo enable this feature follow these steps:\n- Add your bot as channel administrator, this can be done with any Telegram client.\n- Enable admin interface for your user as explained in the admin section above.\n- Enter your channel name as a parameter for the *[\u002Fsendtochannel][SendtochannelCommand.php]* command:\n```php\n$telegram->setCommandConfig('sendtochannel', [\n    'your_channel' => [\n        '@type_here_your_channel',\n    ]\n]);\n```\n- If you want to manage more channels:\n```php\n$telegram->setCommandConfig('sendtochannel', [\n    'your_channel' => [\n        '@type_here_your_channel',\n        '@type_here_another_channel',\n        '@and_so_on',\n    ]\n]);\n```\n- Enjoy!\n\n## Upload and Download directory path\n\nTo use the Upload and Download functionality, you need to set the paths with:\n```php\n$telegram->setDownloadPath('\u002Fyour\u002Fpath\u002FDownload');\n$telegram->setUploadPath('\u002Fyour\u002Fpath\u002FUpload');\n```\n\n## Documentation\n\nTake a look at the repo [Wiki] for further information and tutorials!\nFeel free to improve!\n\n## Assets\n\nAll project assets can be found in the [assets](https:\u002F\u002Fgithub.com\u002Fphp-telegram-bot\u002Fassets) repository.\n\n## Example bot\n\nWe're busy working on a full A-Z example bot, to help get you started with this library and to show you how to use all its features.\nYou can check the progress of the [example-bot repository]).\n\n## Projects with this library\n\nHere's a list of projects that feats this library, feel free to add yours!\n- [Inline Games](https:\u002F\u002Fgithub.com\u002Fjacklul\u002Finlinegamesbot) ([@inlinegamesbot](https:\u002F\u002Ftelegram.me\u002Finlinegamesbot))\n- [Super-Dice-Roll](https:\u002F\u002Fgithub.com\u002FRafaelDelboni\u002FSuper-Dice-Roll) ([@superdiceroll_bot](https:\u002F\u002Ftelegram.me\u002Fsuperdiceroll_bot))\n- [tg-mentioned-bot](https:\u002F\u002Fgithub.com\u002Fgruessung\u002Ftg-mentioned-bot)\n- [OSMdeWikiBot](https:\u002F\u002Fgithub.com\u002FOSM-de\u002FTelegramWikiBot) ([@OSM_de](https:\u002F\u002Ft.me\u002FOSM_de))\n- [pass-generator-webbot](https:\u002F\u002Fgithub.com\u002FOxMohsen\u002Fpass-generator-webbot)\n- [Chess Quiz Bot](https:\u002F\u002Fgithub.com\u002F1int\u002Fchess-quiz-bot)\n- [PHP Telegram Bot - Symfony Bundle](https:\u002F\u002Fgithub.com\u002Fm4n50n\u002Ftelegram_bot_bundle)\n\n## Troubleshooting\n\nIf you like living on the edge, please report any bugs you find on the [PHP Telegram Bot issues][issues] page.\n\n## Contributing\n\nSee [CONTRIBUTING](CONTRIBUTING.md) for more information.\n\n## Security\n\nSee [SECURITY](SECURITY.md) for more information.\n\n## Donate\n\nAll work on this bot consists of many hours of coding during our free time, to provide you with a Telegram Bot library that is easy to use and extend.\nIf you enjoy using this library and would like to say thank you, donations are a great way to show your support.\n\nDonations are invested back into the project :+1:\n\nThank you for keeping this project alive :pray:\n\n- [![Patreon](https:\u002F\u002Fuser-images.githubusercontent.com\u002F9423417\u002F59235980-a5fa6b80-8be3-11e9-8ae7-020bc4ae9baa.png) Patreon.com\u002Fphptelegrambot][Patreon]\n- [![OpenCollective](https:\u002F\u002Fuser-images.githubusercontent.com\u002F9423417\u002F59235978-a561d500-8be3-11e9-89be-82ec54be1546.png) OpenCollective.com\u002Fphp-telegram-bot][OpenCollective]\n- [![Ko-fi](https:\u002F\u002Fuser-images.githubusercontent.com\u002F9423417\u002F59235976-a561d500-8be3-11e9-911d-b1908c3e6a33.png) Ko-fi.com\u002Fphptelegrambot][Ko-fi]\n- [![Tidelift](https:\u002F\u002Fuser-images.githubusercontent.com\u002F9423417\u002F59235982-a6930200-8be3-11e9-8ac2-bfb6991d80c5.png) Tidelift.com\u002Flongman\u002Ftelegram-bot][Tidelift]\n- [![Liberapay](https:\u002F\u002Fuser-images.githubusercontent.com\u002F9423417\u002F59235977-a561d500-8be3-11e9-9d16-bc3b13d3ceba.png) Liberapay.com\u002FPHP-Telegram-Bot][Liberapay]\n- [![PayPal](https:\u002F\u002Fuser-images.githubusercontent.com\u002F9423417\u002F59235981-a5fa6b80-8be3-11e9-9761-15eb7a524cb0.png) PayPal.me\u002Fnoplanman][PayPal-noplanman] (account of @noplanman)\n- [![Bitcoin](https:\u002F\u002Fuser-images.githubusercontent.com\u002F9423417\u002F59235974-a4c93e80-8be3-11e9-9fde-260c821b6eae.png) 166NcyE7nDxkRPWidWtG1rqrNJoD5oYNiV][Bitcoin]\n- [![Ethereum](https:\u002F\u002Fuser-images.githubusercontent.com\u002F9423417\u002F59235975-a4c93e80-8be3-11e9-8762-7a47c62c968d.png) 0x485855634fa212b0745375e593fAaf8321A81055][Ethereum]\n\n## For enterprise\n\nAvailable as part of the Tidelift Subscription.\n\nThe maintainers of `PHP Telegram Bot` and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.][Tidelift]\n\n## License\n\nPlease see the [LICENSE](LICENSE) included in this repository for a full copy of the MIT license, which this project is licensed under.\n\n## Credits\n\nCredit list in [CREDITS](CREDITS)\n\n---\n\n[Telegram Bot API]: https:\u002F\u002Fcore.telegram.org\u002Fbots\u002Fapi \"Telegram Bot API\"\n[Composer]: https:\u002F\u002Fgetcomposer.org\u002F \"Composer\"\n[run their own Bot API server]: https:\u002F\u002Fcore.telegram.org\u002Fbots\u002Fapi#using-a-local-bot-api-server \"Using a Local Bot API Server\"\n[example-bot repository]: https:\u002F\u002Fgithub.com\u002Fphp-telegram-bot\u002Fexample-bot \"Example Bot repository\"\n[api-setwebhook]: https:\u002F\u002Fcore.telegram.org\u002Fbots\u002Fapi#setwebhook \"Webhook on Telegram Bot API\"\n[set.php]: https:\u002F\u002Fgithub.com\u002Fphp-telegram-bot\u002Fexample-bot\u002Fblob\u002Fmaster\u002Fset.php \"example set.php\"\n[unset.php]: https:\u002F\u002Fgithub.com\u002Fphp-telegram-bot\u002Fexample-bot\u002Fblob\u002Fmaster\u002Funset.php \"example unset.php\"\n[hook.php]: https:\u002F\u002Fgithub.com\u002Fphp-telegram-bot\u002Fexample-bot\u002Fblob\u002Fmaster\u002Fhook.php \"example hook.php\"\n[getUpdatesCLI.php]: https:\u002F\u002Fgithub.com\u002Fphp-telegram-bot\u002Fexample-bot\u002Fblob\u002Fmaster\u002FgetUpdatesCLI.php \"example getUpdatesCLI.php\"\n[AdminCommands-folder]: https:\u002F\u002Fgithub.com\u002Fphp-telegram-bot\u002Fcore\u002Ftree\u002Fmaster\u002Fsrc\u002FCommands\u002FAdminCommands \"Admin commands folder\"\n[ExampleCommands-folder]: https:\u002F\u002Fgithub.com\u002Fphp-telegram-bot\u002Fexample-bot\u002Fblob\u002Fmaster\u002FCommands \"Example commands folder\"\n[ImageCommand.php]: https:\u002F\u002Fgithub.com\u002Fphp-telegram-bot\u002Fexample-bot\u002Fblob\u002Fmaster\u002FCommands\u002FOther\u002FImageCommand.php \"example \u002Fimage command\"\n[WhoamiCommand.php]: https:\u002F\u002Fgithub.com\u002Fphp-telegram-bot\u002Fexample-bot\u002Fblob\u002Fmaster\u002FCommands\u002FWhoamiCommand.php \"example \u002Fwhoami command\"\n[HelpCommand.php]: https:\u002F\u002Fgithub.com\u002Fphp-telegram-bot\u002Fexample-bot\u002Fblob\u002Fmaster\u002FCommands\u002FHelpCommand.php \"example \u002Fhelp command\"\n[SendtochannelCommand.php]: https:\u002F\u002Fgithub.com\u002Fphp-telegram-bot\u002Fcore\u002Fblob\u002Fmaster\u002Fsrc\u002FCommands\u002FAdminCommands\u002FSendtochannelCommand.php \"\u002Fsendtochannel admin command\"\n[DB::selectChats]: https:\u002F\u002Fgithub.com\u002Fphp-telegram-bot\u002Fcore\u002Fblob\u002F0.70.0\u002Fsrc\u002FDB.php#L1148 \"DB::selectChats() parameters\"\n[structure.sql]: https:\u002F\u002Fgithub.com\u002Fphp-telegram-bot\u002Fcore\u002Fblob\u002Fmaster\u002Fstructure.sql \"DB structure for importing\"\n[Wiki]: https:\u002F\u002Fgithub.com\u002Fphp-telegram-bot\u002Fcore\u002Fwiki \"PHP Telegram Bot Wiki\"\n[wiki-create-your-own-commands]: https:\u002F\u002Fgithub.com\u002Fphp-telegram-bot\u002Fcore\u002Fwiki\u002FCreate-your-own-commands \"Create your own commands\"\n[issues]: https:\u002F\u002Fgithub.com\u002Fphp-telegram-bot\u002Fcore\u002Fissues \"PHP Telegram Bot Issues\"\n\n[Patreon]: https:\u002F\u002Fwww.patreon.com\u002Fphptelegrambot \"Support us on Patreon\"\n[OpenCollective]: https:\u002F\u002Fopencollective.com\u002Fphp-telegram-bot \"Support us on Open Collective\"\n[Ko-fi]: https:\u002F\u002Fko-fi.com\u002Fphptelegrambot \"Support us on Ko-fi\"\n[Tidelift]: https:\u002F\u002Ftidelift.com\u002Fsubscription\u002Fpkg\u002Fpackagist-longman-telegram-bot?utm_source=packagist-longman-telegram-bot&utm_medium=referral&utm_campaign=enterprise&utm_term=repo \"Learn more about the Tidelift Subscription\"\n[Liberapay]: https:\u002F\u002Fliberapay.com\u002FPHP-Telegram-Bot \"Donate with Liberapay\"\n[PayPal-noplanman]: https:\u002F\u002Fpaypal.me\u002Fnoplanman \"Donate with PayPal\"\n[Bitcoin]: https:\u002F\u002Fwww.blockchain.com\u002Fbtc\u002Faddress\u002F166NcyE7nDxkRPWidWtG1rqrNJoD5oYNiV \"Donate with Bitcoin\"\n[Ethereum]: https:\u002F\u002Fetherscan.io\u002Faddress\u002F0x485855634fa212b0745375e593fAaf8321A81055 \"Donate with Ethereum\"\n","php-telegram-bot\u002Fcore 是一个基于官方Telegram Bot API的PHP库，用于开发Telegram机器人。该项目支持最新版本的Telegram Bot API，并提供了丰富的功能和灵活的配置选项，包括消息发送、内联查询处理、自定义Bot API服务器等。它还支持多种更新获取方式，如Webhook和getUpdates方法，方便开发者根据实际需求选择。此外，项目通过了严格的测试并保持高代码覆盖率，确保了其稳定性和可靠性。适用于需要快速构建Telegram机器人的场景，无论是个人项目还是企业应用都能从中受益。",2,"2026-06-11 03:17:57","top_language"]