{"id":21064044,"url":"https://github.com/luochen1990/simple-echo-bot","last_synced_at":"2025-07-14T03:05:45.927Z","repository":{"id":250547298,"uuid":"834766106","full_name":"luochen1990/simple-echo-bot","owner":"luochen1990","description":"A simple echo IM bot based on nonebot2","archived":false,"fork":false,"pushed_at":"2024-07-28T09:52:33.000Z","size":89,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-20T20:49:52.108Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","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/luochen1990.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":"2024-07-28T09:45:58.000Z","updated_at":"2024-07-28T09:52:36.000Z","dependencies_parsed_at":"2024-07-28T11:10:14.618Z","dependency_job_id":null,"html_url":"https://github.com/luochen1990/simple-echo-bot","commit_stats":null,"previous_names":["luochen1990/simple-echo-bot"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luochen1990%2Fsimple-echo-bot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luochen1990%2Fsimple-echo-bot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luochen1990%2Fsimple-echo-bot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luochen1990%2Fsimple-echo-bot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/luochen1990","download_url":"https://codeload.github.com/luochen1990/simple-echo-bot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243506815,"owners_count":20301758,"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-11-19T17:48:07.292Z","updated_at":"2025-03-14T01:24:52.742Z","avatar_url":"https://github.com/luochen1990.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Simple Echo Bot\n===============\n\n这是一个简单的聊天机器人, 它只干一件事: 把用户对它说的话重复一遍。\n\n你很可能会问, 为什么要搞这么个 bot, 它有什么用?\n\n那实际上, 在代码的世界里, 任何什么都不干的东西都很无用, 但却很有意义. 就像 Unit Type 之于 type system, free monad 之于 monad, etc.\n\n用人话说, 这个机器人的目的就只是作为演示学习, 你可以 fork 它然后开发你自己的机器人并实现更复杂的功能。\n\n技术栈\n-----\n\n- 聊天机器人框架: nonebot2\n- 编程语言: python3.10+\n- 包管理: poetry\n- 可重现打包发布: nix flake\n\n用法\n----\n\n方式1, 不想 git clone 代码, 也不想准备专门的 python 环境, 可以直接以 nix flake 运行 (已经安装 nix 的情况下可用)\n\n```bash\nnix run github:luochen1990/simple-echo-bot\n```\n\n方式2, 不想装 nix, 但有现成的满足条件的 python 环境, 可以 git clone 后在项目目录下运行\n\n```bash\npoetry shell\npython src/bot.py\n```\n\n当然，直接跑一下你会发现它不会工作，毕竟你没有配置任何 bot 所以它当然不会工作，配置的方式也有两种\n\n配置方式1, 环境变量 (你如果用 direnv 的话可以把它放到 .envrc 文件里)\n\n```\nexport TELEGRAM_BOTS='[{\"token\": \"1234567890:ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHI\"}]'\n```\n\n配置方式2, 修改 .env.prod 文件 (当然这个方式就只有在你 git clone 代码之后才能用了)\n\n注意以上是以 telegram 为例子, 如果是其他 IM, 则需要去 [nonebot的适配器商店](https://nonebot.dev/store/adapters) 里找到对应的适配器, 用 `poetry add` 安装, 并从它的 github README 文档里查看如何配置\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluochen1990%2Fsimple-echo-bot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fluochen1990%2Fsimple-echo-bot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluochen1990%2Fsimple-echo-bot/lists"}