woodenfish-bot 4.7.0 → 4.7.2

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/es/index.js CHANGED
@@ -11,7 +11,8 @@ import https from 'https';
11
11
  import _possibleConstructorReturn from '@babel/runtime/helpers/possibleConstructorReturn';
12
12
  import _getPrototypeOf from '@babel/runtime/helpers/getPrototypeOf';
13
13
  import _inherits from '@babel/runtime/helpers/inherits';
14
- import WebSocket, { EventEmitter } from 'ws';
14
+ import WebSocket from 'ws';
15
+ import { EventEmitter } from 'node:events';
15
16
 
16
17
  var versionMapping = Object.create(null);
17
18
  function register(version, api) {
@@ -70,6 +71,24 @@ var apiMap = {
70
71
  // 群组富媒体消息
71
72
  groupMessageURI: '/v2/groups/:groupOpenid/messages/:messageID',
72
73
  // 群组撤回消息
74
+ groupInfoURI: '/v2/groups/:groupOpenid/info',
75
+ // 群基本信息
76
+ groupBotStateURI: '/v2/groups/:groupOpenid/bot_state',
77
+ // 机器人群内状态
78
+ groupJoinRequestListURI: '/v2/groups/:groupOpenid/join_request_list',
79
+ // 入群申请列表
80
+ groupJoinRequestApprovalURI: '/v2/groups/:groupOpenid/approval_join_request/:memberOpenid',
81
+ // 入群申请审批
82
+ groupRestrictChatSettingURI: '/v2/groups/:groupOpenid/restrict_chat_setting',
83
+ // 群禁言状态及成员禁言
84
+ groupJoinApprovalStrategiesURI: '/v2/groups/join_approval_strategy',
85
+ // 入群自动审批策略列表及创建
86
+ groupJoinApprovalStrategyURI: '/v2/groups/join_approval_strategy/:strategyID',
87
+ // 入群自动审批策略
88
+ groupJoinApprovalStrategyExecuteURI: '/v2/groups/join_approval_strategy/:strategyID/execute',
89
+ // 执行入群自动审批策略
90
+ groupJoinApprovalStrategyWhitelistURI: '/v2/groups/join_approval_strategy/:strategyID/whitelist_users',
91
+ // 入群自动审批白名单
73
92
  c2cMessagesURI: '/v2/users/:userID/messages',
74
93
  // C2C消息
75
94
  c2cRichMediaURI: '/v2/users/:userID/files',
@@ -300,7 +319,7 @@ var Guild = /*#__PURE__*/function () {
300
319
  }]);
301
320
  }();
302
321
 
303
- var version = "4.7.0";
322
+ var version = "4.7.2";
304
323
 
305
324
  function getDefaultExportFromCjs (x) {
306
325
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
@@ -986,8 +1005,7 @@ var addAuthorization = /*#__PURE__*/function () {
986
1005
  // 组装完整Url
987
1006
  var buildUrl = function buildUrl() {
988
1007
  var path = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
989
- var isSandbox = arguments.length > 1 ? arguments[1] : undefined;
990
- return "".concat(isSandbox ? 'https://sandbox.api.sgroup.qq.com' : 'https://api.sgroup.qq.com').concat(path);
1008
+ return "https://api.bot.qq.com".concat(path);
991
1009
  };
992
1010
 
993
1011
  var Channel = /*#__PURE__*/function () {
@@ -2128,6 +2146,164 @@ var Interaction = /*#__PURE__*/function () {
2128
2146
  }]);
2129
2147
  }();
2130
2148
 
2149
+ var Group = /*#__PURE__*/function () {
2150
+ function Group(request, config) {
2151
+ _classCallCheck(this, Group);
2152
+ _defineProperty(this, "request", void 0);
2153
+ _defineProperty(this, "config", void 0);
2154
+ this.request = request;
2155
+ this.config = config;
2156
+ }
2157
+ return _createClass(Group, [{
2158
+ key: "getGroupInfo",
2159
+ value: function getGroupInfo(groupOpenid) {
2160
+ return this.request({
2161
+ method: 'GET',
2162
+ url: getURL('groupInfoURI'),
2163
+ rest: {
2164
+ groupOpenid: groupOpenid
2165
+ },
2166
+ apiVersion: 'v2'
2167
+ });
2168
+ }
2169
+ }, {
2170
+ key: "getGroupBotState",
2171
+ value: function getGroupBotState(groupOpenid) {
2172
+ return this.request({
2173
+ method: 'GET',
2174
+ url: getURL('groupBotStateURI'),
2175
+ rest: {
2176
+ groupOpenid: groupOpenid
2177
+ },
2178
+ apiVersion: 'v2'
2179
+ });
2180
+ }
2181
+ }, {
2182
+ key: "getGroupJoinRequests",
2183
+ value: function getGroupJoinRequests(groupOpenid, pager) {
2184
+ return this.request({
2185
+ method: 'GET',
2186
+ url: getURL('groupJoinRequestListURI'),
2187
+ rest: {
2188
+ groupOpenid: groupOpenid
2189
+ },
2190
+ params: pager || {},
2191
+ apiVersion: 'v2'
2192
+ });
2193
+ }
2194
+ }, {
2195
+ key: "approveGroupJoinRequest",
2196
+ value: function approveGroupJoinRequest(groupOpenid, memberOpenid, options) {
2197
+ return this.request({
2198
+ method: 'POST',
2199
+ url: getURL('groupJoinRequestApprovalURI'),
2200
+ rest: {
2201
+ groupOpenid: groupOpenid,
2202
+ memberOpenid: memberOpenid
2203
+ },
2204
+ data: options,
2205
+ apiVersion: 'v2'
2206
+ });
2207
+ }
2208
+ }, {
2209
+ key: "getGroupRestrictChatSetting",
2210
+ value: function getGroupRestrictChatSetting(groupOpenid) {
2211
+ return this.request({
2212
+ method: 'GET',
2213
+ url: getURL('groupRestrictChatSettingURI'),
2214
+ rest: {
2215
+ groupOpenid: groupOpenid
2216
+ },
2217
+ apiVersion: 'v2'
2218
+ });
2219
+ }
2220
+ }, {
2221
+ key: "setGroupRestrictChatSetting",
2222
+ value: function setGroupRestrictChatSetting(groupOpenid, options) {
2223
+ return this.request({
2224
+ method: 'POST',
2225
+ url: getURL('groupRestrictChatSettingURI'),
2226
+ rest: {
2227
+ groupOpenid: groupOpenid
2228
+ },
2229
+ data: options,
2230
+ apiVersion: 'v2'
2231
+ });
2232
+ }
2233
+ }, {
2234
+ key: "getGroupJoinApprovalStrategies",
2235
+ value: function getGroupJoinApprovalStrategies(pager) {
2236
+ return this.request({
2237
+ method: 'GET',
2238
+ url: getURL('groupJoinApprovalStrategiesURI'),
2239
+ params: pager || {},
2240
+ apiVersion: 'v2'
2241
+ });
2242
+ }
2243
+ }, {
2244
+ key: "createGroupJoinApprovalStrategy",
2245
+ value: function createGroupJoinApprovalStrategy(options) {
2246
+ return this.request({
2247
+ method: 'POST',
2248
+ url: getURL('groupJoinApprovalStrategiesURI'),
2249
+ data: options,
2250
+ apiVersion: 'v2'
2251
+ });
2252
+ }
2253
+ }, {
2254
+ key: "updateGroupJoinApprovalStrategy",
2255
+ value: function updateGroupJoinApprovalStrategy(strategyID, options) {
2256
+ return this.request({
2257
+ method: 'PATCH',
2258
+ url: getURL('groupJoinApprovalStrategyURI'),
2259
+ rest: {
2260
+ strategyID: strategyID
2261
+ },
2262
+ data: options,
2263
+ apiVersion: 'v2'
2264
+ });
2265
+ }
2266
+ }, {
2267
+ key: "deleteGroupJoinApprovalStrategy",
2268
+ value: function deleteGroupJoinApprovalStrategy(strategyID) {
2269
+ return this.request({
2270
+ method: 'DELETE',
2271
+ url: getURL('groupJoinApprovalStrategyURI'),
2272
+ rest: {
2273
+ strategyID: strategyID
2274
+ },
2275
+ apiVersion: 'v2'
2276
+ });
2277
+ }
2278
+ }, {
2279
+ key: "executeGroupJoinApprovalStrategy",
2280
+ value: function executeGroupJoinApprovalStrategy(strategyID) {
2281
+ return this.request({
2282
+ method: 'POST',
2283
+ url: getURL('groupJoinApprovalStrategyExecuteURI'),
2284
+ rest: {
2285
+ strategyID: strategyID
2286
+ },
2287
+ data: {},
2288
+ apiVersion: 'v2'
2289
+ });
2290
+ }
2291
+ }, {
2292
+ key: "updateGroupJoinApprovalStrategyWhitelist",
2293
+ value: function updateGroupJoinApprovalStrategyWhitelist(strategyID, options) {
2294
+ return this.request({
2295
+ method: 'POST',
2296
+ url: getURL('groupJoinApprovalStrategyWhitelistURI'),
2297
+ rest: {
2298
+ strategyID: strategyID
2299
+ },
2300
+ data: options,
2301
+ apiVersion: 'v2'
2302
+ });
2303
+ }
2304
+ }]);
2305
+ }();
2306
+
2131
2307
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
2132
2308
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
2133
2309
  var apiVersion = 'v2';
@@ -2155,6 +2331,7 @@ var OpenAPI = /*#__PURE__*/function () {
2155
2331
  _defineProperty(this, "interactionApi", void 0);
2156
2332
  _defineProperty(this, "pinsMessageApi", void 0);
2157
2333
  _defineProperty(this, "guildPermissionsApi", void 0);
2334
+ _defineProperty(this, "groupApi", void 0);
2158
2335
  this.config = config;
2159
2336
  this.register(this);
2160
2337
  }
@@ -2179,6 +2356,7 @@ var OpenAPI = /*#__PURE__*/function () {
2179
2356
  client.reactionApi = new Reaction(this.request, this.config);
2180
2357
  client.interactionApi = new Interaction(this.request, this.config);
2181
2358
  client.pinsMessageApi = new PinsMessage(this.request, this.config);
2359
+ client.groupApi = new Group(this.request, this.config);
2182
2360
  }
2183
2361
 
2184
2362
  // 基础rest请求
@@ -2315,7 +2493,7 @@ var AvailableIntentsEventsEnum = /*#__PURE__*/function (AvailableIntentsEventsEn
2315
2493
  AvailableIntentsEventsEnum["PUBLIC_GUILD_MESSAGES"] = "PUBLIC_GUILD_MESSAGES";
2316
2494
  AvailableIntentsEventsEnum["MESSAGE_AUDIT"] = "MESSAGE_AUDIT";
2317
2495
  AvailableIntentsEventsEnum["INTERACTION"] = "INTERACTION";
2318
- AvailableIntentsEventsEnum["GROUP_C2C_EVENT"] = "GROUP_C2C_EVENT";
2496
+ AvailableIntentsEventsEnum["GROUP_AND_C2C_EVENT"] = "GROUP_AND_C2C_EVENT";
2319
2497
  return AvailableIntentsEventsEnum;
2320
2498
  }({});
2321
2499
 
@@ -2427,28 +2605,34 @@ var WsEventType = {
2427
2605
  PUBLIC_MESSAGE_DELETE: AvailableIntentsEventsEnum.PUBLIC_GUILD_MESSAGES,
2428
2606
  // 当频道的消息被删除时
2429
2607
 
2430
- // ======= GROUP_C2C_EVENT ======
2431
- GROUP_AT_MESSAGE_CREATE: AvailableIntentsEventsEnum.GROUP_C2C_EVENT,
2608
+ // ======= GROUP_AND_C2C_EVENT ======
2609
+ GROUP_AT_MESSAGE_CREATE: AvailableIntentsEventsEnum.GROUP_AND_C2C_EVENT,
2432
2610
  // 机器人在群聊被@时触发
2433
- GROUP_MESSAGE_CREATE: AvailableIntentsEventsEnum.GROUP_C2C_EVENT,
2611
+ GROUP_MESSAGE_CREATE: AvailableIntentsEventsEnum.GROUP_AND_C2C_EVENT,
2434
2612
  // 机器人收到群聊全量消息时触发
2435
- C2C_MESSAGE_CREATE: AvailableIntentsEventsEnum.GROUP_C2C_EVENT,
2613
+ C2C_MESSAGE_CREATE: AvailableIntentsEventsEnum.GROUP_AND_C2C_EVENT,
2436
2614
  // 机器人收到C2C消息时触发
2437
- FRIEND_ADD: AvailableIntentsEventsEnum.GROUP_C2C_EVENT,
2615
+ FRIEND_ADD: AvailableIntentsEventsEnum.GROUP_AND_C2C_EVENT,
2438
2616
  // 机器人被加好友时触发
2439
- FRIEND_DEL: AvailableIntentsEventsEnum.GROUP_C2C_EVENT,
2617
+ FRIEND_DEL: AvailableIntentsEventsEnum.GROUP_AND_C2C_EVENT,
2440
2618
  // 机器人被删除好友时触发
2441
- C2C_MSG_RECEIVE: AvailableIntentsEventsEnum.GROUP_C2C_EVENT,
2619
+ C2C_MSG_RECEIVE: AvailableIntentsEventsEnum.GROUP_AND_C2C_EVENT,
2442
2620
  // 用户在机器人资料卡手动开启"主动消息"推送
2443
- C2C_MSG_REJECT: AvailableIntentsEventsEnum.GROUP_C2C_EVENT,
2621
+ C2C_MSG_REJECT: AvailableIntentsEventsEnum.GROUP_AND_C2C_EVENT,
2444
2622
  // 用户在机器人资料卡手动关闭"主动消息"推送
2445
- GROUP_ADD_ROBOT: AvailableIntentsEventsEnum.GROUP_C2C_EVENT,
2623
+ GROUP_ADD_ROBOT: AvailableIntentsEventsEnum.GROUP_AND_C2C_EVENT,
2446
2624
  // 机器人被加入群聊时触发
2447
- GROUP_DEL_ROBOT: AvailableIntentsEventsEnum.GROUP_C2C_EVENT,
2625
+ GROUP_DEL_ROBOT: AvailableIntentsEventsEnum.GROUP_AND_C2C_EVENT,
2448
2626
  // 机器人被移出群聊时触发
2449
- GROUP_MSG_RECEIVE: AvailableIntentsEventsEnum.GROUP_C2C_EVENT,
2627
+ GROUP_MSG_RECEIVE: AvailableIntentsEventsEnum.GROUP_AND_C2C_EVENT,
2450
2628
  // 群管理员主动在机器人资料页操作开启通知
2451
- GROUP_MSG_REJECT: AvailableIntentsEventsEnum.GROUP_C2C_EVENT // 群管理员主动在机器人资料页操作关闭通知
2629
+ GROUP_MSG_REJECT: AvailableIntentsEventsEnum.GROUP_AND_C2C_EVENT,
2630
+ // 群管理员主动在机器人资料页操作关闭通知
2631
+ GROUP_MEMBER_ADD: AvailableIntentsEventsEnum.GROUP_AND_C2C_EVENT,
2632
+ // 群成员加入
2633
+ GROUP_MEMBER_REMOVE: AvailableIntentsEventsEnum.GROUP_AND_C2C_EVENT,
2634
+ // 群成员退出或被移出
2635
+ GROUP_JOIN_REQUEST: AvailableIntentsEventsEnum.GROUP_AND_C2C_EVENT // 用户申请加群
2452
2636
  };
2453
2637
  var WSCodes = {
2454
2638
  1000: 'WS_CLOSE_REQUESTED',
@@ -2537,7 +2721,7 @@ var IntentEvents = {
2537
2721
  DIRECT_MESSAGE: 1 << 12,
2538
2722
  OPEN_FORUM_EVENT: 1 << 18,
2539
2723
  AUDIO_OR_LIVE_CHANNEL_MEMBER: 1 << 19,
2540
- GROUP_C2C_EVENT: 1 << 25,
2724
+ GROUP_AND_C2C_EVENT: 1 << 25,
2541
2725
  INTERACTION: 1 << 26,
2542
2726
  MESSAGE_AUDIT: 1 << 27,
2543
2727
  FORUM_EVENT: 1 << 28,
@@ -2564,7 +2748,7 @@ var Intents = {
2564
2748
  DIRECT_MESSAGE_TYPING: 14,
2565
2749
  OPEN_FORUM_EVENT: 18,
2566
2750
  AUDIO_OR_LIVE_CHANNEL_MEMBER: 19,
2567
- GROUP_C2C_EVENT: 25,
2751
+ GROUP_AND_C2C_EVENT: 25,
2568
2752
  INTERACTION: 26,
2569
2753
  MESSAGE_AUDIT: 27,
2570
2754
  FORUM_EVENT: 28,
package/lib/index.js CHANGED
@@ -14,6 +14,7 @@ var _possibleConstructorReturn = require('@babel/runtime/helpers/possibleConstru
14
14
  var _getPrototypeOf = require('@babel/runtime/helpers/getPrototypeOf');
15
15
  var _inherits = require('@babel/runtime/helpers/inherits');
16
16
  var WebSocket = require('ws');
17
+ var node_events = require('node:events');
17
18
 
18
19
  var versionMapping = Object.create(null);
19
20
  function register(version, api) {
@@ -72,6 +73,24 @@ var apiMap = {
72
73
  // 群组富媒体消息
73
74
  groupMessageURI: '/v2/groups/:groupOpenid/messages/:messageID',
74
75
  // 群组撤回消息
76
+ groupInfoURI: '/v2/groups/:groupOpenid/info',
77
+ // 群基本信息
78
+ groupBotStateURI: '/v2/groups/:groupOpenid/bot_state',
79
+ // 机器人群内状态
80
+ groupJoinRequestListURI: '/v2/groups/:groupOpenid/join_request_list',
81
+ // 入群申请列表
82
+ groupJoinRequestApprovalURI: '/v2/groups/:groupOpenid/approval_join_request/:memberOpenid',
83
+ // 入群申请审批
84
+ groupRestrictChatSettingURI: '/v2/groups/:groupOpenid/restrict_chat_setting',
85
+ // 群禁言状态及成员禁言
86
+ groupJoinApprovalStrategiesURI: '/v2/groups/join_approval_strategy',
87
+ // 入群自动审批策略列表及创建
88
+ groupJoinApprovalStrategyURI: '/v2/groups/join_approval_strategy/:strategyID',
89
+ // 入群自动审批策略
90
+ groupJoinApprovalStrategyExecuteURI: '/v2/groups/join_approval_strategy/:strategyID/execute',
91
+ // 执行入群自动审批策略
92
+ groupJoinApprovalStrategyWhitelistURI: '/v2/groups/join_approval_strategy/:strategyID/whitelist_users',
93
+ // 入群自动审批白名单
75
94
  c2cMessagesURI: '/v2/users/:userID/messages',
76
95
  // C2C消息
77
96
  c2cRichMediaURI: '/v2/users/:userID/files',
@@ -302,7 +321,7 @@ var Guild = /*#__PURE__*/function () {
302
321
  }]);
303
322
  }();
304
323
 
305
- var version = "4.7.0";
324
+ var version = "4.7.2";
306
325
 
307
326
  function getDefaultExportFromCjs (x) {
308
327
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
@@ -988,8 +1007,7 @@ var addAuthorization = /*#__PURE__*/function () {
988
1007
  // 组装完整Url
989
1008
  var buildUrl = function buildUrl() {
990
1009
  var path = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
991
- var isSandbox = arguments.length > 1 ? arguments[1] : undefined;
992
- return "".concat(isSandbox ? 'https://sandbox.api.sgroup.qq.com' : 'https://api.sgroup.qq.com').concat(path);
1010
+ return "https://api.bot.qq.com".concat(path);
993
1011
  };
994
1012
 
995
1013
  var Channel = /*#__PURE__*/function () {
@@ -2130,6 +2148,164 @@ var Interaction = /*#__PURE__*/function () {
2130
2148
  }]);
2131
2149
  }();
2132
2150
 
2151
+ var Group = /*#__PURE__*/function () {
2152
+ function Group(request, config) {
2153
+ _classCallCheck(this, Group);
2154
+ _defineProperty(this, "request", void 0);
2155
+ _defineProperty(this, "config", void 0);
2156
+ this.request = request;
2157
+ this.config = config;
2158
+ }
2159
+ return _createClass(Group, [{
2160
+ key: "getGroupInfo",
2161
+ value: function getGroupInfo(groupOpenid) {
2162
+ return this.request({
2163
+ method: 'GET',
2164
+ url: getURL('groupInfoURI'),
2165
+ rest: {
2166
+ groupOpenid: groupOpenid
2167
+ },
2168
+ apiVersion: 'v2'
2169
+ });
2170
+ }
2171
+ }, {
2172
+ key: "getGroupBotState",
2173
+ value: function getGroupBotState(groupOpenid) {
2174
+ return this.request({
2175
+ method: 'GET',
2176
+ url: getURL('groupBotStateURI'),
2177
+ rest: {
2178
+ groupOpenid: groupOpenid
2179
+ },
2180
+ apiVersion: 'v2'
2181
+ });
2182
+ }
2183
+ }, {
2184
+ key: "getGroupJoinRequests",
2185
+ value: function getGroupJoinRequests(groupOpenid, pager) {
2186
+ return this.request({
2187
+ method: 'GET',
2188
+ url: getURL('groupJoinRequestListURI'),
2189
+ rest: {
2190
+ groupOpenid: groupOpenid
2191
+ },
2192
+ params: pager || {},
2193
+ apiVersion: 'v2'
2194
+ });
2195
+ }
2196
+ }, {
2197
+ key: "approveGroupJoinRequest",
2198
+ value: function approveGroupJoinRequest(groupOpenid, memberOpenid, options) {
2199
+ return this.request({
2200
+ method: 'POST',
2201
+ url: getURL('groupJoinRequestApprovalURI'),
2202
+ rest: {
2203
+ groupOpenid: groupOpenid,
2204
+ memberOpenid: memberOpenid
2205
+ },
2206
+ data: options,
2207
+ apiVersion: 'v2'
2208
+ });
2209
+ }
2210
+ }, {
2211
+ key: "getGroupRestrictChatSetting",
2212
+ value: function getGroupRestrictChatSetting(groupOpenid) {
2213
+ return this.request({
2214
+ method: 'GET',
2215
+ url: getURL('groupRestrictChatSettingURI'),
2216
+ rest: {
2217
+ groupOpenid: groupOpenid
2218
+ },
2219
+ apiVersion: 'v2'
2220
+ });
2221
+ }
2222
+ }, {
2223
+ key: "setGroupRestrictChatSetting",
2224
+ value: function setGroupRestrictChatSetting(groupOpenid, options) {
2225
+ return this.request({
2226
+ method: 'POST',
2227
+ url: getURL('groupRestrictChatSettingURI'),
2228
+ rest: {
2229
+ groupOpenid: groupOpenid
2230
+ },
2231
+ data: options,
2232
+ apiVersion: 'v2'
2233
+ });
2234
+ }
2235
+ }, {
2236
+ key: "getGroupJoinApprovalStrategies",
2237
+ value: function getGroupJoinApprovalStrategies(pager) {
2238
+ return this.request({
2239
+ method: 'GET',
2240
+ url: getURL('groupJoinApprovalStrategiesURI'),
2241
+ params: pager || {},
2242
+ apiVersion: 'v2'
2243
+ });
2244
+ }
2245
+ }, {
2246
+ key: "createGroupJoinApprovalStrategy",
2247
+ value: function createGroupJoinApprovalStrategy(options) {
2248
+ return this.request({
2249
+ method: 'POST',
2250
+ url: getURL('groupJoinApprovalStrategiesURI'),
2251
+ data: options,
2252
+ apiVersion: 'v2'
2253
+ });
2254
+ }
2255
+ }, {
2256
+ key: "updateGroupJoinApprovalStrategy",
2257
+ value: function updateGroupJoinApprovalStrategy(strategyID, options) {
2258
+ return this.request({
2259
+ method: 'PATCH',
2260
+ url: getURL('groupJoinApprovalStrategyURI'),
2261
+ rest: {
2262
+ strategyID: strategyID
2263
+ },
2264
+ data: options,
2265
+ apiVersion: 'v2'
2266
+ });
2267
+ }
2268
+ }, {
2269
+ key: "deleteGroupJoinApprovalStrategy",
2270
+ value: function deleteGroupJoinApprovalStrategy(strategyID) {
2271
+ return this.request({
2272
+ method: 'DELETE',
2273
+ url: getURL('groupJoinApprovalStrategyURI'),
2274
+ rest: {
2275
+ strategyID: strategyID
2276
+ },
2277
+ apiVersion: 'v2'
2278
+ });
2279
+ }
2280
+ }, {
2281
+ key: "executeGroupJoinApprovalStrategy",
2282
+ value: function executeGroupJoinApprovalStrategy(strategyID) {
2283
+ return this.request({
2284
+ method: 'POST',
2285
+ url: getURL('groupJoinApprovalStrategyExecuteURI'),
2286
+ rest: {
2287
+ strategyID: strategyID
2288
+ },
2289
+ data: {},
2290
+ apiVersion: 'v2'
2291
+ });
2292
+ }
2293
+ }, {
2294
+ key: "updateGroupJoinApprovalStrategyWhitelist",
2295
+ value: function updateGroupJoinApprovalStrategyWhitelist(strategyID, options) {
2296
+ return this.request({
2297
+ method: 'POST',
2298
+ url: getURL('groupJoinApprovalStrategyWhitelistURI'),
2299
+ rest: {
2300
+ strategyID: strategyID
2301
+ },
2302
+ data: options,
2303
+ apiVersion: 'v2'
2304
+ });
2305
+ }
2306
+ }]);
2307
+ }();
2308
+
2133
2309
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
2134
2310
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
2135
2311
  var apiVersion = 'v2';
@@ -2157,6 +2333,7 @@ var OpenAPI = /*#__PURE__*/function () {
2157
2333
  _defineProperty(this, "interactionApi", void 0);
2158
2334
  _defineProperty(this, "pinsMessageApi", void 0);
2159
2335
  _defineProperty(this, "guildPermissionsApi", void 0);
2336
+ _defineProperty(this, "groupApi", void 0);
2160
2337
  this.config = config;
2161
2338
  this.register(this);
2162
2339
  }
@@ -2181,6 +2358,7 @@ var OpenAPI = /*#__PURE__*/function () {
2181
2358
  client.reactionApi = new Reaction(this.request, this.config);
2182
2359
  client.interactionApi = new Interaction(this.request, this.config);
2183
2360
  client.pinsMessageApi = new PinsMessage(this.request, this.config);
2361
+ client.groupApi = new Group(this.request, this.config);
2184
2362
  }
2185
2363
 
2186
2364
  // 基础rest请求
@@ -2317,7 +2495,7 @@ var AvailableIntentsEventsEnum = /*#__PURE__*/function (AvailableIntentsEventsEn
2317
2495
  AvailableIntentsEventsEnum["PUBLIC_GUILD_MESSAGES"] = "PUBLIC_GUILD_MESSAGES";
2318
2496
  AvailableIntentsEventsEnum["MESSAGE_AUDIT"] = "MESSAGE_AUDIT";
2319
2497
  AvailableIntentsEventsEnum["INTERACTION"] = "INTERACTION";
2320
- AvailableIntentsEventsEnum["GROUP_C2C_EVENT"] = "GROUP_C2C_EVENT";
2498
+ AvailableIntentsEventsEnum["GROUP_AND_C2C_EVENT"] = "GROUP_AND_C2C_EVENT";
2321
2499
  return AvailableIntentsEventsEnum;
2322
2500
  }({});
2323
2501
 
@@ -2429,28 +2607,34 @@ var WsEventType = {
2429
2607
  PUBLIC_MESSAGE_DELETE: AvailableIntentsEventsEnum.PUBLIC_GUILD_MESSAGES,
2430
2608
  // 当频道的消息被删除时
2431
2609
 
2432
- // ======= GROUP_C2C_EVENT ======
2433
- GROUP_AT_MESSAGE_CREATE: AvailableIntentsEventsEnum.GROUP_C2C_EVENT,
2610
+ // ======= GROUP_AND_C2C_EVENT ======
2611
+ GROUP_AT_MESSAGE_CREATE: AvailableIntentsEventsEnum.GROUP_AND_C2C_EVENT,
2434
2612
  // 机器人在群聊被@时触发
2435
- GROUP_MESSAGE_CREATE: AvailableIntentsEventsEnum.GROUP_C2C_EVENT,
2613
+ GROUP_MESSAGE_CREATE: AvailableIntentsEventsEnum.GROUP_AND_C2C_EVENT,
2436
2614
  // 机器人收到群聊全量消息时触发
2437
- C2C_MESSAGE_CREATE: AvailableIntentsEventsEnum.GROUP_C2C_EVENT,
2615
+ C2C_MESSAGE_CREATE: AvailableIntentsEventsEnum.GROUP_AND_C2C_EVENT,
2438
2616
  // 机器人收到C2C消息时触发
2439
- FRIEND_ADD: AvailableIntentsEventsEnum.GROUP_C2C_EVENT,
2617
+ FRIEND_ADD: AvailableIntentsEventsEnum.GROUP_AND_C2C_EVENT,
2440
2618
  // 机器人被加好友时触发
2441
- FRIEND_DEL: AvailableIntentsEventsEnum.GROUP_C2C_EVENT,
2619
+ FRIEND_DEL: AvailableIntentsEventsEnum.GROUP_AND_C2C_EVENT,
2442
2620
  // 机器人被删除好友时触发
2443
- C2C_MSG_RECEIVE: AvailableIntentsEventsEnum.GROUP_C2C_EVENT,
2621
+ C2C_MSG_RECEIVE: AvailableIntentsEventsEnum.GROUP_AND_C2C_EVENT,
2444
2622
  // 用户在机器人资料卡手动开启"主动消息"推送
2445
- C2C_MSG_REJECT: AvailableIntentsEventsEnum.GROUP_C2C_EVENT,
2623
+ C2C_MSG_REJECT: AvailableIntentsEventsEnum.GROUP_AND_C2C_EVENT,
2446
2624
  // 用户在机器人资料卡手动关闭"主动消息"推送
2447
- GROUP_ADD_ROBOT: AvailableIntentsEventsEnum.GROUP_C2C_EVENT,
2625
+ GROUP_ADD_ROBOT: AvailableIntentsEventsEnum.GROUP_AND_C2C_EVENT,
2448
2626
  // 机器人被加入群聊时触发
2449
- GROUP_DEL_ROBOT: AvailableIntentsEventsEnum.GROUP_C2C_EVENT,
2627
+ GROUP_DEL_ROBOT: AvailableIntentsEventsEnum.GROUP_AND_C2C_EVENT,
2450
2628
  // 机器人被移出群聊时触发
2451
- GROUP_MSG_RECEIVE: AvailableIntentsEventsEnum.GROUP_C2C_EVENT,
2629
+ GROUP_MSG_RECEIVE: AvailableIntentsEventsEnum.GROUP_AND_C2C_EVENT,
2452
2630
  // 群管理员主动在机器人资料页操作开启通知
2453
- GROUP_MSG_REJECT: AvailableIntentsEventsEnum.GROUP_C2C_EVENT // 群管理员主动在机器人资料页操作关闭通知
2631
+ GROUP_MSG_REJECT: AvailableIntentsEventsEnum.GROUP_AND_C2C_EVENT,
2632
+ // 群管理员主动在机器人资料页操作关闭通知
2633
+ GROUP_MEMBER_ADD: AvailableIntentsEventsEnum.GROUP_AND_C2C_EVENT,
2634
+ // 群成员加入
2635
+ GROUP_MEMBER_REMOVE: AvailableIntentsEventsEnum.GROUP_AND_C2C_EVENT,
2636
+ // 群成员退出或被移出
2637
+ GROUP_JOIN_REQUEST: AvailableIntentsEventsEnum.GROUP_AND_C2C_EVENT // 用户申请加群
2454
2638
  };
2455
2639
  var WSCodes = {
2456
2640
  1000: 'WS_CLOSE_REQUESTED',
@@ -2539,7 +2723,7 @@ var IntentEvents = {
2539
2723
  DIRECT_MESSAGE: 1 << 12,
2540
2724
  OPEN_FORUM_EVENT: 1 << 18,
2541
2725
  AUDIO_OR_LIVE_CHANNEL_MEMBER: 1 << 19,
2542
- GROUP_C2C_EVENT: 1 << 25,
2726
+ GROUP_AND_C2C_EVENT: 1 << 25,
2543
2727
  INTERACTION: 1 << 26,
2544
2728
  MESSAGE_AUDIT: 1 << 27,
2545
2729
  FORUM_EVENT: 1 << 28,
@@ -2566,7 +2750,7 @@ var Intents = {
2566
2750
  DIRECT_MESSAGE_TYPING: 14,
2567
2751
  OPEN_FORUM_EVENT: 18,
2568
2752
  AUDIO_OR_LIVE_CHANNEL_MEMBER: 19,
2569
- GROUP_C2C_EVENT: 25,
2753
+ GROUP_AND_C2C_EVENT: 25,
2570
2754
  INTERACTION: 26,
2571
2755
  MESSAGE_AUDIT: 27,
2572
2756
  FORUM_EVENT: 28,
@@ -3058,7 +3242,7 @@ var WebsocketClient = /*#__PURE__*/function (_EventEmitter) {
3058
3242
  this.session.closeSession();
3059
3243
  }
3060
3244
  }]);
3061
- }(WebSocket.EventEmitter);
3245
+ }(node_events.EventEmitter);
3062
3246
 
3063
3247
  // 注册v1接口
3064
3248
  v1Setup();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "woodenfish-bot",
3
- "version": "4.7.0",
3
+ "version": "4.7.2",
4
4
  "description": "woodenfish-bot",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -51,8 +51,8 @@
51
51
  "@types/lodash.assignin": "^4.2.9",
52
52
  "@types/node": "^22.19.7",
53
53
  "@types/ws": "^8.18.1",
54
- "@typescript-eslint/eslint-plugin": "8.65.0",
55
- "@typescript-eslint/parser": "8.65.0",
54
+ "@typescript-eslint/eslint-plugin": "8.67.0",
55
+ "@typescript-eslint/parser": "8.67.0",
56
56
  "chalk": "^5.6.2",
57
57
  "commitizen": "^4.3.2",
58
58
  "cross-env": "^10.1.0",
@@ -72,16 +72,15 @@
72
72
  "release-please": "^17.11.1",
73
73
  "rimraf": "^6.1.3",
74
74
  "rollup": "^4.62.4",
75
- "rollup-plugin-dts": "^6.4.1",
76
- "rollup-plugin-typescript-paths": "^1.5.0",
77
- "typescript": "^5.9.3"
75
+ "rollup-plugin-dts": "^6.5.1",
76
+ "typescript": "^5.9.3"
78
77
  },
79
78
  "dependencies": {
80
79
  "@babel/runtime": "^7.29.2",
81
80
  "loglevel": "^1.9.2",
82
81
  "minimist": "^1.2.8",
83
82
  "resty-client": "^0.0.5",
84
- "ws": "^8.21.1"
83
+ "ws": "^8.21.3"
85
84
  },
86
85
  "resolutions": {
87
86
  "minimist": "^1.2.6",
@@ -1,11 +1,10 @@
1
1
  import { RestyResponse, RequestOptions } from 'resty-client';
2
- import WebSocket, { EventEmitter } from 'ws';
2
+ import { EventEmitter } from 'node:events';
3
+ import WebSocket from 'ws';
3
4
 
4
- interface wsResData {
5
+ interface wsResData<T = any> {
5
6
  op: number;
6
- d?: {
7
- heartbeat_interval?: number;
8
- };
7
+ d?: T;
9
8
  s: number;
10
9
  t: string;
11
10
  id?: string;
@@ -67,7 +66,7 @@ declare enum AvailableIntentsEventsEnum {
67
66
  PUBLIC_GUILD_MESSAGES = "PUBLIC_GUILD_MESSAGES",
68
67
  MESSAGE_AUDIT = "MESSAGE_AUDIT",
69
68
  INTERACTION = "INTERACTION",
70
- GROUP_C2C_EVENT = "GROUP_C2C_EVENT"
69
+ GROUP_AND_C2C_EVENT = "GROUP_AND_C2C_EVENT"
71
70
  }
72
71
  declare const WsEventType: {
73
72
  [key: string]: AvailableIntentsEventsEnum;
@@ -124,7 +123,7 @@ declare const Intents: {
124
123
  DIRECT_MESSAGE_TYPING: number;
125
124
  OPEN_FORUM_EVENT: number;
126
125
  AUDIO_OR_LIVE_CHANNEL_MEMBER: number;
127
- GROUP_C2C_EVENT: number;
126
+ GROUP_AND_C2C_EVENT: number;
128
127
  INTERACTION: number;
129
128
  MESSAGE_AUDIT: number;
130
129
  FORUM_EVENT: number;
@@ -155,6 +154,202 @@ declare const WsObjRequestOptions: (sandbox: boolean) => {
155
154
  };
156
155
  };
157
156
 
157
+ interface GroupAPI {
158
+ getGroupInfo: (groupOpenid: string) => Promise<RestyResponse<GroupInfo>>;
159
+ getGroupBotState: (groupOpenid: string) => Promise<RestyResponse<GroupBotState>>;
160
+ getGroupJoinRequests: (groupOpenid: string, pager?: GroupCursorPager) => Promise<RestyResponse<GroupJoinRequestList>>;
161
+ approveGroupJoinRequest: (groupOpenid: string, memberOpenid: string, options: GroupJoinRequestApproval) => Promise<RestyResponse<Record<string, never>>>;
162
+ getGroupRestrictChatSetting: (groupOpenid: string) => Promise<RestyResponse<GroupRestrictChatSetting>>;
163
+ setGroupRestrictChatSetting: (groupOpenid: string, options: SetGroupRestrictChatSetting) => Promise<RestyResponse<Record<string, never>>>;
164
+ getGroupJoinApprovalStrategies: (pager?: GroupCursorPager) => Promise<RestyResponse<GroupJoinApprovalStrategyList>>;
165
+ createGroupJoinApprovalStrategy: (options: CreateGroupJoinApprovalStrategy) => Promise<RestyResponse<GroupJoinApprovalStrategyResult>>;
166
+ updateGroupJoinApprovalStrategy: (strategyID: string, options: UpdateGroupJoinApprovalStrategy) => Promise<RestyResponse<GroupJoinApprovalStrategyResult>>;
167
+ deleteGroupJoinApprovalStrategy: (strategyID: string) => Promise<RestyResponse<Record<string, never>>>;
168
+ executeGroupJoinApprovalStrategy: (strategyID: string) => Promise<RestyResponse<Record<string, never>>>;
169
+ updateGroupJoinApprovalStrategyWhitelist: (strategyID: string, options: UpdateGroupJoinApprovalStrategyWhitelist) => Promise<RestyResponse<GroupJoinApprovalStrategyWhitelistResult>>;
170
+ }
171
+ interface GroupInfo {
172
+ group_openid: string;
173
+ group_name: string;
174
+ group_finger_memo: string;
175
+ group_class_text: string;
176
+ group_tags: string[];
177
+ group_member_num: number;
178
+ }
179
+ type GroupReceiveMessageSetting = 'all' | 'only_mention' | 'mention_and_context';
180
+ type GroupMemberRole = 'member' | 'owner' | 'admin';
181
+ interface GroupBotState {
182
+ member_openid: string;
183
+ joined_at: string;
184
+ allow_proactive_msg: boolean;
185
+ recv_msg_setting: GroupReceiveMessageSetting;
186
+ member_role: GroupMemberRole;
187
+ }
188
+ interface GroupCursorPager {
189
+ cursor?: string;
190
+ limit?: number;
191
+ }
192
+ interface GroupJoinRequestList {
193
+ list: GroupJoinRequest[];
194
+ next_cursor: string;
195
+ }
196
+ type GroupJoinApplySource = 'self_apply' | 'invited';
197
+ type GroupJoinVerifyMethod = 'verify_message' | 'admin_review_qa';
198
+ interface GroupJoinReviewQA {
199
+ question: string;
200
+ answer: string;
201
+ }
202
+ interface GroupJoinVerifyInfo {
203
+ method: GroupJoinVerifyMethod;
204
+ verify_message?: string;
205
+ review_qa_list?: GroupJoinReviewQA[];
206
+ }
207
+ interface GroupJoinRequest {
208
+ join_request_id: string;
209
+ risk_tips?: string;
210
+ union_openid?: string;
211
+ member_openid: string;
212
+ username: string;
213
+ apply_at: string;
214
+ apply_source: GroupJoinApplySource;
215
+ invited_by?: string;
216
+ bot?: boolean;
217
+ verify_info?: GroupJoinVerifyInfo;
218
+ }
219
+ interface GroupJoinRequestApproval {
220
+ op: 'approve' | 'decline';
221
+ join_request_id?: string;
222
+ reject_reason?: string;
223
+ add_to_member_blacklist?: boolean;
224
+ }
225
+ type GroupMuteMode = 'none' | 'always' | 'schedule';
226
+ interface GroupMuteScheduleRule {
227
+ task_id: string;
228
+ start_at: string;
229
+ end_at: string;
230
+ enabled: boolean;
231
+ }
232
+ interface GroupMuteRecurringRule {
233
+ task_id: string;
234
+ weekdays: number[];
235
+ start_time: string;
236
+ end_time: string;
237
+ enabled: boolean;
238
+ }
239
+ interface GroupGlobalMuteRule {
240
+ mode: GroupMuteMode;
241
+ schedule_rules: GroupMuteScheduleRule[];
242
+ recurring_rules: GroupMuteRecurringRule[];
243
+ }
244
+ interface GroupMemberMuteState {
245
+ member_openid: string;
246
+ mute_expire_at: string;
247
+ username: string;
248
+ union_openid?: string;
249
+ }
250
+ interface GroupRestrictChatSetting {
251
+ global_rule: GroupGlobalMuteRule;
252
+ members: GroupMemberMuteState[];
253
+ }
254
+ interface SetGroupMemberMuteState {
255
+ op: 'add' | 'update' | 'del';
256
+ member_openid: string;
257
+ mute_expire_at?: string;
258
+ }
259
+ interface SetGroupRestrictChatSetting {
260
+ members?: SetGroupMemberMuteState[];
261
+ }
262
+ type GroupJoinApprovalStrategyState = 'on' | 'off';
263
+ type GroupJoinApprovalStrategyGroups = {
264
+ group_openids: string[];
265
+ group_ids?: never;
266
+ } | {
267
+ group_ids: number[];
268
+ group_openids?: never;
269
+ };
270
+ interface GroupJoinApprovalStrategy {
271
+ strategy_id: string;
272
+ group_openids?: string[];
273
+ group_ids?: string[];
274
+ whitelist_user_count: number;
275
+ is_enable: GroupJoinApprovalStrategyState;
276
+ expire_at: string;
277
+ created_at: string;
278
+ updated_at: string;
279
+ remark?: string;
280
+ }
281
+ interface GroupJoinApprovalStrategyList {
282
+ strategies: GroupJoinApprovalStrategy[];
283
+ next_cursor: string;
284
+ }
285
+ type CreateGroupJoinApprovalStrategy = GroupJoinApprovalStrategyGroups & {
286
+ is_enable?: GroupJoinApprovalStrategyState;
287
+ expire_at?: string;
288
+ remark?: string;
289
+ };
290
+ type GroupJoinApprovalStrategyGroupAction = GroupJoinApprovalStrategyGroups & {
291
+ op: 'add' | 'del';
292
+ };
293
+ interface UpdateGroupJoinApprovalStrategy {
294
+ is_enable?: GroupJoinApprovalStrategyState;
295
+ expire_at?: string;
296
+ group_action?: GroupJoinApprovalStrategyGroupAction;
297
+ remark?: string;
298
+ }
299
+ interface GroupJoinApprovalStrategyResult {
300
+ strategy_id?: string;
301
+ is_enable: GroupJoinApprovalStrategyState;
302
+ expire_at: string;
303
+ }
304
+ interface UpdateGroupJoinApprovalStrategyWhitelist {
305
+ op: 'add' | 'del';
306
+ whitelist_users: string[];
307
+ }
308
+ interface GroupJoinApprovalStrategyWhitelistResult {
309
+ strategy_id: string;
310
+ whitelist_user_count: number;
311
+ updated_at: string;
312
+ }
313
+
314
+ interface GroupRobotEvent {
315
+ timestamp: number;
316
+ group_openid: string;
317
+ op_member_openid: string;
318
+ }
319
+ type GroupAddRobotEvent = GroupRobotEvent;
320
+ type GroupDelRobotEvent = GroupRobotEvent;
321
+ type GroupMsgReceiveEvent = GroupRobotEvent;
322
+ type GroupMsgRejectEvent = GroupRobotEvent;
323
+ interface GroupMemberEvent {
324
+ timestamp: number;
325
+ group_openid: string;
326
+ member_openid: string;
327
+ user_openid?: string;
328
+ }
329
+ type GroupMemberAddEvent = GroupMemberEvent;
330
+ type GroupMemberRemoveEvent = GroupMemberEvent;
331
+ interface GroupJoinRequestEvent extends GroupJoinRequest {
332
+ group_openid: string;
333
+ auto_approved?: {
334
+ strategy_id: string;
335
+ };
336
+ }
337
+ interface GroupEventPayloadMap {
338
+ GROUP_ADD_ROBOT: GroupAddRobotEvent;
339
+ GROUP_DEL_ROBOT: GroupDelRobotEvent;
340
+ GROUP_MSG_RECEIVE: GroupMsgReceiveEvent;
341
+ GROUP_MSG_REJECT: GroupMsgRejectEvent;
342
+ GROUP_MEMBER_ADD: GroupMemberAddEvent;
343
+ GROUP_MEMBER_REMOVE: GroupMemberRemoveEvent;
344
+ GROUP_JOIN_REQUEST: GroupJoinRequestEvent;
345
+ }
346
+ type GroupEventType = keyof GroupEventPayloadMap;
347
+ interface WebsocketEventData<T = unknown> {
348
+ eventType: string;
349
+ eventId: string;
350
+ msg: T;
351
+ }
352
+
158
353
  interface AudioAPI {
159
354
  postAudio: (channelID: string, value: AudioControl) => Promise<RestyResponse<AudioControl>>;
160
355
  botOnMic: (channelID: string) => Promise<RestyResponse<{}>>;
@@ -654,7 +849,10 @@ interface GuildPermissionDemandIdentify {
654
849
  method: string;
655
850
  }
656
851
 
657
- type OpenAPIRequest = <T extends Record<any, any> = any>(options: RequestOptions) => Promise<RestyResponse<T>>;
852
+ interface OpenAPIRequestOptions extends RequestOptions {
853
+ apiVersion?: string;
854
+ }
855
+ type OpenAPIRequest = <T extends Record<any, any> = any>(options: OpenAPIRequestOptions) => Promise<RestyResponse<T>>;
658
856
  interface Config {
659
857
  appID: string;
660
858
  token: string;
@@ -682,6 +880,7 @@ interface IOpenAPI {
682
880
  reactionApi: ReactionAPI;
683
881
  interactionApi: InteractionAPI;
684
882
  pinsMessageApi: PinsMessageAPI;
883
+ groupApi: GroupAPI;
685
884
  }
686
885
  type APIVersion = `v${number}`;
687
886
  interface Token {
@@ -715,6 +914,7 @@ declare class OpenAPI implements IOpenAPI {
715
914
  interactionApi: InteractionAPI;
716
915
  pinsMessageApi: PinsMessageAPI;
717
916
  guildPermissionsApi: GuildPermissionsAPI;
917
+ groupApi: GroupAPI;
718
918
  constructor(config: Config);
719
919
  register(client: IOpenAPI): void;
720
920
  request<T extends Record<any, any> = any>(options: any): Promise<RestyResponse<T>>;
@@ -775,4 +975,4 @@ declare function createOpenAPI(config: Config): OpenAPI;
775
975
  declare function createWebsocket(config: GetWsParam): WebsocketClient;
776
976
 
777
977
  export { AvailableIntentsEventsEnum, IntentEvents, Intents, OpCode, SessionEvents, WSCodes, WebsocketCloseReason, WebsocketCode, WsEventType, WsObjRequestOptions, createOpenAPI, createWebsocket, selectOpenAPIVersion };
778
- export type { APIVersion, Action, AnnounceAPI, Ark, ArkKV, ArkObj, ArkObjKV, AudioAPI, AudioControl, Button, ChannelAPI, ChannelPermissionsAPI, ChannelSubType, ChannelType, Config, CustomKeyboard, DirectMessageAPI, DirectMessageToCreate, Embed, EmbedField, EmbedThumbnail, EventTypes, GetWsParam, GuildAPI, GuildMembersPager, GuildPermission, GuildPermissionDemand, GuildPermissionDemandIdentify, GuildPermissionRes, GuildPermissionsAPI, GuildRoles, HeartbeatParam, IAnnounce, IChannel, IChannelPermissions, IChannelRolePermissions, IDirectMessage, IGuild, IMedia, IMember, IMessage, IMessageRes, IOpenAPI, IPinsMessage, IRole, IRoleFilter, ISchedule, IUser, IVoiceMember, InputNotify, IntentEventsMapType, InteractionAPI, InteractionData, MeAPI, MeGuildsReq, Media, MediaToCreate, MemberAPI, MemberAddRoleBody, MessageAPI, MessageAttachment, MessageKeyboard, MessageReference, MessageToCreate, MessagesPager, MuteAPI, MuteOptions, Nullish, OpenAPIRequest, PatchChannelObj, Permission, PermissionDemandToCreate, PinsMessageAPI, PostChannelObj, ReactionAPI, ReactionObj, ReactionUserListObj, RecommendChannel, RecommendObj, RenderData, RoleAPI, Row, ScheduleAPI, ScheduleRemindType, ScheduleToCreate, ScheduleToPatch, SessionRecord, ThreadReplyToCreate, ThreadsAPI, ThreadsToCreate, Token, UpdateChannelPermissions, UpdateRoleRes, WebsocketAPI, WsAddressObj, WsDataInfo, wsResData };
978
+ export type { APIVersion, Action, AnnounceAPI, Ark, ArkKV, ArkObj, ArkObjKV, AudioAPI, AudioControl, Button, ChannelAPI, ChannelPermissionsAPI, ChannelSubType, ChannelType, Config, CreateGroupJoinApprovalStrategy, CustomKeyboard, DirectMessageAPI, DirectMessageToCreate, Embed, EmbedField, EmbedThumbnail, EventTypes, GetWsParam, GroupAPI, GroupAddRobotEvent, GroupBotState, GroupCursorPager, GroupDelRobotEvent, GroupEventPayloadMap, GroupEventType, GroupGlobalMuteRule, GroupInfo, GroupJoinApplySource, GroupJoinApprovalStrategy, GroupJoinApprovalStrategyGroupAction, GroupJoinApprovalStrategyGroups, GroupJoinApprovalStrategyList, GroupJoinApprovalStrategyResult, GroupJoinApprovalStrategyState, GroupJoinApprovalStrategyWhitelistResult, GroupJoinRequest, GroupJoinRequestApproval, GroupJoinRequestEvent, GroupJoinRequestList, GroupJoinReviewQA, GroupJoinVerifyInfo, GroupJoinVerifyMethod, GroupMemberAddEvent, GroupMemberEvent, GroupMemberMuteState, GroupMemberRemoveEvent, GroupMemberRole, GroupMsgReceiveEvent, GroupMsgRejectEvent, GroupMuteMode, GroupMuteRecurringRule, GroupMuteScheduleRule, GroupReceiveMessageSetting, GroupRestrictChatSetting, GroupRobotEvent, GuildAPI, GuildMembersPager, GuildPermission, GuildPermissionDemand, GuildPermissionDemandIdentify, GuildPermissionRes, GuildPermissionsAPI, GuildRoles, HeartbeatParam, IAnnounce, IChannel, IChannelPermissions, IChannelRolePermissions, IDirectMessage, IGuild, IMedia, IMember, IMessage, IMessageRes, IOpenAPI, IPinsMessage, IRole, IRoleFilter, ISchedule, IUser, IVoiceMember, InputNotify, IntentEventsMapType, InteractionAPI, InteractionData, MeAPI, MeGuildsReq, Media, MediaToCreate, MemberAPI, MemberAddRoleBody, MessageAPI, MessageAttachment, MessageKeyboard, MessageReference, MessageToCreate, MessagesPager, MuteAPI, MuteOptions, Nullish, OpenAPIRequest, OpenAPIRequestOptions, PatchChannelObj, Permission, PermissionDemandToCreate, PinsMessageAPI, PostChannelObj, ReactionAPI, ReactionObj, ReactionUserListObj, RecommendChannel, RecommendObj, RenderData, RoleAPI, Row, ScheduleAPI, ScheduleRemindType, ScheduleToCreate, ScheduleToPatch, SessionRecord, SetGroupMemberMuteState, SetGroupRestrictChatSetting, ThreadReplyToCreate, ThreadsAPI, ThreadsToCreate, Token, UpdateChannelPermissions, UpdateGroupJoinApprovalStrategy, UpdateGroupJoinApprovalStrategyWhitelist, UpdateRoleRes, WebsocketAPI, WebsocketEventData, WsAddressObj, WsDataInfo, wsResData };