koishi-plugin-xxck-1 0.3.1 → 0.3.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/lib/index.js CHANGED
@@ -1443,7 +1443,7 @@ async function getOpenEventPool(ctx) {
1443
1443
  }
1444
1444
  __name(getOpenEventPool, "getOpenEventPool");
1445
1445
  async function _do_event_add(ctx, session, data, masterQQ) {
1446
- const userQQ = session.unifiedQQ || session.userId;
1446
+ const userQQ = await getUnifiedQQ(ctx, session);
1447
1447
  if (userQQ !== masterQQ) {
1448
1448
  return await session.send(build_msg(session, session.text("error.common.noPermission")));
1449
1449
  }
@@ -1955,7 +1955,7 @@ async function apply(ctx, config) {
1955
1955
  });
1956
1956
  ctx.on("message", async (session) => {
1957
1957
  const guildId = session.guildId;
1958
- const userId = session.unifiedQQ || session.userId?.toString();
1958
+ const userId = await getUnifiedQQ(ctx, session);
1959
1959
  if (!guildId || !userId) return;
1960
1960
  try {
1961
1961
  const member = await session.bot.getGuildMember(guildId, userId);
@@ -2167,8 +2167,6 @@ async function apply(ctx, config) {
2167
2167
  );
2168
2168
  return;
2169
2169
  }
2170
- session.unifiedQQ = unifiedQQ;
2171
- ctx.logger.info("[中间件] 已挂载 unifiedQQ: " + unifiedQQ);
2172
2170
  const switchCmds = ["WWC开启", "WWC关闭", "WWC开启全部", "WWC关闭全部"];
2173
2171
  if (switchCmds.some((cmd) => raw.startsWith(cmd))) return next();
2174
2172
  const globalSwitch = await ctx.database.get("gacha_global_switch", { id: 1 });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "koishi-plugin-xxck-1",
3
3
  "description": "抽卡系统|完整指令说明见readme|建议使用skia-canvas",
4
- "version": "0.3.1",
4
+ "version": "0.3.2",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [
package/readme.md CHANGED
@@ -106,7 +106,9 @@
106
106
  - 指令:WWChelp
107
107
  - 示例:WWChelp
108
108
  - 说明:随时调用,查看所有指令用法
109
+
109
110
  ==========================================
111
+
110
112
  💡 提示:所有指令前缀为「WWC」,区分大小写;抽卡/兑换次数超出限制会自动提示
111
113
 
112
114
  0.3.1更新: