wechaty-web-panel 1.6.16 → 1.6.17

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,6 +1,6 @@
1
1
  ## 更新日志
2
2
 
3
- ### V1.6.16(2023-08-12)
3
+ ### V1.6.17(2023-08-12)
4
4
  1、优化换行在windows中的发送
5
5
  2、优化rss内容发送
6
6
  3、优化小程序解析地址
@@ -70,6 +70,9 @@ class DifyAi {
70
70
  if (systemMessage || content === 'reset' || content === '重置') {
71
71
  console.log('重新更新上下文对话');
72
72
  this.chatOption[uid] = {};
73
+ if (content === 'reset' || content === '重置') {
74
+ return [{ type: 1, content: '上下文已重置' }];
75
+ }
73
76
  }
74
77
  console.log('this.chatOption[uid]', this.chatOption[uid]);
75
78
  const { conversationId, text } = systemMessage ? await this.difyChat.sendMessage(content, { ...this.chatOption[uid], systemMessage, timeoutMs: this.config.timeoutMs * 1000 || 80 * 1000, user: uid }) : await this.difyChat.sendMessage(content, { ...this.chatOption[uid], timeoutMs: this.config.timeoutMs * 1000 || 80 * 1000, user: uid });
@@ -128,6 +128,9 @@ class OfficialOpenAi {
128
128
  if (systemMessage || content === 'reset' || content === '重置') {
129
129
  console.log('重新更新上下文对话');
130
130
  this.chatOption[uid] = {};
131
+ if (content === 'reset' || content === '重置') {
132
+ return [{ type: 1, content: '上下文已重置' }];
133
+ }
131
134
  }
132
135
  const { conversationId, text, id } = systemMessage ? await this.chatGPT.sendMessage(content, { ...this.chatOption[uid], systemMessage, timeoutMs: this.config.timeoutMs * 1000 || 80 * 1000 }) : await this.chatGPT.sendMessage(content, { ...this.chatOption[uid], timeoutMs: this.config.timeoutMs * 1000 || 80 * 1000 });
133
136
  if (this.config.filter) {
@@ -87,6 +87,9 @@ class UnOfficialOpenAi {
87
87
  question = systemMessage + content;
88
88
  console.log('重新更新上下文对话');
89
89
  this.chatOption[uid] = {};
90
+ if (content === 'reset' || content === '重置') {
91
+ return [{ type: 1, content: '上下文已重置' }];
92
+ }
90
93
  }
91
94
  const { conversationId, text, id } = systemMessage ? await this.chatGPT.sendMessage(question, { ...this.chatOption[uid], systemMessage, timeoutMs: this.config.timeoutMs * 1000 || 80 * 1000 }) : await this.chatGPT.sendMessage(question, { ...this.chatOption[uid], timeoutMs: this.config.timeoutMs * 1000 || 80 * 1000 });
92
95
  if (this.config.record) {
@@ -6,7 +6,7 @@ exports.packageJson = void 0;
6
6
  */
7
7
  exports.packageJson = {
8
8
  "name": "wechaty-web-panel",
9
- "version": "1.6.16",
9
+ "version": "1.6.17",
10
10
  "description": "智能微秘书插件",
11
11
  "exports": {
12
12
  ".": {
@@ -45,11 +45,11 @@ async function getRssContent(info) {
45
45
  async function setContent(feed, info) {
46
46
  const eol = await (0, puppet_type_js_1.getPuppetEol)();
47
47
  if (info.showLink) {
48
- const res = { type: 4, url: feed.link, title: (0, index_js_1.delHtmlTag)(feed.title), description: (0, index_js_1.delHtmlTag)(feed.content.substring(0, 80)), thumbUrl: info.thumbUrl };
48
+ const res = { type: 4, url: feed.link, title: (0, index_js_1.delHtmlTag)(feed.title), description: (0, index_js_1.delHtmlTag)(feed.content).substring(0, 80), thumbUrl: info.thumbUrl };
49
49
  return [res];
50
50
  }
51
51
  else {
52
- const content = `${info.prefixWord ? info.prefixWord + eol + eol : ''}《${(0, index_js_1.delHtmlTag)(feed.title)}》${eol}【原链接】:${feed.link}${eol}【摘要】:${(0, index_js_1.delHtmlTag)(feed.content.substring(0, 300))}...${eol}${eol}${info.suffixWord || ''}`;
52
+ const content = `${info.prefixWord ? info.prefixWord + eol + eol : ''}${(0, index_js_1.delHtmlTag)(feed.title)}${eol}${eol}【摘要】:${(0, index_js_1.delHtmlTag)(feed.content).substring(0, 300)}...${eol}【链接】:${feed.link}${eol}${eol}${info.suffixWord || ''}`;
53
53
  return [{ type: 1, content: content }];
54
54
  }
55
55
  }
@@ -65,6 +65,9 @@ class DifyAi {
65
65
  if (systemMessage || content === 'reset' || content === '重置') {
66
66
  console.log('重新更新上下文对话');
67
67
  this.chatOption[uid] = {};
68
+ if (content === 'reset' || content === '重置') {
69
+ return [{ type: 1, content: '上下文已重置' }];
70
+ }
68
71
  }
69
72
  console.log('this.chatOption[uid]', this.chatOption[uid]);
70
73
  const { conversationId, text } = systemMessage ? await this.difyChat.sendMessage(content, { ...this.chatOption[uid], systemMessage, timeoutMs: this.config.timeoutMs * 1000 || 80 * 1000, user: uid }) : await this.difyChat.sendMessage(content, { ...this.chatOption[uid], timeoutMs: this.config.timeoutMs * 1000 || 80 * 1000, user: uid });
@@ -123,6 +123,9 @@ class OfficialOpenAi {
123
123
  if (systemMessage || content === 'reset' || content === '重置') {
124
124
  console.log('重新更新上下文对话');
125
125
  this.chatOption[uid] = {};
126
+ if (content === 'reset' || content === '重置') {
127
+ return [{ type: 1, content: '上下文已重置' }];
128
+ }
126
129
  }
127
130
  const { conversationId, text, id } = systemMessage ? await this.chatGPT.sendMessage(content, { ...this.chatOption[uid], systemMessage, timeoutMs: this.config.timeoutMs * 1000 || 80 * 1000 }) : await this.chatGPT.sendMessage(content, { ...this.chatOption[uid], timeoutMs: this.config.timeoutMs * 1000 || 80 * 1000 });
128
131
  if (this.config.filter) {
@@ -82,6 +82,9 @@ class UnOfficialOpenAi {
82
82
  question = systemMessage + content;
83
83
  console.log('重新更新上下文对话');
84
84
  this.chatOption[uid] = {};
85
+ if (content === 'reset' || content === '重置') {
86
+ return [{ type: 1, content: '上下文已重置' }];
87
+ }
85
88
  }
86
89
  const { conversationId, text, id } = systemMessage ? await this.chatGPT.sendMessage(question, { ...this.chatOption[uid], systemMessage, timeoutMs: this.config.timeoutMs * 1000 || 80 * 1000 }) : await this.chatGPT.sendMessage(question, { ...this.chatOption[uid], timeoutMs: this.config.timeoutMs * 1000 || 80 * 1000 });
87
90
  if (this.config.record) {
@@ -3,7 +3,7 @@
3
3
  */
4
4
  export const packageJson = {
5
5
  "name": "wechaty-web-panel",
6
- "version": "1.6.16",
6
+ "version": "1.6.17",
7
7
  "description": "智能微秘书插件",
8
8
  "exports": {
9
9
  ".": {
@@ -39,11 +39,11 @@ async function getRssContent(info) {
39
39
  async function setContent(feed, info) {
40
40
  const eol = await getPuppetEol();
41
41
  if (info.showLink) {
42
- const res = { type: 4, url: feed.link, title: delHtmlTag(feed.title), description: delHtmlTag(feed.content.substring(0, 80)), thumbUrl: info.thumbUrl };
42
+ const res = { type: 4, url: feed.link, title: delHtmlTag(feed.title), description: delHtmlTag(feed.content).substring(0, 80), thumbUrl: info.thumbUrl };
43
43
  return [res];
44
44
  }
45
45
  else {
46
- const content = `${info.prefixWord ? info.prefixWord + eol + eol : ''}《${delHtmlTag(feed.title)}》${eol}【原链接】:${feed.link}${eol}【摘要】:${delHtmlTag(feed.content.substring(0, 300))}...${eol}${eol}${info.suffixWord || ''}`;
46
+ const content = `${info.prefixWord ? info.prefixWord + eol + eol : ''}${delHtmlTag(feed.title)}${eol}${eol}【摘要】:${delHtmlTag(feed.content).substring(0, 300)}...${eol}【链接】:${feed.link}${eol}${eol}${info.suffixWord || ''}`;
47
47
  return [{ type: 1, content: content }];
48
48
  }
49
49
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wechaty-web-panel",
3
- "version": "1.6.16",
3
+ "version": "1.6.17",
4
4
  "description": "智能微秘书插件",
5
5
  "exports": {
6
6
  ".": {