{"id":20020812,"url":"https://github.com/losparviero/grammyaccess","last_synced_at":"2025-10-09T23:14:02.282Z","repository":{"id":182972691,"uuid":"669411056","full_name":"losparviero/grammyAccess","owner":"losparviero","description":"Middleware for grammY. Use this to ensure only authorized Telegram IDs (admins or pro users) can use your bot.","archived":false,"fork":false,"pushed_at":"2023-08-25T14:35:58.000Z","size":7,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-26T23:07:14.400Z","etag":null,"topics":["grammy","grammy-plugin","grammyjs","telegram","telegram-bot","telegram-node"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/grammyaccess","language":"JavaScript","has_issues":true,"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/losparviero.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-07-22T07:28:17.000Z","updated_at":"2023-08-26T09:31:26.000Z","dependencies_parsed_at":null,"dependency_job_id":"807e5dbf-a286-4b30-b4e8-5858e4a2b967","html_url":"https://github.com/losparviero/grammyAccess","commit_stats":{"total_commits":6,"total_committers":1,"mean_commits":6.0,"dds":0.0,"last_synced_commit":"0d1a497b7ad52fedf9ede453af33386a7e714e0c"},"previous_names":["losparviero/grammyaccess"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/losparviero%2FgrammyAccess","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/losparviero%2FgrammyAccess/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/losparviero%2FgrammyAccess/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/losparviero%2FgrammyAccess/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/losparviero","download_url":"https://codeload.github.com/losparviero/grammyAccess/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241454529,"owners_count":19965405,"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":["grammy","grammy-plugin","grammyjs","telegram","telegram-bot","telegram-node"],"created_at":"2024-11-13T08:34:16.314Z","updated_at":"2025-10-09T23:14:02.177Z","avatar_url":"https://github.com/losparviero.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# grammYAccess\n\nAccess control middleware plugin for the [grammY](https://github.com/grammyjs/grammy) framework!\n\n### Features\n\nMiddleware for grammY which lets you implement separate logic for admins or paid/pro users.\n\nUse this to ensure only authorized Telegram IDs (admins) can use your bot or certain features.\n\n### Usage\n\nCopy the plugin code from ```access.js``` and use it in your grammY project.\n\nMessages sent to your bot are checked against user IDs in admin or pro user list.\n\nImplement separate logic for admins and pro users.\n\n### Example\n\n1. To only let paid users access the bot\n\n```node\nbot.on(\"message\" =\u003e (ctx){\n    if (ctx.config.isPro) {\n        ctx.reply(\"Hello 👋 You are a Pro user.\")\n    } else {\n        ctx.reply (\"Please subscribe to a paid plan to use the bot.)\n    }\n})\n```\n\n2. To only let admins access the bot\n\n```node\nbot.on(\"message\" =\u003e (ctx){\n    if (ctx.config.isAdmin) {\n        ctx.reply(\"Hello 👋 You are an admin.\")\n    } else {\n        ctx.reply (\"You are unauthorized to use the bot.\")\n    }\n})\n```\n\n_Note: The admin or pro user list is stored in env_\n\n### Future\n\n1. Implement time based access\n2. Replace env management of access list to db\n\n_Note: 'Admin' here only refers to the list of Telegram IDs included in the env. It has nothing to do with group admins or any other._\n\n### Contribute\n\nIf you'd like to contribute to the project, please read grammY's [guide to plugins](https://grammy.dev/plugins/guide.html), then open a PR.\n\n### License\n\nMIT  ©️ Zubin","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flosparviero%2Fgrammyaccess","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flosparviero%2Fgrammyaccess","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flosparviero%2Fgrammyaccess/lists"}