{"id":25227228,"url":"https://github.com/php-telegram-bot/workspace","last_synced_at":"2025-06-14T08:38:12.785Z","repository":{"id":57040022,"uuid":"472100204","full_name":"php-telegram-bot/workspace","owner":"php-telegram-bot","description":"Workspace for development and tests.","archived":false,"fork":false,"pushed_at":"2022-03-24T20:32:20.000Z","size":26,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-05T13:13:16.217Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/php-telegram-bot.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-03-20T20:53:21.000Z","updated_at":"2024-03-24T10:21:30.000Z","dependencies_parsed_at":"2022-08-23T23:30:38.750Z","dependency_job_id":null,"html_url":"https://github.com/php-telegram-bot/workspace","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/php-telegram-bot/workspace","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/php-telegram-bot%2Fworkspace","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/php-telegram-bot%2Fworkspace/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/php-telegram-bot%2Fworkspace/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/php-telegram-bot%2Fworkspace/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/php-telegram-bot","download_url":"https://codeload.github.com/php-telegram-bot/workspace/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/php-telegram-bot%2Fworkspace/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259789069,"owners_count":22911499,"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":[],"created_at":"2025-02-11T08:13:13.834Z","updated_at":"2025-06-14T08:38:12.759Z","avatar_url":"https://github.com/php-telegram-bot.png","language":"PHP","readme":"\u003cdiv id=\"top\"\u003e\u003c/div\u003e\n\n\u003c!-- TABLE OF CONTENTS --\u003e\n\u003cdetails\u003e\n  \u003csummary\u003eTable of Contents\u003c/summary\u003e\n  \u003col\u003e\n    \u003cli\u003e\n      \u003ca href=\"#about-this-repository\"\u003eAbout this repository\u003c/a\u003e\n    \u003c/li\u003e\n    \u003cli\u003e\n      \u003ca href=\"#getting-started\"\u003eGetting Started\u003c/a\u003e\n      \u003cul\u003e\n        \u003cli\u003e\u003ca href=\"#cloning-the-repository\"\u003eCloning the repository\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"#working-on-php-telegram-bot\"\u003eWorking on php-telegram-bot\u003c/a\u003e\u003c/li\u003e\n      \u003c/ul\u003e\n    \u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#using-docker\"\u003eUsing Docker\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#using-the-bot\"\u003eUsing the bot\u003c/a\u003e\u003c/li\u003e\n  \u003c/ol\u003e\n\u003c/details\u003e\n\n## About this repository\n\nThis repository is a boilerplate for development of the [php-telegram-bot](https://github.com/php-telegram-bot/core).\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n## Getting Started\n\n### Cloning the repository\n\n```shell\ngit clone --recurse-submodules https://github.com/php-telegram-bot/workspace.git\n```\n\nAfter cloning the workspace, you can use the workspace as if it were a project. We provided a few scripts and a\ndocker-compose.yml that configures a webserver and a local Telegram Bot API server for using and testing webhooks.\n\n### Working on php-telegram-bot\n\nTo work on the php-telegram-bot repository itself you need to `cd` into the `packages/php-telegram-bot` directory and\ncheckout a branch with\n\n```shell\ngit checkout develop\n```\n\nTo pull all the current changes from upstream you can call from any location\n\n```shell\ngit submodule update --remote --merge\n```\n\nIf you want to commit changes to upstream, you can simply do that as anywhere else.\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n## Using Docker\n\nBy default the Docker setup launches preconfigured with the following containers:\n\n1. **nginx** _Webserver_\n    - to accept webhook calls from the custom bot api server\n2. **php-fpm** _PHP 8.1_\n    - runs all the code\n3. **mariadb** _Database_\n    - already has the structure imported\n4. **[tdlight](https://github.com/tdlight-team/tdlight-telegram-bot-api)** _Custom Bot API Server_\n    - Lighter version of the custom Telegram bot API server.\n\nTo start the container copy the `.env.example` into a `.env` file and fill out your `TELEGRAM_API_ID`\nand `TELEGRAM_API_HASH` data from https://my.telegram.org/apps.\n\nAfter this you can start the containers with\n\n```shell\ndocker-compose up -d\n```\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n## Using the bot\n\nBy default there is a /start command.\n\nSo if you've also filled out your `TELEGRAM_BOT_USERNAME` and `TELEGRAM_BOT_TOKEN` in your `.env` file, you can execute\nthe `setWebhook.php` inside the php Docker container.\n\nIf successful, you should be able to send a `/start` to your bot.\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n## Manually calling the webserver\n\nIf you need to call the webserver directly or have a look at the stats of the Bot API server you can create\na `docker-compose.override.yml` file and add the needed port forwarding like in this example:\n\n```yaml\nversion: '3'\nservices:\n  nginx:\n    ports:\n      - 8080:80\n        \n  api-server:\n    environment:\n      TELEGRAM_STAT: yes\n    ports:\n      - 8082:8082\n```\n\nThe first block inside `services` extends the nginx service and adds a port forwarding from 8080 (on your host) to 80 inside the container.\nYou can then call any php script or static files with `http://localhost:8080`\n\nThe second block extends the api-server service, enables the stats with an environment variable and forwards the port 8082 from the container to your host.\nThis allows you to call `http://localhost:8082` to access the stats page of the Telegram Bot API server and check i.e. if the webhook was registered correctly.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphp-telegram-bot%2Fworkspace","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphp-telegram-bot%2Fworkspace","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphp-telegram-bot%2Fworkspace/lists"}