koishi-plugin-chat-analyse 1.1.0 → 1.1.1
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.
- package/lib/index.js +1 -3
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -1553,7 +1553,6 @@ var Renderer = class {
|
|
|
1553
1553
|
*/
|
|
1554
1554
|
async htmlToImage(fullHtmlContent) {
|
|
1555
1555
|
const page = await this.ctx.puppeteer.page();
|
|
1556
|
-
page.on("console", (msg) => this.ctx.logger.info(`[Puppeteer Console] ${msg.text()}`));
|
|
1557
1556
|
try {
|
|
1558
1557
|
await page.setViewport({ width: 720, height: 1080, deviceScaleFactor: 2 });
|
|
1559
1558
|
await page.setContent(fullHtmlContent, { waitUntil: "networkidle0" });
|
|
@@ -1567,7 +1566,6 @@ var Renderer = class {
|
|
|
1567
1566
|
this.ctx.logger.error("图片渲染失败:", error);
|
|
1568
1567
|
return null;
|
|
1569
1568
|
} finally {
|
|
1570
|
-
page.off("console", (msg) => this.ctx.logger.info(`[Puppeteer Console] ${msg.text()}`));
|
|
1571
1569
|
await page.close().catch((e) => this.ctx.logger.error("关闭页面失败:", e));
|
|
1572
1570
|
}
|
|
1573
1571
|
}
|
|
@@ -2148,7 +2146,7 @@ var Analyse = class {
|
|
|
2148
2146
|
*/
|
|
2149
2147
|
registerCommands(cmd) {
|
|
2150
2148
|
if (this.config.enableWordCloud) {
|
|
2151
|
-
cmd.subcommand("wordcloud", "生成词云").usage("基于聊天记录生成词云图,可指定范围,默认当前群组。").option("guild", "-g <guildId:string> 指定群组").option("user", "-u <user:string> 指定用户").option("hours", "-
|
|
2149
|
+
cmd.subcommand("wordcloud", "生成词云").usage("基于聊天记录生成词云图,可指定范围,默认当前群组。").option("guild", "-g <guildId:string> 指定群组").option("user", "-u <user:string> 指定用户").option("hours", "-t <hours:number> 指定时长", { fallback: 24 }).option("all", "-a 全局").action(async ({ session, options }) => {
|
|
2152
2150
|
if (!this.jieba) return "Jieba 分词服务未就绪";
|
|
2153
2151
|
const scope = await parseQueryScope(this.ctx, session, options);
|
|
2154
2152
|
if (scope.error) return scope.error;
|