{"id":13815844,"url":"https://github.com/easychen/telechan","last_synced_at":"2025-05-15T09:34:07.799Z","repository":{"id":37741357,"uuid":"359162819","full_name":"easychen/telechan","owner":"easychen","description":"message api for telegram bot  可供多人发送消息的 telegram 机器人 api ， 类似server酱的开源实现","archived":true,"fork":false,"pushed_at":"2021-07-10T09:41:22.000Z","size":31,"stargazers_count":414,"open_issues_count":3,"forks_count":295,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-11-19T11:54:26.866Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"telechan8.vercel.app","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/easychen.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":"2021-04-18T14:16:22.000Z","updated_at":"2024-11-17T08:34:21.000Z","dependencies_parsed_at":"2022-08-24T16:21:30.706Z","dependency_job_id":null,"html_url":"https://github.com/easychen/telechan","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/easychen%2Ftelechan","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/easychen%2Ftelechan/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/easychen%2Ftelechan/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/easychen%2Ftelechan/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/easychen","download_url":"https://codeload.github.com/easychen/telechan/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254314207,"owners_count":22050192,"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-08-04T04:04:13.640Z","updated_at":"2025-05-15T09:34:07.793Z","avatar_url":"https://github.com/easychen.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"⚠️⚠️⚠️ 由于近期 vercel 环境疑似做了调整，新部署的机器人识别命令会报错(原来创建的机器人不受影响)，我最近没空修改此项目，先 Archive 掉。着急使用的同学可以 fork \u0026 fix 先。\n\n# TeleChan - message api for telegram bot \n\u003e 可供多人发送消息的 telegram 机器人 api ， 类似server酱的开源实现\n\n## 🎈 本项目属于方糖推送生态。该生态包含项目如下：\n\n- [Server酱Turbo](https://sct.ftqq.com)：支持企业微信、微信服务号、钉钉、飞书群机器人等多通道的在线服务，无需搭建直接使用，每天有免费额度\n- [Wecom酱](https://github.com/easychen/wecomchan)：通过企业微信推送消息到微信的消息推送函数和在线服务方案，开源免费，可自己搭建。支持多语言\n- [Tele酱](https://github.com/easychen/telechan)：可以通过 Vercel 免费部署，且部署后 API 在国内网络可访问的 Telegram 多账户消息推送机器人\n\n## 直接试用我搭建的机器人\n\n1. 添加 @TeleChan8Bot\n2. 发送 /sendkey 获得 key 和 url\n3. 通过 url 发送请求即可\n\n## Example\n\n1. add @TeleChan8Bot in telegram\n2. `/sendkey` to get key \u0026 url\n3. send request via url \n\n## How to use\n\n1. star and fork this repo\n2. goto https://vercel.com/ create a new project, select the repo just created\n3. add [BotFather](https://t.me/botfather) in telegram, create new bot and get `telegram api token` \n4. set output dir to `dist` , set `BOT_TOKEN` to `telegram api token`, set `TCKEY` a random string ![image](https://user-images.githubusercontent.com/1294760/115171377-7c6ecd00-a0f5-11eb-8677-86f207ceb724.png)\n5. deploy\n6. send /sendkey command to the bot, you will get sendkey and api url\n\n## API\n\nBoth HTTP `GET` or `POST` are OK \n\n- sendkey,required\n- text,required\n- desp,optional\n- markdown,optional\n\n`text` and `desp` support [telegram markdown](https://core.telegram.org/bots/api#markdownv2-style) which is a very small subset of markdown without image support\n\n### send function \n\n```php\nfunction tg_send(  $text , $desp = '' , $key = '\u003csendkey\u003e'  )\n{\n    $postdata = http_build_query( array( 'text' =\u003e $text, 'desp' =\u003e $desp ));\n    $opts = array('http' =\u003e\n    array(\n        'method'  =\u003e 'POST',\n        'header'  =\u003e 'Content-type: application/x-www-form-urlencoded',\n        'content' =\u003e $postdata));\n    \n    $context  = stream_context_create($opts);\n    return $result = file_get_contents('telechan8.vercel.app/api/send?sendkey='.$key, false, $context);\n \n}\n```\n\n## Thanks\n\nHeavily modified base [Telegram Bot Boilerplate with Vercel's Serverless Functions](https://github.com/waptik/telegram-bot-boilerplate-now-serverless-api)\n\n\n## 中文教程\n\n[![image](https://user-images.githubusercontent.com/1294760/115172022-f05da500-a0f6-11eb-9bb8-5919442523c6.png)](https://www.bilibili.com/video/BV1S5411c7Vy/)\n\n[安装视频@B站，欢迎关注作者](https://www.bilibili.com/video/BV1S5411c7Vy/)\n\n参数说明：\n\n- sendkey,required\n- text,required\n- desp,optional\n- markdown,optional\n\n仅支持部分 Markdown 语法，任何不兼容以下语法的的提交，都会导致 400 错误。[注意不支持图片](https://core.telegram.org/bots/api#markdownv2-style)，注意不支持图片，注意不支持图片：\n\n```\n    *bold \\*text*\n    _italic \\*text_\n    __underline__\n    ~strikethrough~\n    *bold _italic bold ~italic bold strikethrough~ __underline italic bold___ bold*\n    [inline URL](http://www.example.com/)\n    [inline mention of a user](tg://user?id=123456789)\n    `inline fixed-width code`\n    ```\n    pre-formatted fixed-width code block\n    ```\n    ```python\n    pre-formatted fixed-width code block written in the Python programming language\n    ```\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feasychen%2Ftelechan","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feasychen%2Ftelechan","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feasychen%2Ftelechan/lists"}