{"id":39968132,"url":"https://github.com/s0ftik3/telegraf-userblock","last_synced_at":"2026-01-18T22:04:13.723Z","repository":{"id":57376626,"uuid":"452279655","full_name":"s0ftik3/telegraf-userblock","owner":"s0ftik3","description":"Handling if user blocked the bot middleware for Telegraf.","archived":false,"fork":false,"pushed_at":"2022-01-27T11:16:34.000Z","size":2,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-06T06:00:42.705Z","etag":null,"topics":["bots","telegraf","telegram"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/telegraf-userblock","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/s0ftik3.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":"2022-01-26T13:09:25.000Z","updated_at":"2023-07-15T09:29:18.000Z","dependencies_parsed_at":"2022-08-29T21:20:46.666Z","dependency_job_id":null,"html_url":"https://github.com/s0ftik3/telegraf-userblock","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/s0ftik3/telegraf-userblock","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/s0ftik3%2Ftelegraf-userblock","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/s0ftik3%2Ftelegraf-userblock/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/s0ftik3%2Ftelegraf-userblock/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/s0ftik3%2Ftelegraf-userblock/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/s0ftik3","download_url":"https://codeload.github.com/s0ftik3/telegraf-userblock/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/s0ftik3%2Ftelegraf-userblock/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28552230,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T20:59:07.572Z","status":"ssl_error","status_checked_at":"2026-01-18T20:59:02.799Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["bots","telegraf","telegram"],"created_at":"2026-01-18T22:04:12.708Z","updated_at":"2026-01-18T22:04:13.713Z","avatar_url":"https://github.com/s0ftik3.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Telegraf User Block\n\n[Telegraf (Telegram bot framework)](https://github.com/telegraf/telegraf) middleware that helps you to handle users who blocked your bot.\n\n## Installation\n\n```js\n$ npm i telegraf-userblock\n```\n\n## Example\n\n```js\nconst Telegraf = require('telegraf');\nconst userBlock = require('telegraf-userblock');\n\nconst bot = new Telegraf(process.env.TOKEN);\n\nbot.use(\n    userBlock({\n        onUserBlock: (ctx, next, userId) =\u003e {\n            console.log('This user %s has blocked the bot.', userId);\n            return next();\n        },\n    })\n);\n\nbot.launch();\n```\n\n## API\n\n### Options\n\n-   `onUserBlock`: action after some user blocked your bot.\n\n```js\n{\n    onUserBlock: (ctx, next, userId) =\u003e {\n        // ctx — current context\n        // next — go ahead after work of middleware's done\n        // userId — id of the user who blocked the bot, alternatively you could use ctx.update.my_chat_member.from.id\n    },\n};\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fs0ftik3%2Ftelegraf-userblock","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fs0ftik3%2Ftelegraf-userblock","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fs0ftik3%2Ftelegraf-userblock/lists"}