diff --git a/contribute/index.html b/contribute/index.html index 459229e..1011e0b 100644 --- a/contribute/index.html +++ b/contribute/index.html @@ -29,16 +29,16 @@ 在 parsers 目录下新建一个包, 编写解析器实现 在 parsers/parser.go 的 init 中注册解析器 -如果使用 JavaScript 编写, 请参考 plugins/example_parser.js 的实现, 并在该文件夹下新建一个 js 文件, 实现你的解析逻辑.">参与开发 | Save Any Bot +在 parsers 目录下新建一个包, 编写解析器实现 在 parsers/parser.go 的 init 中注册解析器 如果使用 JavaScript 编写, 请参考 plugins/example_parser_basic.js 的实现, 并在该文件夹下新建一个 js 文件, 实现你的解析逻辑.">参与开发 | Save Any Bot

参与开发

参与开发 #

在开始之前, 请 Fork 本项目, 并克隆到本地, 并确保 Go 版本 >= 1.23.

以下是一些贡献代码的指南或建议, 你不必完全遵守, 但将有助于快速 review 并合并你的提交:

  • 新功能请先提交 Issue, 以便讨论设计和实现细节, 并避免因与项目设计不符而被拒绝.
  • 使用现代开发工具, 确保提交前格式化代码, 并保持风格一致.
  • 使用语义化提交, 避免提交消息模糊或过于简单.

贡献新存储端 #

  1. pkg/enums/storage/storages.go 中添加新的存储端类型, 并运行代码生成
  2. config/storage 目录下定义存储端配置, 并添加到 config/storage/factory.go
  3. storage 目录下新建一个包, 编写存储端实现, 然后在 storage/storage.go 中导入并添加它
  4. 更新文档, 添加配置说明

贡献新解析器 -#

你可以选择使用 Go 编写原生的解析器实现(推荐), 或是使用 JavaScript 以插件的方式实现.

如果使用 Go 编写, 请:

  1. parsers 目录下新建一个包, 编写解析器实现
  2. parsers/parser.goinit 中注册解析器

如果使用 JavaScript 编写, 请参考 plugins/example_parser.js 的实现, 并在该文件夹下新建一个 js 文件, 实现你的解析逻辑.

需要注意, plugins 目录下解析器默认不会被编译到二进制文件中, 用户需要手动下载它们并放到本地指定目录下以启用它们.

\ No newline at end of file diff --git a/sitemap.xml b/sitemap.xml index 5981df9..33aa7c7 100644 --- a/sitemap.xml +++ b/sitemap.xml @@ -1 +1 @@ -https://sabot.unv.app/zh/sitemap.xml2025-08-22T10:02:44+08:00https://sabot.unv.app/en/sitemap.xml2025-06-16T16:30:45+08:00 \ No newline at end of file +https://sabot.unv.app/zh/sitemap.xml2025-08-23T20:42:51+08:00https://sabot.unv.app/en/sitemap.xml2025-06-16T16:30:45+08:00 \ No newline at end of file diff --git a/usage/index.html b/usage/index.html index 6a3bf2f..25c211a 100644 --- a/usage/index.html +++ b/usage/index.html @@ -61,6 +61,6 @@ FILENAME-REGEX MESSAGE-REGEX IS-ALBUM 添加规则的基本语法:">

过滤器类型:

msgre #

正则匹配消息文本, 例如:

/watch 12345678 msgre:.*hello.*
 

这将会监听 ID 为 12345678 的聊天, 并且只保存消息文本中包含 “hello” 的消息.

转存 Telegram 之外的文件 -#

除了 Telegram 上的文件, Bot 还可通过 JavaScript 插件或内置解析器来支持转存其他网站的文件.

查看贡献解析器文档了解详情

只需向 Bot 发送符合解析器要求的链接即可使用, 当前内置的解析器: