@alemonjs/qq-bot 2.1.26 → 2.1.27

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/dist/index.html CHANGED
@@ -1,4 +1,4 @@
1
- <!doctype html>
1
+ <!DOCTYPE html>
2
2
  <html lang="en" id="__gui">
3
3
  <head>
4
4
  <meta charset="UTF-8" />
@@ -0,0 +1,6 @@
1
+ export type GROUP_MEMBER_ADD = {
2
+ op_member_openid: string;
3
+ member_openid: string;
4
+ group_openid: string;
5
+ username: string;
6
+ };
@@ -0,0 +1,6 @@
1
+ export type GROUP_MEMBER_REMOVE = {
2
+ op_member_openid: string;
3
+ member_openid: string;
4
+ group_openid: string;
5
+ username: string;
6
+ };
package/lib/register.js CHANGED
@@ -88,6 +88,26 @@ const register = (client) => {
88
88
  .addOpen({ OpenId: meta.openId })
89
89
  .add({ tag: 'GROUP_MESSAGE_CREATE' }).value);
90
90
  });
91
+ client.on('GROUP_MEMBER_ADD', event => {
92
+ const UserId = event.op_member_openid ?? event.member_openid ?? '';
93
+ const [isMaster, UserKey] = getMaster(UserId);
94
+ cbp.send(FormatEvent.create('member.add')
95
+ .addPlatform({ Platform: platform, value: event, BotId: botId })
96
+ .addGuild({ GuildId: event.group_openid ?? '', SpaceId: `GROUP:${event.group_openid ?? ''}` })
97
+ .addChannel({ ChannelId: event.group_openid ?? '' })
98
+ .addUser({ UserId: UserId, UserKey, UserName: event?.username ?? '', UserAvatar: createUserAvatarURL(UserId), IsMaster: isMaster, IsBot: false })
99
+ .add({ tag: 'GROUP_MEMBER_ADD' }).value);
100
+ });
101
+ client.on('GROUP_MEMBER_REMOVE', event => {
102
+ const UserId = event.op_member_openid ?? event.member_openid ?? '';
103
+ const [isMaster, UserKey] = getMaster(UserId);
104
+ cbp.send(FormatEvent.create('member.remove')
105
+ .addPlatform({ Platform: platform, value: event, BotId: botId })
106
+ .addGuild({ GuildId: event.group_openid ?? '', SpaceId: `GROUP:${event.group_openid ?? ''}` })
107
+ .addChannel({ ChannelId: event.group_openid ?? '' })
108
+ .addUser({ UserId: UserId, UserKey, UserName: event?.username ?? '', UserAvatar: createUserAvatarURL(UserId), IsMaster: isMaster, IsBot: false })
109
+ .add({ tag: 'GROUP_MEMBER_REMOVE' }).value);
110
+ });
91
111
  client.on('GROUP_AT_MESSAGE_CREATE', event => {
92
112
  if (event?.author?.bot) {
93
113
  return;
@@ -12,6 +12,8 @@ import { MESSAGE_AUDIT_REJECT_TYPE } from '../message/group/MESSAGE_AUDIT_REJECT
12
12
  import { FRIEND_ADD_TYPE } from '../message/group/FRIEND_ADD';
13
13
  import { FRIEND_DEL_TYPE } from '../message/group/FRIEND_DEL';
14
14
  import { ERROR_TYPE } from '../message/ERROR';
15
+ import { GROUP_MEMBER_REMOVE } from '../message/group/GROUP_MEMBER_REMOVE';
16
+ import { GROUP_MEMBER_ADD } from '../message/group/GROUP_MEMBER_ADD';
15
17
  export type QQBotGroupEventMap = {
16
18
  C2C_MESSAGE_CREATE: C2C_MESSAGE_CREATE_TYPE;
17
19
  C2C_MSG_REJECT: C2C_MSG_REJECT_TYPE;
@@ -27,4 +29,6 @@ export type QQBotGroupEventMap = {
27
29
  FRIEND_ADD: FRIEND_ADD_TYPE;
28
30
  FRIEND_DEL: FRIEND_DEL_TYPE;
29
31
  ERROR: ERROR_TYPE;
32
+ GROUP_MEMBER_ADD: GROUP_MEMBER_ADD;
33
+ GROUP_MEMBER_REMOVE: GROUP_MEMBER_REMOVE;
30
34
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alemonjs/qq-bot",
3
- "version": "2.1.26",
3
+ "version": "2.1.27",
4
4
  "description": "阿柠檬qq-bot平台连接",
5
5
  "author": "lemonade",
6
6
  "license": "MIT",
@@ -46,18 +46,18 @@
46
46
  }
47
47
  ],
48
48
  "logo": "antd.QqOutlined",
49
- "commond": [
49
+ "command": [
50
50
  {
51
51
  "name": "qq-bot",
52
52
  "icon": "antd.QqOutlined",
53
- "commond": "open.qq-bot"
53
+ "command": "open.qq-bot"
54
54
  }
55
55
  ],
56
56
  "sidebars": [
57
57
  {
58
58
  "name": "qq-bot",
59
59
  "icon": "antd.QqOutlined",
60
- "commond": "open.qq-bot"
60
+ "command": "open.qq-bot"
61
61
  }
62
62
  ]
63
63
  }