koishi-plugin-wordle-game 2.5.4 → 2.5.5

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 +10 -1
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -4947,7 +4947,16 @@ ${content2}
4947
4947
  const userId = match[1];
4948
4948
  const name2 = match[2];
4949
4949
  if (!name2) {
4950
- const guildMember = await session.bot.getGuildMember(session.guildId, userId);
4950
+ let guildMember;
4951
+ try {
4952
+ guildMember = await session.bot.getGuildMember(session.guildId, userId);
4953
+ } catch (error) {
4954
+ guildMember = {
4955
+ user: {
4956
+ name: "未知用户"
4957
+ }
4958
+ };
4959
+ }
4951
4960
  const newAtTag = `<at id="${userId}" name="${guildMember.user.name}"/>`;
4952
4961
  content2 = content2.replace(match[0], newAtTag);
4953
4962
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "koishi-plugin-wordle-game",
3
3
  "description": "欢迎来到 [Wordle](https://www.nytimes.com/games/wordle/index.html) | [汉兜](https://handle.antfu.me/) | [词影](https://cy.surprising.studio/) |... 猜单词|猜成语|猜数字|猜数学方程式|... 的小游戏,支持QQ官方MD模板,且包含多种词库、主题、游戏设置和排行榜系统等。",
4
- "version": "2.5.4",
4
+ "version": "2.5.5",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [