@alemonjs/qq-bot 2.1.16 → 2.1.18

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/register.js CHANGED
@@ -50,9 +50,12 @@ const register = (client) => {
50
50
  .addGuild({ GuildId: event.group_id, SpaceId: `GROUP:${event.group_id}` })
51
51
  .addChannel({ ChannelId: event.group_id })
52
52
  .addUser({
53
- UserId: event.author.id, UserKey, UserAvatar: UserAvatar,
53
+ UserId: event.author.id,
54
+ UserKey,
55
+ UserAvatar: UserAvatar,
54
56
  UserName: event?.author?.username,
55
- IsMaster: isMaster, IsBot: false
57
+ IsMaster: isMaster,
58
+ IsBot: false
56
59
  })
57
60
  .addMessage({ MessageId: event.id })
58
61
  .addText({ MessageText: event.content?.trim() })
@@ -66,9 +69,12 @@ const register = (client) => {
66
69
  cbp.send(FormatEvent.create('private.message.create')
67
70
  .addPlatform({ Platform: platform, value: event, BotId: botId })
68
71
  .addUser({
69
- UserId: event.author.id, UserKey, UserAvatar: UserAvatar,
72
+ UserId: event.author.id,
73
+ UserKey,
74
+ UserAvatar: UserAvatar,
70
75
  UserName: event?.author?.username,
71
- IsMaster: isMaster, IsBot: false
76
+ IsMaster: isMaster,
77
+ IsBot: false
72
78
  })
73
79
  .addMessage({ MessageId: event.id })
74
80
  .addText({ MessageText: event.content?.trim() })
@@ -177,8 +183,11 @@ const register = (client) => {
177
183
  .addGuild({ GuildId: event.group_openid, SpaceId: `GROUP:${event.group_openid}` })
178
184
  .addChannel({ ChannelId: event.group_openid })
179
185
  .addUser({
180
- UserId: event.group_member_openid, UserKey, UserAvatar: UserAvatar,
181
- IsMaster: isMaster, IsBot: false
186
+ UserId: event.group_member_openid,
187
+ UserKey,
188
+ UserAvatar: UserAvatar,
189
+ IsMaster: isMaster,
190
+ IsBot: false
182
191
  })
183
192
  .addMessage({ MessageId: `INTERACTION_CREATE:${event.id}` })
184
193
  .addText({ MessageText: MessageText })
@@ -194,8 +203,11 @@ const register = (client) => {
194
203
  const e = FormatEvent.create('private.interaction.create')
195
204
  .addPlatform({ Platform: platform, value: event, BotId: botId })
196
205
  .addUser({
197
- UserId: event.user_openid, UserKey, UserAvatar: UserAvatar,
198
- IsMaster: isMaster, IsBot: false
206
+ UserId: event.user_openid,
207
+ UserKey,
208
+ UserAvatar: UserAvatar,
209
+ IsMaster: isMaster,
210
+ IsBot: false
199
211
  })
200
212
  .addMessage({ MessageId: event.id })
201
213
  .addText({ MessageText: MessageText })
package/lib/sends.js CHANGED
@@ -17,20 +17,26 @@ const createButtonsData = (rows, startId = 0) => {
17
17
  id++;
18
18
  const typing = options?.type ?? 'command';
19
19
  const typeMap = { command: 2, link: 0, call: 1 };
20
+ const rowData = options?.rawData ?? {};
20
21
  return {
21
22
  id: String(id),
22
23
  render_data: {
23
24
  label: value,
24
25
  visited_label: value,
25
- style: 0
26
+ style: options.style !== 'blue' ? 0 : 1
26
27
  },
27
28
  action: {
28
29
  type: typeMap[typing],
29
- permission: { type: 2 },
30
+ permission: {
31
+ type: typeof options.permission?.type === 'undefined' ? 2 : options?.permission?.type,
32
+ specify_user_ids: options?.permission?.userIds,
33
+ specify_role_ids: options?.permission?.roleIds
34
+ },
30
35
  unsupport_tips: options?.toolTip ?? '',
31
36
  data: options?.data ?? '',
32
37
  at_bot_show_channel_list: false,
33
- enter: options?.autoEnter ?? false
38
+ enter: options?.autoEnter ?? false,
39
+ ...rowData
34
40
  }
35
41
  };
36
42
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alemonjs/qq-bot",
3
- "version": "2.1.16",
3
+ "version": "2.1.18",
4
4
  "description": "阿柠檬qq-bot平台连接",
5
5
  "author": "lemonade",
6
6
  "license": "MIT",