{"id":16485982,"url":"https://github.com/roziscoding/grammy-vue","last_synced_at":"2026-06-13T14:33:42.292Z","repository":{"id":90064577,"uuid":"607395887","full_name":"roziscoding/grammy-vue","owner":"roziscoding","description":null,"archived":false,"fork":false,"pushed_at":"2023-02-27T22:28:59.000Z","size":17,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-27T02:55:47.381Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/roziscoding.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}},"created_at":"2023-02-27T22:21:05.000Z","updated_at":"2023-02-27T22:21:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"3d8ed7d8-5af9-42ca-b875-870679ee33cb","html_url":"https://github.com/roziscoding/grammy-vue","commit_stats":{"total_commits":7,"total_committers":1,"mean_commits":7.0,"dds":0.0,"last_synced_commit":"9f33cc04acfb774ebc17e07a01ee3d200e3fbd30"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roziscoding%2Fgrammy-vue","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roziscoding%2Fgrammy-vue/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roziscoding%2Fgrammy-vue/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roziscoding%2Fgrammy-vue/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/roziscoding","download_url":"https://codeload.github.com/roziscoding/grammy-vue/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241279285,"owners_count":19938083,"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":"2024-10-11T13:28:00.684Z","updated_at":"2026-06-13T14:33:37.270Z","avatar_url":"https://github.com/roziscoding.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"grammy-vue\n---\n\nSimple utility hook to call the Telegram API using [grammy](https://grammy.dev) and track the request status with Vue.js refs\n\n## Usage\n\n```html\n\u003c!-- App.vue --\u003e\n\u003cscript lang=\"ts\" setup\u003e\nimport { ref } from 'vue';\nimport { useTelegramApi } from 'grammy-vue';\n\nconst token = ref('')\nconst { useApiMethod } = useTelegramApi(token)\nconst { refresh: getMe, state, data: botInfo, error } = useApiMethod('getMe')\n\u003c/script\u003e\n\n\u003ctemplate\u003e\n  \u003cinput type=\"text\" v-model=\"token\" /\u003e\n  \u003cbutton @click=\"getMe\"\u003eGetMe\u003c/button\u003e\n  \u003cdiv v-if=\"state === 'idle'\"\u003eType the token and click the button\u003c/div\u003e\n  \u003cdiv v-if=\"state === 'loading'\"\u003eLoading bot info...\u003c/div\u003e\n  \u003cdiv v-if=\"state === 'error'\"\u003eGrammy error: {{ error.message }}\u003c/div\u003e\n  \u003cdiv v-if=\"state === 'success'\"\u003eLoaded info for bot {{ botInfo.username }}\u003c/div\u003e\n\u003c/template\u003e\n```\n\n### Resetting status after a set amount of time\n\nThe `useApiMethod` hook takes an optional second parameter, which is the number of milliseconds to wait before setting the state back to `idle`. If you don't specify this parameter, the state will not be automatically reset.\n\n```html\n\u003c!-- App.vue --\u003e\n\u003cscript lang=\"ts\" setup\u003e\nimport { ref } from 'vue';\nimport { useTelegramApi } from 'grammy-vue';\n\nconst token = ref('')\nconst url = ref('')\nconst { useApiMethod } = useTelegramApi(token)\nconst { refresh: setWebhook, state, error } = useApiMethod('setWebhook', 1000) // state will be reset after 1 second\n\u003c/script\u003e\n\n\u003ctemplate\u003e\n  \u003cinput type=\"text\" v-model=\"token\" /\u003e\n  \u003cinput type=\"text\" v-model=\"url\" /\u003e\n  \u003cbutton @click=\"getMe(url)\"\u003eSetWebhook\u003c/button\u003e\n  \u003cdiv v-if=\"state === 'idle'\"\u003eType the token and the url, then click the button\u003c/div\u003e\n  \u003cdiv v-if=\"state === 'loading'\"\u003eSetting webhook...\u003c/div\u003e\n  \u003cdiv v-if=\"state === 'error'\"\u003eGrammy error: {{ error.message }}\u003c/div\u003e\n  \u003cdiv v-if=\"state === 'success'\"\u003eWebhook was set!\u003c/div\u003e\n\u003c/template\u003e\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froziscoding%2Fgrammy-vue","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Froziscoding%2Fgrammy-vue","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froziscoding%2Fgrammy-vue/lists"}