koishi-plugin-ccb-plus 0.1.4 → 0.1.6

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 (2) hide show
  1. package/lib/index.js +5 -4
  2. package/package.json +2 -1
package/lib/index.js CHANGED
@@ -126,18 +126,19 @@ function apply(ctx, config) {
126
126
  }
127
127
  try {
128
128
  const memberInfo = await session.bot.getGuildMember(session.guildId, userId);
129
- const nickname = memberInfo?.nick || memberInfo?.name || userId;
129
+ const nickname = memberInfo?.nick || memberInfo?.name || `用户${userId}`;
130
130
  nicknameCache.set(cacheKey, { name: nickname, timestamp: now });
131
131
  return nickname;
132
132
  } catch (error) {
133
133
  try {
134
134
  const userInfo = await session.bot.getUser(userId);
135
- const nickname = userInfo?.name || userId;
135
+ const nickname = userInfo?.name || `用户${userId}`;
136
136
  nicknameCache.set(cacheKey, { name: nickname, timestamp: now });
137
137
  return nickname;
138
138
  } catch (e) {
139
- nicknameCache.set(cacheKey, { name: userId, timestamp: now });
140
- return userId;
139
+ const friendlyName = `用户${userId}`;
140
+ nicknameCache.set(cacheKey, { name: friendlyName, timestamp: now });
141
+ return friendlyName;
141
142
  }
142
143
  }
143
144
  }
package/package.json CHANGED
@@ -1,13 +1,14 @@
1
1
  {
2
2
  "name": "koishi-plugin-ccb-plus",
3
3
  "description": "Koishi插件,与群友发生ccb行为。(移植自astrbot_plugin_ccb_plus)",
4
- "version": "0.1.4",
4
+ "version": "0.1.6",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [
8
8
  "lib",
9
9
  "dist"
10
10
  ],
11
+ "homepage": "https://github.com/muyni233/koishi-plugin-ccb-plus",
11
12
  "license": "AGPL-3.0-only",
12
13
  "keywords": [
13
14
  "chatbot",