@alemonjs/qq-bot 2.1.16 → 2.1.17
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 +20 -8
- package/lib/sends.js +6 -2
- package/package.json +1 -1
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,
|
|
53
|
+
UserId: event.author.id,
|
|
54
|
+
UserKey,
|
|
55
|
+
UserAvatar: UserAvatar,
|
|
54
56
|
UserName: event?.author?.username,
|
|
55
|
-
IsMaster: isMaster,
|
|
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,
|
|
72
|
+
UserId: event.author.id,
|
|
73
|
+
UserKey,
|
|
74
|
+
UserAvatar: UserAvatar,
|
|
70
75
|
UserName: event?.author?.username,
|
|
71
|
-
IsMaster: isMaster,
|
|
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,
|
|
181
|
-
|
|
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,
|
|
198
|
-
|
|
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
|
@@ -22,11 +22,15 @@ const createButtonsData = (rows, startId = 0) => {
|
|
|
22
22
|
render_data: {
|
|
23
23
|
label: value,
|
|
24
24
|
visited_label: value,
|
|
25
|
-
style: 0
|
|
25
|
+
style: options.style !== 'blue' ? 0 : 1
|
|
26
26
|
},
|
|
27
27
|
action: {
|
|
28
28
|
type: typeMap[typing],
|
|
29
|
-
permission: {
|
|
29
|
+
permission: {
|
|
30
|
+
type: typeof options.permission?.type === 'undefined' ? 2 : options.permission.type,
|
|
31
|
+
specify_user_ids: options.permission.userIds,
|
|
32
|
+
specify_role_ids: options.permission.roleIds
|
|
33
|
+
},
|
|
30
34
|
unsupport_tips: options?.toolTip ?? '',
|
|
31
35
|
data: options?.data ?? '',
|
|
32
36
|
at_bot_show_channel_list: false,
|