{"id":27133197,"url":"https://github.com/bmqy/notion-tools-bot","last_synced_at":"2026-05-09T00:06:53.547Z","repository":{"id":286564260,"uuid":"960746729","full_name":"bmqy/notion-tools-bot","owner":"bmqy","description":"一个强迫AI开发的可部署到Cloudflare Workers上的Telegram机器人，用于管理Notion数据库和GitHub仓库绑定的Bot应用。","archived":false,"fork":false,"pushed_at":"2025-04-08T03:28:32.000Z","size":77,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-09T23:39:03.587Z","etag":null,"topics":["bot","cloudflare","kv","notion","telegram","workers"],"latest_commit_sha":null,"homepage":"https://notion-tools-bot.bmqy.workers.dev/","language":"TypeScript","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/bmqy.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":"2025-04-05T01:35:35.000Z","updated_at":"2025-04-08T03:28:36.000Z","dependencies_parsed_at":"2025-04-07T08:22:12.918Z","dependency_job_id":"cda99a57-83c6-48c2-9d36-f6dbf3e619bd","html_url":"https://github.com/bmqy/notion-tools-bot","commit_stats":null,"previous_names":["bmqy/notion-tools-bot"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bmqy/notion-tools-bot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bmqy%2Fnotion-tools-bot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bmqy%2Fnotion-tools-bot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bmqy%2Fnotion-tools-bot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bmqy%2Fnotion-tools-bot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bmqy","download_url":"https://codeload.github.com/bmqy/notion-tools-bot/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bmqy%2Fnotion-tools-bot/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32802541,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-08T08:22:46.396Z","status":"ssl_error","status_checked_at":"2026-05-08T08:22:45.650Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["bot","cloudflare","kv","notion","telegram","workers"],"created_at":"2025-04-07T23:19:51.469Z","updated_at":"2026-05-09T00:06:53.522Z","avatar_url":"https://github.com/bmqy.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Notion Tools Bot\n\n一个强迫`AI`开发的可部署到`Cloudflare Workers`上的`Telegram`机器人，用于管理`Notion`数据库和`GitHub`仓库绑定的`Bot`应用。\n\n## 功能特点\n\n- 🤖 `Telegram`机器人管理界面\n- 📦 适用于基于`Notion`作为数据库的静态站点\n- 🔄 指令化关联`Notion`数据库和`GitHub`仓库绑定\n- 🔗 支持多个数据库和仓库的绑定\n- 📝 `Notion`数据库更新时自动触发`GitHub Actions`工作流\n- 📝 指令式触发`Notion`数据库绑定仓库的`GitHub Actions`工作流\n- 🔔 实时接收工作流执行状态消息\n- ⏰ 延时触发，避免频繁触发`GitHub Actions`\n\n## 准备工作\n\n### 申请 Telegram Bot\n- 访问 [Telegram Bot Father](https://t.me/BotFather)\n- 输入`/newbot`，然后输入机器人的名称和描述\n- 获取`BOT_TOKEN`\n\n### Notion Token 获取与 Webhook 配置\n\n#### 1. 创建 Notion 集成\n\n1. 访问 [Notion Integrations](https://www.notion.so/profile/integrations)\n2. 点击`New integration`\n3. 填写集成名称和选择工作区\n4. 保存并获取 `NOTION_TOKEN`\n\n#### 2. 配置数据库权限\n\n1. 在`Notion`中打开要集成的数据库\n2. 点击右上角的`...`菜单\n3. 选择`Add connections`\n4. 选择你创建的集成\n\n#### 3. 设置 Webhook\n\n后续步骤需要等待`workers`项目部署成功后方可继续。\n\n1. 访问 [Notion Webhooks](https://www.notion.so/profile/integrations)\n2. 点击`New webhook`\n3. 选择要监听的数据库\n4. 设置`webhook URL`为你的`Worker URL`（例如：`https://your-worker.workers.dev/api/notion/webhook`）\n5. 保存配置\n\n#### 4. 验证 Webhook\n\n当你设置`webhook URL`时，`Notion`会发送一个验证请求。我们的`Workers`会自动处理这个请求：\n\n1. 当你收到验证请求时，机器人会发送一条消息给你，包含验证令牌\n2. 消息格式如下：\n   ```\n   🔔 Notion Webhook 验证请求\n\n   验证令牌：\n   \u003ccode\u003eyour-verification-token\u003c/code\u003e\n\n   请点击上方令牌复制，然后添加到`Notion webhook`配置中。\n   ```\n3. 点击消息中的令牌即可复制\n4. 将令牌添加到`Notion webhook`配置中完成验证\n\n### 环境变量\n\n准备好`workers`项目运行时所需的环境变量：\n\n```env\n# Notion API 令牌\nNOTION_TOKEN=your_notion_integration_token\n\n# Telegram 配置\nTELEGRAM_BOT_TOKEN=your_telegram_bot_token\nTELEGRAM_ADMIN_USER_ID=your_telegram_user_id\n\n# GitHub 配置\nGITHUB_TOKEN=your_github_personal_access_token\n\n# 延时触发actions\nTRIGGER_DELAY_MINUTES=5\n```\n\n### 获取 KV 命名空间id\n\n- 访问 [Cloudflare Dashboard](https://dash.cloudflare.com)\n- 打开`存储和数据库`\n- 创建一个`KV`\n- 记录下`KV`命名空间`ID`\n\n## 安装部署\n\n1. `fork`本仓库\n\n2. 创建`cloudflare workers`项目\n   - 选择`fork`的仓库\n   - 输入构建变量：\n      - `KV_NAMESPACE_ID`: `KV`命名空间`ID`\n   - 部署项目\n3. 创建完成后，打开`workers`设置面板，填写`运行时`所需的`环境变量`（变量名称处支持多个变量的复制粘贴）\n\n4. 部署成功后，访问 `https://your-worker.workers.dev/`，即可看到机器人的欢迎界面\n\n5. 访问`https://your-worker.workers.dev/api/telegram/setup`，你应该看到`Webhook setup completed`的成功提示\n\n6. 此时可以继续完成`notion webhook`的验证步骤\n\n7. Enjoy the bot!\n\n## 使用说明\n\n1. 发送 `/start` 开始使用\n2. 发送 `/help` 查看帮助\n```\n/list - 列出所有监听的 Notion 数据库\n/bind [数据库ID] [owner/repo] - 添加 Notion 数据库和 GitHub 仓库的绑定\n/unbind - 移除 Notion 数据库和 GitHub 仓库的绑定\n/trigger - 手动触发 GitHub repository_dispatch 事件\n\n使用说明：\n1. 数据库 ID 可以从 Notion 数据库页面的 URL 中获取，格式为 32 位字符串\n2. 添加/移除数据库需要管理员权限\n3. 使用 /list 可以查看当前所有监听的数据库\n4. 使用 /trigger 可以手动触发已关联的 GitHub Action\n```\n\n## 许可证\n\nMIT \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbmqy%2Fnotion-tools-bot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbmqy%2Fnotion-tools-bot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbmqy%2Fnotion-tools-bot/lists"}