koishi-plugin-discourse-linkshot
v1.0.6
Published
Render Discourse topic links into chat-friendly snapshots.
Maintainers
Readme
koishi-plugin-discourse-linkshot
用于 Koishi 的 Discourse 论坛链接截图插件。
当聊天中出现指定论坛的帖子链接时,插件会自动识别并发送截图。
功能
- 自动识别指定 Discourse 论坛链接
- 默认截图首楼内容
- 链接带楼层号时,可附加对应回复
- 支持权限帖 Cookie 抓取
- 支持展开
details、spoiler等隐藏内容 - 支持代理与 DoH
- 支持浏览器复用或每次渲染后关闭浏览器
安装
npm i koishi-plugin-discourse-linkshot依赖
需要本地可执行浏览器,并在配置中填写完整路径,例如:
C:\Program Files\Google\Chrome\Application\chrome.exe示例配置
plugins:
discourse-linkshot:
enabled: true
forumOrigin: https://forum.example.com
tCookie: _forum_session=...; _t=...
executablePath: C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe
proxyServer: http://127.0.0.1:7890
dohEnabled: false
dohTemplates: ''
pageWaitUntil: domcontentloaded
browserTimeout: 30000
closeBrowserAfterCapture: false常用配置
forumOrigin:要监听的论坛地址tCookie:权限帖使用的 Cookie,可填_t或完整 CookieexecutablePath:浏览器路径proxyServer:代理地址dohEnabled:是否启用 DoHdohTemplates:自定义 DoH 地址pageWaitUntil:页面等待方式,推荐domcontentloadedbrowserTimeout:浏览器启动超时,0表示不检测closeBrowserAfterCapture:截图后立即关闭浏览器
说明
如果要抓取权限帖,建议直接从浏览器开发者工具里复制完整 Cookie,粘贴到 tCookie。
本插件更适合自用或私有部署场景。
