Skip to content

Commit

Permalink
Merge pull request #276 from TBXark/dev
Browse files Browse the repository at this point in the history
refactor: typescript重构并添加插件系统
  • Loading branch information
TBXark authored Aug 28, 2024
2 parents c40c7ef + eed134a commit a903084
Show file tree
Hide file tree
Showing 133 changed files with 9,223 additions and 15,779 deletions.
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -149,4 +149,8 @@ out
/wrangler-test.toml
.vercel
.wrangler
package-lock.json
package-lock.json
/plugins/interpolate.js
config.json
/dist/index.cjs
/dist/index.d.ts
16 changes: 16 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM node:alpine as DEV

WORKDIR /app
COPY package.json vite.config.ts tsconfig.json ./
COPY src ./src
RUN npm install && npm run build:local

FROM node:alpine as PROD

WORKDIR /app
COPY --from=DEV /app/dist/index.js /app/dist/index.js
COPY --from=DEV /app/package.json /app/
RUN npm install --only=production --omit=dev
RUN apk add --no-cache sqlite
EXPOSE 8787
CMD ["npm", "run", "start:dist"]
24 changes: 19 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ ChatGPT-Telegram-Workers
<em>Deploy your own Telegram ChatGPT bot on Cloudflare Workers with ease.</em>
</p>


## About

The simplest and fastest way to deploy your own ChatGPT Telegram bot. Use Cloudflare Workers, single file, copy and paste directly, no dependencies required, no need to configure local development environment, no domain name required, serverless.
Expand All @@ -21,35 +22,48 @@ You can customize the system initialization information so that your debugged pe
<img style="max-width: 600px;" alt="image" src="./doc/demo.jpg">
</details>


## Features

- Serverless deployment
- Multi-platform deployment support (Cloudflare Workers, Vercel, Render[...](doc/en/PLATFORM.md))
- Multi-platform deployment support (Cloudflare Workers, Vercel, Docker[...](doc/en/PLATFORM.md))
- Adaptation to multiple AI service providers (OpenAI, Azure OpenAI, Cloudflare AI, Cohere, Anthropic, Mistral...)
- Custom commands (can achieve quick switching of models, switching of robot presets)
- Support for multiple Telegram bots
- Streaming output
- Multi-language support
- Text-to-image generation
- [Plugin System](plugins), customizable plugins.


## Documentation

- [How to deploy](./doc/en/DEPLOY.md)
- [How to set up configuration](./doc/en/CONFIG.md)
- [Deploy Cloudflare Workers](./doc/en/DEPLOY.md)
- [Local (or Docker) deployment](./doc/en/LOCAL.md)
- [Deploy other platforms](./doc/en/PLATFORM.md)
- [Configuration and Commands](./doc/en/CONFIG.md)
- [Automatic update](./doc/en/ACTION.md)
- [Support Platform](./doc/en/PLATFORM.md)
- [Changelog](./doc/en/CHANGELOG.md)
- [Change Log](./doc/en/CHANGELOG.md)


## Related Projects

- [cloudflare-worker-adapter](https://github.com/TBXark/cloudflare-worker-adapter) A simple Cloudflare Worker adapter that allows this project to run independently of Cloudflare Worker.
- [telegram-bot-api-types](https://github.com/TBXark/telegram-bot-api-types) Telegram Bot API SDK with 0 output after compilation, complete documentation, supports all APIs.


## Special thanks

![https://www.jetbrains.com/?from=tbxark](https://user-images.githubusercontent.com/9513891/236592683-1ea579cf-08ff-4703-b313-db038f62bab0.svg)

Thanks for the open-source development license provided by [JetBrains](https://www.jetbrains.com/?from=tbxark).


## Contributors

This project exists thanks to all the people who contribute. [Contribute](https://github.com/tbxark/ChatGPT-Telegram-Workers/graphs/contributors).


## License

**ChatGPT-Telegram-Workers** is released under the MIT license. [See LICENSE](LICENSE) for details.
22 changes: 18 additions & 4 deletions README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ ChatGPT-Telegram-Workers
<em>轻松在Cloudflare Workers上部署您自己的Telegram ChatGPT机器人。</em>
</p>


## 关于

最简单快捷部署属于自己的ChatGPT Telegram机器人的方法。使用Cloudflare Workers,单文件,直接复制粘贴一把梭,无需任何依赖,无需配置本地开发环境,不用域名,免服务器。 可以自定义系统初始化信息,让你调试好的性格永远不消失。
Expand All @@ -18,35 +19,48 @@ ChatGPT-Telegram-Workers
<img style="max-width: 600px;" alt="image" src="doc/demo.jpg">
</details>


## 特性

- 无服务器部署
- 多平台部署支持(Cloudflare Workers, Vercel, Render[...](doc/cn/PLATFORM.md))
- 多平台部署支持(Cloudflare Workers, Vercel, Docker[...](doc/cn/PLATFORM.md))
- 适配多种AI服务商(OpenAI, Azure OpenAI, Cloudflare AI, Cohere, Anthropic, Mistral...)
- 自定义指令(可以实现快速切换模型,切换机器人预设)
- 支持多个Telegram机器人
- 流式输出
- 多语言支持
- 文字生成图片
- [插件系统](plugins),可以自定义插件


## 文档

- [如何部署](./doc/cn/DEPLOY.md)
- [如何进行配置](./doc/cn/CONFIG.md)
- [部署Cloudflare Workers](./doc/cn/DEPLOY.md)
- [本地(或Docker)部署](./doc/cn/LOCAL.md)
- [部署其他平台](./doc/cn/PLATFORM.md)
- [配置参数和指令](./doc/cn/CONFIG.md)
- [自动更新](./doc/cn/ACTION.md)
- [支持平台](./doc/cn/PLATFORM.md)
- [变更日志](./doc/cn/CHANGELOG.md)


## 关联项目

- [cloudflare-worker-adapter](https://github.com/TBXark/cloudflare-worker-adapter) 一个简单的Cloudflare Worker适配器,让本项目脱离Cloudflare Worker独立运行
- [telegram-bot-api-types](https://github.com/TBXark/telegram-bot-api-types) 编译后0输出的Telegram Bot API SDK, 文档齐全,支持所有API


## 特别感谢

![https://www.jetbrains.com/?from=tbxark](https://user-images.githubusercontent.com/9513891/236592683-1ea579cf-08ff-4703-b313-db038f62bab0.svg)

感谢[JetBrains](https://www.jetbrains.com/?from=tbxark)提供的开源开发许可证。


## 贡献者

这个项目存在是因为所有贡献的人。[贡献](https://github.com/tbxark/ChatGPT-Telegram-Workers/graphs/contributors)


## 许可证

**ChatGPT-Telegram-Workers** 以 MIT 许可证发布。[详见 LICENSE](LICENSE) 获取详情。
8 changes: 0 additions & 8 deletions adapter/README.md

This file was deleted.

1 change: 0 additions & 1 deletion adapter/docker/.gitignore

This file was deleted.

8 changes: 0 additions & 8 deletions adapter/docker/Dockerfile

This file was deleted.

24 changes: 0 additions & 24 deletions adapter/docker/README.md

This file was deleted.

5 changes: 0 additions & 5 deletions adapter/docker/esbuild.config.js

This file was deleted.

21 changes: 0 additions & 21 deletions adapter/docker/index.js

This file was deleted.

20 changes: 0 additions & 20 deletions adapter/docker/package.json

This file was deleted.

Loading

0 comments on commit a903084

Please sign in to comment.