koishi-plugin-dew-bot 1.0.232 → 1.0.239

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/README.md +23 -0
  2. package/assets/item-card/paper.webp +0 -0
  3. package/assets/leaderboard/README.md +9 -0
  4. package/assets/leaderboard/header.svg +1 -0
  5. package/assets/skill-card/LICENSE.yugioh-card +21 -0
  6. package/assets/skill-card/README.md +4 -0
  7. package/assets/skill-card/card-spell.png +0 -0
  8. package/assets/skill-card/card-trap.png +0 -0
  9. package/lib/index.d.ts +10 -0
  10. package/lib/index.js +1278 -0
  11. package/lib/inits.d.ts +3 -0
  12. package/lib/plugin/cardLayout.d.ts +2 -0
  13. package/lib/plugin/itemCardTemplate.d.ts +3 -0
  14. package/lib/plugin/leaderboardTemplate.d.ts +3 -0
  15. package/lib/plugin/messageQueue.d.ts +11 -0
  16. package/lib/plugin/server.d.ts +21 -0
  17. package/lib/plugin/serverHandel/handel_base.d.ts +9 -0
  18. package/lib/plugin/serverHandel/image.d.ts +5 -0
  19. package/lib/plugin/serverHandel/text.d.ts +5 -0
  20. package/lib/plugin/sessions.d.ts +12 -0
  21. package/lib/plugin/skillArtwork.d.ts +2 -0
  22. package/lib/plugin/skillCard.d.ts +5 -0
  23. package/lib/plugin/skillCardTemplate.d.ts +2 -0
  24. package/lib/shared/bot/MsgMessage.d.ts +7 -0
  25. package/lib/shared/bot/PtlMessage.d.ts +17 -0
  26. package/lib/shared/bot/PtlPing.d.ts +8 -0
  27. package/lib/shared/bot/analysisMsg.d.ts +5 -0
  28. package/lib/shared/bot/protocols/base.d.ts +13 -0
  29. package/lib/shared/bot/serviceProto.d.ts +20 -0
  30. package/lib/shared/face/index.d.ts +81 -0
  31. package/lib/skill-card-preview.cjs +133 -0
  32. package/package.json +17 -22
  33. package/src/index.ts +18 -0
  34. package/src/inits.ts +26 -0
  35. package/src/plugin/cardLayout.ts +29 -0
  36. package/src/plugin/itemCardTemplate.ts +19 -0
  37. package/src/plugin/leaderboardTemplate.ts +26 -0
  38. package/src/plugin/messageQueue.ts +36 -0
  39. package/src/plugin/server.ts +154 -0
  40. package/src/plugin/serverHandel/handel_base.ts +26 -0
  41. package/src/plugin/serverHandel/image.ts +21 -0
  42. package/src/plugin/serverHandel/text.ts +10 -0
  43. package/src/plugin/sessions.ts +30 -0
  44. package/src/plugin/skillArtwork.ts +29 -0
  45. package/src/plugin/skillCard.ts +67 -0
  46. package/src/plugin/skillCardTemplate.ts +12 -0
  47. package/src/shared/bot/MsgMessage.ts +8 -0
  48. package/src/shared/bot/PtlMessage.ts +22 -0
  49. package/src/shared/bot/PtlPing.ts +13 -0
  50. package/src/shared/bot/analysisMsg.ts +29 -0
  51. package/src/shared/bot/protocols/base.ts +16 -0
  52. package/src/shared/bot/serviceProto.ts +679 -0
  53. package/src/shared/face/index.ts +69 -0
  54. package/dist/html/css/body.css +0 -287
  55. package/dist/html/css/panel_common.css +0 -102
  56. package/dist/html/css/ranking.css +0 -215
  57. package/dist/html/page/body.html +0 -96
  58. package/dist/html/page/panel_common.html +0 -82
  59. package/dist/html/page/ranking.html +0 -257
  60. package/dist/html/res/avatar.jpg +0 -0
  61. package/dist/html/res/body/box.png +0 -0
  62. package/dist/html/res/body/share/test.png +0 -0
  63. package/dist/html/res/body/title/test.png +0 -0
  64. package/dist/html/res/body/title/test1.png +0 -0
  65. package/dist/html/res/font/cn.ttf +0 -0
  66. package/dist/html/res/font/xiaomai.ttf +0 -0
  67. package/dist/html/res/vue2.js +0 -11
  68. package/dist/index.js +0 -18
  69. package/dist/inits.js +0 -30
  70. package/dist/plugin/messageQueue.js +0 -136
  71. package/dist/plugin/puppeteer.js +0 -79
  72. package/dist/plugin/server.js +0 -219
  73. package/dist/plugin/serverHandel/handel_base.js +0 -36
  74. package/dist/plugin/serverHandel/image.js +0 -18
  75. package/dist/plugin/serverHandel/none.js +0 -15
  76. package/dist/plugin/serverHandel/text.js +0 -17
  77. package/dist/plugin/sessions.js +0 -35
  78. package/dist/shared/bot/AnalysisClass/class_battleLog.js +0 -104
  79. package/dist/shared/bot/AnalysisClass/class_skillDetail.js +0 -152
  80. package/dist/shared/bot/MsgMessage.js +0 -2
  81. package/dist/shared/bot/PtlMessage.js +0 -6
  82. package/dist/shared/bot/analysisMsg.js +0 -65
  83. package/dist/shared/bot/protocols/base.js +0 -2
  84. package/dist/shared/bot/serviceProto.js +0 -352
  85. package/dist/shared/face/index.js +0 -23
  86. package/readme.md +0 -80
package/README.md ADDED
@@ -0,0 +1,23 @@
1
+ # koishi-plugin-dew-bot
2
+
3
+ Koishi 插件:把聊天消息交给 dew-v7 Bot 游戏服处理,再把服务器推送的文字发回会话。
4
+
5
+ ## 安装
6
+
7
+ 在 Koishi 模板项目中把本仓库放到 `external/dew-bot`,然后安装依赖并启用插件。
8
+
9
+ ```yaml
10
+ plugins:
11
+ dew-bot:
12
+ 服务器地址: ws://127.0.0.1:3021
13
+ ```
14
+
15
+ 游戏服需先启动 Bot 进程(默认 WebSocket `3021`)。
16
+
17
+ ## 配置
18
+
19
+ | 项 | 说明 | 默认 |
20
+ | --- | --- | --- |
21
+ | 服务器地址 | 游戏服 WebSocket 地址 | `ws://127.0.0.1:3021` |
22
+
23
+ 插件会忽略机器人自己发出的消息,避免回显再次上传形成循环。
Binary file
@@ -0,0 +1,9 @@
1
+ # 排行榜顶部素材
2
+
3
+ 默认 `header.svg` 是项目自绘的山景背景,标题由程序实时叠加,不写在图片里。
4
+
5
+ 替换方式:在此目录放入 `header.png`、`header.jpg` 或 `header.webp`。优先顺序为 PNG → JPG → WebP → SVG。建议 1000×400 或同等横向比例,使用无标题背景,中心区域留给榜单标题。
6
+
7
+ 背景每次生成图片时读取,替换后下一张生效。部署需连同 `assets/` 一起复制。缺少素材时退回深色渐变背景。
8
+
9
+ 中文标题使用楷体 KaiTi/STKaiti,正文微软雅黑,数值 Georgia。Linux 部署安装 Noto Serif CJK SC、Noto Sans CJK SC 和 Noto Color Emoji;字体安装完成后重启绘图浏览器。Emoji 的覆盖范围取决于系统字体版本。
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="1000" height="400" viewBox="0 0 1000 400"><defs><linearGradient id="sky" x2="0" y2="1"><stop stop-color="#697c89"/><stop offset="1" stop-color="#152331"/></linearGradient><radialGradient id="moon"><stop stop-color="#fff8d4"/><stop offset="1" stop-color="#ddc995"/></radialGradient></defs><path fill="url(#sky)" d="M0 0h1000v400H0z"/><circle cx="851" cy="111" r="55" fill="url(#moon)"/><g fill="#a9b4b5" opacity=".3"><path d="m0 145 74-80 49 40 94-104 125 156 130-100 130 95 103-90 165 108 130-82v312H0z"/></g><path d="m0 200 64-85 65 66 81-101 115 172 92-70 112 49 147-130 80 85 120-53 124 124v143H0z" fill="#263b49" opacity=".7"/><path d="m0 310 125-79 110 65 120-37 145 68 130-56 121 41 138-110 111 57v141H0z" fill="#101e2a"/><g fill="none" stroke="#c5b17e" opacity=".22"><path d="M24 311h210m-130 8h102m526-18h240m-180 10h111M380 354h262"/></g><g fill="#13232d" transform="translate(600 34)"><path d="M-55 49Q-14 47 0 15Q14 47 55 49L35 58H-35zM-65 90Q-14 89 0 59Q14 89 65 90L43 102H-43z"/><path d="M-28 56h56v37h-56zM-35 100h70v42h-70z"/></g></svg>
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023-present kooriookami
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,4 @@
1
+ 卡框素材来源:https://github.com/kooriookami/yugioh-card
2
+ 固定版本:92462bbd2aa3aa0075ebcc9b633bdc05137fd7ac
3
+ 仅使用 card-spell.png / card-trap.png,许可见 LICENSE.yugioh-card。
4
+ 技能文字、品质徽标、技能图案由本项目实时绘制。
Binary file
Binary file
package/lib/index.d.ts ADDED
@@ -0,0 +1,10 @@
1
+ import { Context, Schema } from 'koishi';
2
+ export declare const inject: {
3
+ optional: string[];
4
+ };
5
+ export declare const name = "dew-bot";
6
+ export interface Config {
7
+ 服务器地址: string;
8
+ }
9
+ export declare const Config: Schema<Config>;
10
+ export declare function apply(ctx: Context, config: Config): void;