{"id":33959935,"url":"https://github.com/vanloctech/telehook","last_synced_at":"2026-04-19T20:32:38.374Z","repository":{"id":40451638,"uuid":"485843409","full_name":"vanloctech/telehook","owner":"vanloctech","description":"Telehook - Telegram bot command","archived":false,"fork":false,"pushed_at":"2023-03-14T15:44:14.000Z","size":2536,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-14T10:13:44.238Z","etag":null,"topics":["laravel","laravel-package","laravel-telegram","php","telegram","telegram-bot","webhook"],"latest_commit_sha":null,"homepage":"","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/vanloctech.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-04-26T15:25:38.000Z","updated_at":"2025-10-17T08:10:23.000Z","dependencies_parsed_at":"2022-08-09T20:51:15.352Z","dependency_job_id":null,"html_url":"https://github.com/vanloctech/telehook","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/vanloctech/telehook","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vanloctech%2Ftelehook","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vanloctech%2Ftelehook/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vanloctech%2Ftelehook/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vanloctech%2Ftelehook/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vanloctech","download_url":"https://codeload.github.com/vanloctech/telehook/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vanloctech%2Ftelehook/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32022041,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T20:23:30.271Z","status":"online","status_checked_at":"2026-04-19T02:00:07.110Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["laravel","laravel-package","laravel-telegram","php","telegram","telegram-bot","webhook"],"created_at":"2025-12-12T21:35:33.225Z","updated_at":"2026-04-19T20:32:38.369Z","avatar_url":"https://github.com/vanloctech.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Telehook Laravel\n\n_Telegram bot command like conversation for Laravel_\n\n## DEMO\n\nhttps://user-images.githubusercontent.com/20141611/224770232-a8681de5-b6e2-46e4-b4cc-b4088ce155a5.mp4\n\n## Requirement\n- Laravel framework \u003e= 5.8 and up\n- PHP \u003e= 7.3\n\n## Reporting Issues\n\nIf you do find an issue, please feel free to report it with [GitHub's bug tracker](https://github.com/vanloctech/telehook/issues) for this project.\n\nAlternatively, fork the project and make a pull request :)\n\n## Setup\n\nInstall package\n```shell\ncomposer require vanloctech/telehook\n```\n\nPublish config file `telehook.php`, migration files, translations file for project\n```shell\nphp artisan vendor:publish --provider=\"Vanloctech\\Telehook\\TelehookServiceProvider\"\n```\n\nExecute command in schedule for run every minute to stop conversation exceed the time limit\n```php\n// app/Console/Kernel.php\n\n// ...\n\nprotected function schedule(Schedule $schedule)\n{\n    // ...\n    $schedule-\u003ecommand('telehook:stop-conversation')-\u003eeveryMinute();\n}\n\n// ...\n```\n\nWe also provide a facade for Telehook (which has connected using our settings), add following to your `config/app.php` if you need so.\n```php\n// config/app.php\n\n'aliases' =\u003e [\n    ...\n    'Telehook' =\u003e \\Vanloctech\\Telehook\\Facades\\TelehookFacade::class,\n],\n```\n\n## Usage\nCreate telegram command - telehook command\n```shell\nphp artisan make:telehook-command \u003cCommand Name\u003e\n# Ex: php artisan make:telehook-command HelloWorld\n```\n\nOverride code in `finish` function\n```php\n\u003c?php\n// TelehookCommand/HelloWorldTelehookCommand.php\n\nnamespace App\\TelehookCommand;\n\nuse Vanloctech\\Telehook\\Commands\\TelehookCommand;\n\nclass HelloWorldTelehookCommand extends TelehookCommand\n{\n    ...\n\n    /**\n     * Execute when prepare finish conversation\n     *\n     * @return void\n     */\n    public function finish()\n    {\n        // TODO: Implement finish() method.\n    }\n}\n```\n\nAdd command into telehook config file `config/telehook.php`\n\n```php\n// config/telehook.php\n\n    'commands' =\u003e [\n        HelpTelehookCommand::class,\n        ...\n        \n        // add more your command\n        \\App\\TelehookCommand\\HelloWorldTelehookCommand::class\n    ],\n```\n\nusing Telehook for send message for multiple chatId\n```php\nTelehook::init()-\u003esetChatId('\u003cchatId\u003e')-\u003esendMessage('your text');\nTelehook::init()-\u003esetChatId(['\u003carray chatId\u003e'])-\u003esendMessages('your text');\n```\n\nUse more function with `telegramApi` property\n```php\n// any files\n\nTelehook::init('\u003cchat_id\u003e')-\u003etelegramApi-\u003esendPhoto(...);\nTelehook::init('\u003cchat_id\u003e')-\u003etelegramApi-\u003esendDocument(...);\n# and more function support call api, referer: https://github.com/irazasyed/telegram-bot-sdk\n# \u003cchat_id\u003e you can get in `telehook_users` table through `TelehookUser` model\n```\n\n### How to setup in the project\nDeclare **https** `URL` in `.env` file (`APP_URL`), (because telegram webhook requires **https**):\n\n**You can use ngrok ([https://ngrok.com](https://ngrok.com)) to make `https` URL\n\n```dotenv\n# .env\n\nAPP_URL=https://\u003cyour app url\u003e\n```\n\nNext, you can set webhook with information setup in `config/telehook.php` or setup in `.env` file:\n```php\n// config/telehook.php\n\n    /*\n    |--------------------------------------------------------------------------\n    | Unique authentication token of telegram bot\n    |--------------------------------------------------------------------------\n    */\n    'token' =\u003e env('TELEHOOK_TOKEN', ''),\n\n    /*\n    |--------------------------------------------------------------------------\n    | Set webhook parameters\n    |--------------------------------------------------------------------------\n    */\n    'set_webhook' =\u003e [\n        'url' =\u003e env('APP_URL') . '/' . env('TELEHOOK_TOKEN', '')\n            . '/' . env('TELEHOOK_PATH', 'webhook'),\n        // 'certificate' =\u003e env('TELEHOOK_CERTIFICATE', ''),\n        // 'ip_address' =\u003e '',\n        // 'max_connections' =\u003e '',\n        // 'allowed_updates' =\u003e '',\n        'drop_pending_updates' =\u003e true,\n    ],\n```\n\nAnd run command to set webhook:\n```shell\nphp artisan telehook:set-webhook\n\n# output example\nYour URI webhook: https://\u003cyour url webhook\u003e\nSet webhook successfully.\n```\n\nCommand set menu command (list of bot's command):\n```shell\nphp artisan telehook:set-command\n\n# output example\n+---------+-----------------------------------+\n| command | description                       |\n+---------+-----------------------------------+\n| help    | Display list of the bot's command |\n| example | Example command                   |\n| stop    | Stop conversation                 |\n+---------+-----------------------------------+\n```\n\nYou can setup a schedule for clear conversation finished:\n```php\n// app/Console/Kernel.php\n\n// ...\n\nprotected function schedule(Schedule $schedule)\n{\n    // ...\n    $schedule-\u003ecommand('telehook:clear --chunk=1000')-\u003edailyAt('01:00');\n}\n\n// ...\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvanloctech%2Ftelehook","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvanloctech%2Ftelehook","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvanloctech%2Ftelehook/lists"}