koishi-plugin-chatluna-character 0.0.53 → 0.0.55

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.cjs CHANGED
@@ -102,7 +102,8 @@ async function apply(ctx, config) {
102
102
  );
103
103
  const temp = await service.getTemp(session);
104
104
  const formattedSystemPrompt = await currentPreset.system.format({
105
- time: (/* @__PURE__ */ new Date()).toLocaleString()
105
+ time: (/* @__PURE__ */ new Date()).toLocaleString(),
106
+ stickers: JSON.stringify(stickerService.getAllStickTypes())
106
107
  });
107
108
  logger.debug("messages_new: " + JSON.stringify(recentMessage));
108
109
  logger.debug("messages_last: " + JSON.stringify(lastMessage));
@@ -225,7 +226,7 @@ function isEmoticonStatement(text) {
225
226
  }
226
227
  __name(isEmoticonStatement, "isEmoticonStatement");
227
228
  function isOnlyPunctuation(text) {
228
- const regex = /^[.,;!?…·—–—()【】「」『』《》<>《》{}【】〔〕“”‘’'"\[\]@#¥%\^&\*\-+=|\\~`]+$/;
229
+ const regex = /^[.,;!?…·—–—()【】「」『』《》<>《》{}【】〔〕“”‘’'"\[\]@#¥%\^&\*\-+=|\\~?。`]+$/;
229
230
  return regex.test(text);
230
231
  }
231
232
  __name(isOnlyPunctuation, "isOnlyPunctuation");
@@ -1043,7 +1044,7 @@ function mapElementToString(session, content, elements) {
1043
1044
  if (element.attrs.id === session.bot.selfId) {
1044
1045
  name2 = name2 ?? session.bot.user.name ?? "0";
1045
1046
  }
1046
- if (name2 == null) {
1047
+ if (name2 == null || name2.length < 1) {
1047
1048
  name2 = element.attrs.id ?? "0";
1048
1049
  }
1049
1050
  filteredBuffer.push(`(${name2}-${element.attrs.id}-<at>)`);
package/lib/index.mjs CHANGED
@@ -70,7 +70,8 @@ async function apply(ctx, config) {
70
70
  );
71
71
  const temp = await service.getTemp(session);
72
72
  const formattedSystemPrompt = await currentPreset.system.format({
73
- time: (/* @__PURE__ */ new Date()).toLocaleString()
73
+ time: (/* @__PURE__ */ new Date()).toLocaleString(),
74
+ stickers: JSON.stringify(stickerService.getAllStickTypes())
74
75
  });
75
76
  logger.debug("messages_new: " + JSON.stringify(recentMessage));
76
77
  logger.debug("messages_last: " + JSON.stringify(lastMessage));
@@ -193,7 +194,7 @@ function isEmoticonStatement(text) {
193
194
  }
194
195
  __name(isEmoticonStatement, "isEmoticonStatement");
195
196
  function isOnlyPunctuation(text) {
196
- const regex = /^[.,;!?…·—–—()【】「」『』《》<>《》{}【】〔〕“”‘’'"\[\]@#¥%\^&\*\-+=|\\~`]+$/;
197
+ const regex = /^[.,;!?…·—–—()【】「」『』《》<>《》{}【】〔〕“”‘’'"\[\]@#¥%\^&\*\-+=|\\~?。`]+$/;
197
198
  return regex.test(text);
198
199
  }
199
200
  __name(isOnlyPunctuation, "isOnlyPunctuation");
@@ -1012,7 +1013,7 @@ function mapElementToString(session, content, elements) {
1012
1013
  if (element.attrs.id === session.bot.selfId) {
1013
1014
  name2 = name2 ?? session.bot.user.name ?? "0";
1014
1015
  }
1015
- if (name2 == null) {
1016
+ if (name2 == null || name2.length < 1) {
1016
1017
  name2 = element.attrs.id ?? "0";
1017
1018
  }
1018
1019
  filteredBuffer.push(`(${name2}-${element.attrs.id}-<at>)`);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "koishi-plugin-chatluna-character",
3
3
  "description": "Let the large language model play a role, disguise as a group friend",
4
- "version": "0.0.53",
4
+ "version": "0.0.55",
5
5
  "type": "module",
6
6
  "main": "lib/index.cjs",
7
7
  "module": "lib/index.mjs",