yz-yuki-plugin 1.0.4 → 2.0.2

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/CHANGELOG.md CHANGED
@@ -1,22 +1,31 @@
1
- # 1.0.4
1
+ # 2.0.2
2
+ * 优化Task加载
3
+
4
+ # 2.0.1
5
+ * 规范版本号
6
+ * 调整渲染出图类型为webp格式,减小发送图片消息带宽压力
7
+
8
+ # 2.0.0
2
9
  * 优化代码,npm 包增加 typescript 类型定义文件
3
10
  * 统一配置文件目录:yunzai/data/yuki-plugin/config/,更新后如需使用旧配置文件,请自行移动旧配置文件到新目录
11
+
12
+ # 1.4.0
4
13
  * 优化哔哩登录日志
5
14
  * 优化渲染
6
15
  * 增加哔哩 MAJOR_TYPE_DRAW MAJOR_TYPE_ARTICLE 动态子类型
7
16
 
8
- # 1.0.3
17
+ # 1.3.0
9
18
  * 修复群组与好友动态推送混淆问题
10
19
  * 更新获取B站up信息api
11
20
  * 优化动态字体样式
12
21
  * 优化文字动态内容排版
13
22
  * 修复转发动态内容缺失
14
23
 
15
- # 1.0.2
24
+ # 1.2.0
16
25
  * 新增支持获取完整文章动态内容
17
26
  * 修复宫格样式
18
27
 
19
- # 1.0.1
28
+ # 1.1.0
20
29
  * 修复了一些bug
21
30
  * 优化了一些功能
22
31
  * 新增 Yunzai-v4.1 npm包方式安装支持,yarn add yz-yuki-plugin -W
package/README.md CHANGED
@@ -21,12 +21,12 @@
21
21
  >```
22
22
  接着修改 `yunzaijs/yunzai.config.js`,按版本选择修改方式:
23
23
 
24
- Yunzai-Next v4.1.28+及以上版本:
24
+ Yunzai-Next v4.1.33+及以上版本:
25
25
  ```js
26
26
  import { defineConfig } from 'yunzai'
27
27
  export default defineConfig({
28
28
  applications: ['yz-system', 'yz-yuki-plugin'], //该行添加 'yz-yuki-plugin'
29
- middlewares: ['yz-mw-runtime', 'yunzai-mys/mw']
29
+ middlewares: ['yunzai-mys/runtime', 'yunzai-mys/message']
30
30
  })
31
31
  ```
32
32
 
@@ -1,6 +1,6 @@
1
1
  import JSON from 'json5';
2
2
  import lodash from 'lodash';
3
- import { Messages, setBotTask, Bot, Redis } from 'yunzai';
3
+ import { Messages, Bot, Redis } from 'yunzai';
4
4
  import { BiliQuery } from '../models/bilibili/bilibili.query.js';
5
5
  import { BiliTask } from '../models/bilibili/bilibili.task.js';
6
6
  import Config from '../utils/config.js';
@@ -8,24 +8,12 @@ import { BiliGetWebData } from '../models/bilibili/bilibili.get.web.data.js';
8
8
  import { applyLoginQRCode, pollLoginQRCode, saveLoginCookie, postGateway, exitBiliLogin, checkBiliLogin, readSavedCookieItems, saveLocalBiliCk, readSyncCookie, getNewTempCk, readTempCk } from '../models/bilibili/bilibili.models.js';
9
9
 
10
10
  const message = new Messages('message');
11
- let biliConfigData = Config.getConfigData("config", "bilibili", "config");
12
11
  let biliPushData = Config.getConfigData("config", "bilibili", "push");
13
- setBotTask(async (Bot) => {
14
- try {
15
- newPushTask();
16
- if (biliConfigData.pushTaskLog) {
17
- Bot.logger.mark("yuki插件---B站动态推送定时任务");
18
- }
19
- }
20
- catch (err) {
21
- console.error('B站动态推送定时任务', err);
22
- }
23
- }, biliConfigData.pushStatus ? biliConfigData.pushTime : "");
24
- async function newPushTask(e) {
12
+ async function biliNewPushTask(e) {
25
13
  await new BiliTask(e).runTask();
26
14
  }
27
15
  message.use(async (e) => {
28
- await newPushTask(e);
16
+ await biliNewPushTask(e);
29
17
  }, [/^(#|\/)(yuki|优纪)?执行(b站|B站|bili|bilibili|哔哩|哔哩哔哩)任务$/]);
30
18
  message.use(async (e) => {
31
19
  if (!e.isMaster) {
package/lib/apps/help.js CHANGED
@@ -16,6 +16,10 @@ message.use(async (e) => {
16
16
  }))
17
17
  };
18
18
  const ScreenshotOptionsData = {
19
+ SOptions: {
20
+ type: 'webp',
21
+ quality: 90,
22
+ },
19
23
  isSplit: false,
20
24
  modelName: 'yukiHelp',
21
25
  };
@@ -13,6 +13,10 @@ message.use(async (e) => {
13
13
  }))
14
14
  };
15
15
  const ScreenshotOptionsData = {
16
+ SOptions: {
17
+ type: 'webp',
18
+ quality: 90,
19
+ },
16
20
  isSplit: false,
17
21
  modelName: 'yukiVersion',
18
22
  };
package/lib/apps/weibo.js CHANGED
@@ -1,28 +1,16 @@
1
- import { Messages, setBotTask } from 'yunzai';
1
+ import { Messages } from 'yunzai';
2
2
  import { WeiboQuery } from '../models/weibo/weibo.query.js';
3
3
  import { WeiboTask } from '../models/weibo/weibo.task.js';
4
4
  import Config from '../utils/config.js';
5
5
  import { WeiboGetWebData } from '../models/weibo/weibo.get.web.data.js';
6
6
 
7
7
  const message = new Messages('message');
8
- let weiboConfigData = Config.getConfigData("config", "weibo", "config");
9
8
  let weiboPushData = Config.getConfigData("config", "weibo", "push");
10
- setBotTask(async (Bot) => {
11
- try {
12
- await newPushTask();
13
- if (weiboConfigData.pushTaskLog) {
14
- Bot.logger.mark("yuki插件---微博动态推送定时任务");
15
- }
16
- }
17
- catch (err) {
18
- console.error('微博动态推送定时任务', err);
19
- }
20
- }, weiboConfigData.pushStatus ? weiboConfigData.pushTime : "");
21
- async function newPushTask(e) {
9
+ async function weiboNewPushTask(e) {
22
10
  await new WeiboTask(e).runTask();
23
11
  }
24
12
  message.use(async (e) => {
25
- await newPushTask(e);
13
+ await weiboNewPushTask(e);
26
14
  }, [/^(#|\/)(yuki|优纪)?执行(微博|weibo|WEIBO)任务$/]);
27
15
  message.use(async (e) => {
28
16
  if (!e.isMaster) {
package/lib/index.js CHANGED
@@ -1,8 +1,18 @@
1
1
  import chalk from 'chalk';
2
- import { applicationOptions, useEvent } from 'yunzai';
2
+ import { applicationOptions, setBotTask, useEvent } from 'yunzai';
3
3
  import Config from './utils/config.js';
4
4
  import * as index$1 from './apps/index.js';
5
+ import { BiliTask } from './models/bilibili/bilibili.task.js';
6
+ import { WeiboTask } from './models/weibo/weibo.task.js';
5
7
 
8
+ let biliConfigData = Config.getConfigData("config", "bilibili", "config");
9
+ let weiboConfigData = Config.getConfigData("config", "weibo", "config");
10
+ async function biliNewPushTask(e) {
11
+ await new BiliTask(e).runTask();
12
+ }
13
+ async function weiboNewPushTask(e) {
14
+ await new WeiboTask(e).runTask();
15
+ }
6
16
  var index = () => {
7
17
  const rules = [];
8
18
  return applicationOptions({
@@ -23,6 +33,28 @@ var index = () => {
23
33
  logger.info(chalk.rgb(255, 245, 255)(`https://github.com/snowtafir/yuki-plugin`));
24
34
  logger.info(chalk.rgb(0, 190, 255)(`-----------------------------------------`));
25
35
  logger.info(chalk.rgb(0, 190, 255)(`★ 优纪插件加载完成了喵~`));
36
+ setBotTask(async (Bot) => {
37
+ try {
38
+ biliNewPushTask();
39
+ if (biliConfigData.pushTaskLog) {
40
+ Bot.logger.mark("yuki插件---B站动态推送定时任务");
41
+ }
42
+ }
43
+ catch (err) {
44
+ console.error('B站动态推送定时任务', err);
45
+ }
46
+ }, biliConfigData.pushStatus ? biliConfigData.pushTime : "");
47
+ setBotTask(async (Bot) => {
48
+ try {
49
+ await weiboNewPushTask();
50
+ if (weiboConfigData.pushTaskLog) {
51
+ Bot.logger.mark("yuki插件---微博动态推送定时任务");
52
+ }
53
+ }
54
+ catch (err) {
55
+ console.error('微博动态推送定时任务', err);
56
+ }
57
+ }, weiboConfigData.pushStatus ? weiboConfigData.pushTime : "");
26
58
  },
27
59
  async mounted(e) {
28
60
  const data = [];
@@ -160,7 +160,7 @@ class BiliTask {
160
160
  isSplit: isSplit,
161
161
  modelName: 'bilibili',
162
162
  SOptions: {
163
- type: 'jpeg',
163
+ type: 'webp',
164
164
  quality: 98,
165
165
  },
166
166
  saveHtmlfile: false,
@@ -54,7 +54,7 @@ class VersionData {
54
54
  }
55
55
  return 0;
56
56
  });
57
- this.cache[key] = result.slice(0, 5);
57
+ this.cache[key] = result.slice(0, 10);
58
58
  return this.cache[key];
59
59
  }
60
60
  }
@@ -119,7 +119,7 @@ class WeiboTask {
119
119
  isSplit: isSplit,
120
120
  modelName: 'weibo',
121
121
  SOptions: {
122
- type: 'jpeg',
122
+ type: 'webp',
123
123
  quality: 98,
124
124
  },
125
125
  saveHtmlfile: false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yz-yuki-plugin",
3
- "version": "1.0.4",
3
+ "version": "2.0.2",
4
4
  "description": "优纪插件,yunzaijs 关于 微博推送、B站推送 等功能的拓展插件",
5
5
  "author": "snowtafir",
6
6
  "type": "module",