koishi-plugin-bcjh-uidtransfer 0.0.2 → 0.0.4

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 +2 -2
package/lib/index.js CHANGED
@@ -40,6 +40,7 @@ function apply(ctx, config) {
40
40
  /** 获取用户自己信息 */
41
41
  async getUserInfo(session) {
42
42
  const uid = session.user.id;
43
+ const username = session.username;
43
44
  const userId = session.userId;
44
45
  const channelId = session.channelId;
45
46
  const guildId = session.guildId;
@@ -54,6 +55,7 @@ function apply(ctx, config) {
54
55
  const successMsg = isAdmin ? "获取管理员信息成功!" : "获取用户信息成功!";
55
56
  const text = `${successMsg}
56
57
  [uid] ${uid}
58
+ [username] ${username}
57
59
  [userID] ${userId}
58
60
  [频道ID] ${channelId || "-"}
59
61
  [群组ID] ${guildId || "-"}
@@ -114,9 +116,16 @@ function apply(ctx, config) {
114
116
  }
115
117
  }
116
118
  };
117
- ctx.command("UID", "查看个人标识符及积分信息").alias("uid").userFields(["id"]).action(async ({ session }) => {
119
+ ctx.command("UID", "查看个人标识符及积分信息等").alias("uid").userFields(["id"]).action(async ({ session }) => {
118
120
  return await transfer.getUserInfo(session);
119
121
  });
122
+ ctx.command("UID群标识", "查看当前群组ID").alias("uid群标识").action(async ({ session }) => {
123
+ const guildId = session.guildId;
124
+ if (!guildId) {
125
+ return "当前会话不在任何群组中,无法获取群组ID。";
126
+ }
127
+ return `当前群组ID: ${guildId}`;
128
+ });
120
129
  ctx.command("添加积分 <uid:number> <num:number>").action(async ({ session }, uid, num) => {
121
130
  if (!config.adminID.includes(session.userId)) {
122
131
  return `[×] 您不是管理员,无权操作该指令...`;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "koishi-plugin-bcjh-uidtransfer",
3
3
  "description": "bcjh自用",
4
- "version": "0.0.2",
4
+ "version": "0.0.4",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [
@@ -15,6 +15,6 @@
15
15
  "plugin"
16
16
  ],
17
17
  "peerDependencies": {
18
- "koishi": "4.18.11"
18
+ "koishi": "^4.18.11"
19
19
  }
20
20
  }