{"id":24778567,"url":"https://github.com/s0d3s/tg-long-req","last_synced_at":"2025-10-12T03:30:24.397Z","repository":{"id":62538866,"uuid":"182154871","full_name":"s0d3s/tg-long-req","owner":"s0d3s","description":"Simple PHP class for navigate user in telegram bot(by design)","archived":false,"fork":false,"pushed_at":"2020-01-03T18:35:50.000Z","size":92,"stargazers_count":2,"open_issues_count":0,"forks_count":4,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-10-09T23:45:27.981Z","etag":null,"topics":["php","telegram","telegram-bot","telegram-bots","telegram-long-request","telegram-menu","telegram-user-interface","teleram-bot-menu"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":false,"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/s0d3s.png","metadata":{"files":{"readme":"README.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":"2019-04-18T20:43:29.000Z","updated_at":"2022-09-13T10:59:14.000Z","dependencies_parsed_at":"2022-11-02T16:15:33.543Z","dependency_job_id":null,"html_url":"https://github.com/s0d3s/tg-long-req","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/s0d3s/tg-long-req","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/s0d3s%2Ftg-long-req","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/s0d3s%2Ftg-long-req/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/s0d3s%2Ftg-long-req/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/s0d3s%2Ftg-long-req/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/s0d3s","download_url":"https://codeload.github.com/s0d3s/tg-long-req/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/s0d3s%2Ftg-long-req/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279010148,"owners_count":26084692,"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","status":"online","status_checked_at":"2025-10-12T02:00:06.719Z","response_time":53,"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":["php","telegram","telegram-bot","telegram-bots","telegram-long-request","telegram-menu","telegram-user-interface","teleram-bot-menu"],"created_at":"2025-01-29T08:37:46.192Z","updated_at":"2025-10-12T03:30:24.133Z","avatar_url":"https://github.com/s0d3s.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\r\n# TG LONG REQUEST\r\n## What is this?\r\n  \r\nThis is a small help-oriented class for creating tg bots. It helps with the creation and navigation in the menu telegram bot\r\n\r\n---\r\nЭто небольшой класс для телеграм ботов. Он помогает в создании меню и дальнейшей навигации в нём.\r\n## Abstract exemple\r\n![](http://g.recordit.co/rqonFOdR4t.gif)\r\n## INSTALL\r\n**via composer**\r\n\r\n(add this to section \"require\" in your composer.json)\r\n\r\n    {\r\n      \"require\" : {  \r\n    \t\"s0d3s/tg-long-req\": \"\u003e=1\"   \r\n      }\r\n    }\r\n   and \r\n   \r\n    include_once('path/to/autoload.php');\r\n\tuse s0d3s\\TgLongReq;\r\n\r\n**manual**\r\n\r\nCopy the \"TgLongReq.php\" to the project dir and:\r\n\r\n    include_once('TgLongReq.php');\r\n\tuse s0d3s\\TgLongReq;\r\n\r\n## Simple use\r\n\r\n1. **Create a TgLongReq obj**\r\n\u003e$tg_req = TgLongReq\r\n\u003e(\r\n\u003e 'user_id', \r\n\u003e 'req_func list' \r\n\u003e */*optinal*/* ,\r\n\u003e 'user_request_dir', \r\n\u003e tg_api_key, \r\n\u003e tg_api_result\r\n\u003e );\r\n\u003e \r\n|Var|Type|Caption|\r\n|--|--|--|\r\n|$user_id| STRING | Telegram user id |\r\n|$req_func| ARRAY | Requests and functions association table |\r\n|$usr_req_dir|STR| Path to general request dir **|\r\n|$tg_api_key| SOMETH/* | irazasyed/telegram-bot-sdk Api() object* |\r\n|$tg_api_result| SOMETH/* |Api()-\u003egetWebhookUpdates() |\r\n\r\n*It could be something else, or be null.\r\n**Temporary requests from users will be stored in this folder.\r\n\r\n---\r\n2. **Create request**\r\n\r\n\u003e $tg_req-\u003ereqCreate('req_name'); *\r\n\r\n*This parameter depends only on you (this name should be in the association table)\r\n\r\n---\r\n3.  **Save and restore temprorary data**\r\n\r\n - **saving**\r\n \r\nFor store (temporary) data, you can use \"saveToTemp\", the function accepts any data types and saves it as json string\r\n\u003e $tg_req-\u003esaveToTemp(\\$some_data);\r\n\r\n- **restore**\r\n\r\n.\r\n\u003e$some_array = array();\r\n\u003e$some_array = \\$tg_req-\u003egetFromTemp(\\$hold_it==false);*\r\n\r\n\\*  If needed, you can leave a temporary file until the next used, for this pass to function \"true\"(bool)\r\n\r\n---\r\n4. **Check the existence of the request**\r\n\r\n\u003e  $tg_req-\u003ereqCheck();\r\n\u003e  //return true if exists, else false\r\n---\r\n5. **Delete user request**\r\n\r\n\u003e $tg_req-\u003ereqDel();\r\n---\r\n6. **Handling request**\r\n\r\n\u003e $tg_req-\u003ereqHand();\r\n\u003e //This method will call the corresponding function from the association table.\r\n---\r\n 7. **NOTES**\r\n - Association table is array('req_name'=\u003e'func_name')\r\n - Functions specified in the table may not process passed parameters \r\n\r\n\u003e Some examples you can find at ./exmp\r\n\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fs0d3s%2Ftg-long-req","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fs0d3s%2Ftg-long-req","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fs0d3s%2Ftg-long-req/lists"}