@alemonjs/qq-bot 2.1.14 → 2.1.16

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/README.md CHANGED
@@ -18,8 +18,6 @@ yarn add @alemonjs/qq-bot
18
18
  qq-bot:
19
19
  # 编号
20
20
  app_id: ''
21
- # 令牌
22
- token: ''
23
21
  # 密钥
24
22
  secret: ''
25
23
  ```
@@ -2,6 +2,7 @@ export type C2C_MESSAGE_CREATE_TYPE = {
2
2
  author: {
3
3
  id: string;
4
4
  user_openid: string;
5
+ username: string;
5
6
  };
6
7
  content: string;
7
8
  id: string;
@@ -2,6 +2,7 @@ export interface GROUP_AT_MESSAGE_CREATE_TYPE {
2
2
  author: {
3
3
  id: string;
4
4
  member_openid: string;
5
+ username: string;
5
6
  };
6
7
  content: string;
7
8
  group_openid: string;
package/lib/register.js CHANGED
@@ -49,7 +49,11 @@ const register = (client) => {
49
49
  .addPlatform({ Platform: platform, value: event, BotId: botId })
50
50
  .addGuild({ GuildId: event.group_id, SpaceId: `GROUP:${event.group_id}` })
51
51
  .addChannel({ ChannelId: event.group_id })
52
- .addUser({ UserId: event.author.id, UserKey, UserAvatar: UserAvatar, IsMaster: isMaster, IsBot: false })
52
+ .addUser({
53
+ UserId: event.author.id, UserKey, UserAvatar: UserAvatar,
54
+ UserName: event?.author?.username,
55
+ IsMaster: isMaster, IsBot: false
56
+ })
53
57
  .addMessage({ MessageId: event.id })
54
58
  .addText({ MessageText: event.content?.trim() })
55
59
  .addOpen({ OpenId: `C2C:${event.author.member_openid}` })
@@ -61,7 +65,11 @@ const register = (client) => {
61
65
  const UserAvatar = createUserAvatarURL(event.author.id);
62
66
  cbp.send(FormatEvent.create('private.message.create')
63
67
  .addPlatform({ Platform: platform, value: event, BotId: botId })
64
- .addUser({ UserId: event.author.id, UserKey, UserAvatar: UserAvatar, IsMaster: isMaster, IsBot: false })
68
+ .addUser({
69
+ UserId: event.author.id, UserKey, UserAvatar: UserAvatar,
70
+ UserName: event?.author?.username,
71
+ IsMaster: isMaster, IsBot: false
72
+ })
65
73
  .addMessage({ MessageId: event.id })
66
74
  .addText({ MessageText: event.content?.trim() })
67
75
  .addOpen({ OpenId: `C2C:${event.author.user_openid}` })
@@ -168,7 +176,10 @@ const register = (client) => {
168
176
  .addPlatform({ Platform: platform, value: event, BotId: botId })
169
177
  .addGuild({ GuildId: event.group_openid, SpaceId: `GROUP:${event.group_openid}` })
170
178
  .addChannel({ ChannelId: event.group_openid })
171
- .addUser({ UserId: event.group_member_openid, UserKey, UserAvatar: UserAvatar, IsMaster: isMaster, IsBot: false })
179
+ .addUser({
180
+ UserId: event.group_member_openid, UserKey, UserAvatar: UserAvatar,
181
+ IsMaster: isMaster, IsBot: false
182
+ })
172
183
  .addMessage({ MessageId: `INTERACTION_CREATE:${event.id}` })
173
184
  .addText({ MessageText: MessageText })
174
185
  .addOpen({ OpenId: `C2C:${event.group_member_openid}` })
@@ -182,7 +193,10 @@ const register = (client) => {
182
193
  const MessageText = event.data.resolved.button_data?.trim() || '';
183
194
  const e = FormatEvent.create('private.interaction.create')
184
195
  .addPlatform({ Platform: platform, value: event, BotId: botId })
185
- .addUser({ UserId: event.user_openid, UserKey, UserAvatar: UserAvatar, IsMaster: isMaster, IsBot: false })
196
+ .addUser({
197
+ UserId: event.user_openid, UserKey, UserAvatar: UserAvatar,
198
+ IsMaster: isMaster, IsBot: false
199
+ })
186
200
  .addMessage({ MessageId: event.id })
187
201
  .addText({ MessageText: MessageText })
188
202
  .addOpen({ OpenId: `C2C:${event.user_openid}` })
@@ -57,7 +57,6 @@ export interface ApiRequestData {
57
57
  }
58
58
  export interface Options {
59
59
  app_id: string;
60
- token: string;
61
60
  secret: string;
62
61
  shard?: number[];
63
62
  intents?: IntentsEnum[];
package/lib/sends.js CHANGED
@@ -121,7 +121,10 @@ const mdFormatters = {
121
121
  },
122
122
  'MD.content': value => `${value}`,
123
123
  'MD.button': (title, options) => {
124
- const { data } = options || {};
124
+ const { data, autoEnter } = options || {};
125
+ if (autoEnter) {
126
+ return `<qqbot-cmd-enter text="${data}" show="${title}" />`;
127
+ }
125
128
  return `<qqbot-cmd-input text="${data}" show="${title}" />`;
126
129
  }
127
130
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alemonjs/qq-bot",
3
- "version": "2.1.14",
3
+ "version": "2.1.16",
4
4
  "description": "阿柠檬qq-bot平台连接",
5
5
  "author": "lemonade",
6
6
  "license": "MIT",
@@ -74,5 +74,5 @@
74
74
  "type": "git",
75
75
  "url": "https://github.com/lemonade-lab/alemonjs.git"
76
76
  },
77
- "gitHead": "fee3935ca19b1658ea4b41d5d3e7f281e7efc932"
78
- }
77
+ "gitHead": "c6aa5616afe091a37610dad22fbb2d2618d943b8"
78
+ }
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2013-present, Yuxi (Evan) You
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in
13
- all copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIdED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- THE SOFTWARE.