woodenfish-bot 2.0.7 → 2.1.0

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
@@ -1,3 +1 @@
1
- # NodeSDK
2
-
3
- Node.js SDK。
1
+ # woodenfish-bot
package/es/index.js CHANGED
@@ -102,6 +102,8 @@ var apiMap = {
102
102
  channelRolePermissionsURI: '/channels/:channelID/roles/:roleID/permissions',
103
103
  schedulesURI: '/channels/:channelID/schedules',
104
104
  scheduleURI: '/channels/:channelID/schedules/:scheduleID',
105
+ threadsURI: '/channels/:channelID/threads',
106
+ threadURI: '/channels/:channelID/threads/:threadID',
105
107
  guildPermissionURI: '/guilds/:guildID/api_permission',
106
108
  guildPermissionDemandURI: '/guilds/:guildID/api_permission/demand',
107
109
  wsInfo: '/gateway/bot',
@@ -733,7 +735,7 @@ try {
733
735
 
734
736
  var _regeneratorRuntime = /*@__PURE__*/getDefaultExportFromCjs(regenerator);
735
737
 
736
- var version = "2.0.7";
738
+ var version = "2.1.0";
737
739
 
738
740
  var loglevel = {exports: {}};
739
741
 
@@ -1259,6 +1261,7 @@ var Channel = /*#__PURE__*/function () {
1259
1261
  this.request = request;
1260
1262
  this.config = config;
1261
1263
  }
1264
+
1262
1265
  // 获取子频道信息
1263
1266
  return _createClass(Channel, [{
1264
1267
  key: "channel",
@@ -1322,6 +1325,7 @@ var Channel = /*#__PURE__*/function () {
1322
1325
  };
1323
1326
  return this.request(options);
1324
1327
  }
1328
+
1325
1329
  // 删除指定子频道
1326
1330
  }, {
1327
1331
  key: "deleteChannel",
@@ -1669,6 +1673,7 @@ var Role = /*#__PURE__*/function () {
1669
1673
  this.request = request;
1670
1674
  this.config = config;
1671
1675
  }
1676
+
1672
1677
  // 获取频道身份组列表
1673
1678
  return _createClass(Role, [{
1674
1679
  key: "roles",
@@ -1755,6 +1760,7 @@ var DirectMessage = /*#__PURE__*/function () {
1755
1760
  this.request = request;
1756
1761
  this.config = config;
1757
1762
  }
1763
+
1758
1764
  // 创建私信频道
1759
1765
  return _createClass(DirectMessage, [{
1760
1766
  key: "createDirectMessage",
@@ -1879,6 +1885,7 @@ var Audio = /*#__PURE__*/function () {
1879
1885
  this.request = request;
1880
1886
  this.config = config;
1881
1887
  }
1888
+
1882
1889
  // 执行音频播放,暂停等操作
1883
1890
  return _createClass(Audio, [{
1884
1891
  key: "postAudio",
@@ -1893,6 +1900,7 @@ var Audio = /*#__PURE__*/function () {
1893
1900
  };
1894
1901
  return this.request(options);
1895
1902
  }
1903
+
1896
1904
  // 机器人上麦
1897
1905
  }, {
1898
1906
  key: "botOnMic",
@@ -1907,6 +1915,7 @@ var Audio = /*#__PURE__*/function () {
1907
1915
  };
1908
1916
  return this.request(options);
1909
1917
  }
1918
+
1910
1919
  // 机器人下麦
1911
1920
  }, {
1912
1921
  key: "botOffMic",
@@ -2182,6 +2191,78 @@ var Schedule = /*#__PURE__*/function () {
2182
2191
  }]);
2183
2192
  }();
2184
2193
 
2194
+ var Threads = /*#__PURE__*/function () {
2195
+ function Threads(request, config) {
2196
+ _classCallCheck(this, Threads);
2197
+ _defineProperty(this, "request", void 0);
2198
+ _defineProperty(this, "config", void 0);
2199
+ this.request = request;
2200
+ this.config = config;
2201
+ }
2202
+
2203
+ // 获取帖子列表
2204
+ return _createClass(Threads, [{
2205
+ key: "threads",
2206
+ value: function threads(channelID) {
2207
+ var options = {
2208
+ method: 'GET',
2209
+ url: getURL('threadsURI'),
2210
+ rest: {
2211
+ channelID: channelID
2212
+ }
2213
+ };
2214
+ return this.request(options);
2215
+ }
2216
+
2217
+ // 获取帖子详情
2218
+ }, {
2219
+ key: "thread",
2220
+ value: function thread(channelID, ThreadsID) {
2221
+ var options = {
2222
+ method: 'GET',
2223
+ url: getURL('threadURI'),
2224
+ rest: {
2225
+ channelID: channelID,
2226
+ ThreadsID: ThreadsID
2227
+ }
2228
+ };
2229
+ return this.request(options);
2230
+ }
2231
+
2232
+ // 发表帖子
2233
+ }, {
2234
+ key: "putThreads",
2235
+ value: function putThreads(channelID, _Threads2) {
2236
+ var options = {
2237
+ method: 'POST',
2238
+ url: getURL('threadsURI'),
2239
+ rest: {
2240
+ channelID: channelID
2241
+ },
2242
+ data: {
2243
+ Threads: _Threads2
2244
+ }
2245
+ };
2246
+ return this.request(options);
2247
+ }
2248
+
2249
+ // 删除帖子
2250
+ }, {
2251
+ key: "deleteThreads",
2252
+ value: function deleteThreads(channelID, ThreadsID) {
2253
+ var options = {
2254
+ method: 'DELETE',
2255
+ url: getURL('threadURI'),
2256
+ rest: {
2257
+ channelID: channelID,
2258
+ ThreadsID: ThreadsID
2259
+ }
2260
+ };
2261
+ return this.request(options);
2262
+ }
2263
+ }]);
2264
+ }();
2265
+
2185
2266
  var GuildPermissions = /*#__PURE__*/function () {
2186
2267
  function GuildPermissions(request, config) {
2187
2268
  _classCallCheck(this, GuildPermissions);
@@ -2270,6 +2351,7 @@ var OpenAPI = /*#__PURE__*/function () {
2270
2351
  _defineProperty(this, "muteApi", void 0);
2271
2352
  _defineProperty(this, "announceApi", void 0);
2272
2353
  _defineProperty(this, "scheduleApi", void 0);
2354
+ _defineProperty(this, "threadsApi", void 0);
2273
2355
  _defineProperty(this, "directMessageApi", void 0);
2274
2356
  _defineProperty(this, "channelPermissionsApi", void 0);
2275
2357
  _defineProperty(this, "audioApi", void 0);
@@ -2293,6 +2375,7 @@ var OpenAPI = /*#__PURE__*/function () {
2293
2375
  client.muteApi = new Mute(this.request, this.config);
2294
2376
  client.announceApi = new Announce(this.request, this.config);
2295
2377
  client.scheduleApi = new Schedule(this.request, this.config);
2378
+ client.threadsApi = new Threads(this.request, this.config);
2296
2379
  client.directMessageApi = new DirectMessage(this.request, this.config);
2297
2380
  client.channelPermissionsApi = new ChannelPermissions(this.request, this.config);
2298
2381
  client.audioApi = new Audio(this.request, this.config);
@@ -3177,10 +3260,12 @@ function selectOpenAPIVersion(version) {
3177
3260
  }
3178
3261
  defaultImpl = versionMapping[version];
3179
3262
  }
3263
+
3180
3264
  // 如果需要使用其他版本的实现,需要在调用这个方法之前调用 SelectOpenAPIVersion 方法
3181
3265
  function createOpenAPI(config) {
3182
3266
  return defaultImpl.newClient(config);
3183
3267
  }
3268
+
3184
3269
  // ws连接新建
3185
3270
  function createWebsocket(config) {
3186
3271
  return new WebsocketClient(config);
package/lib/index.js CHANGED
@@ -104,6 +104,8 @@ var apiMap = {
104
104
  channelRolePermissionsURI: '/channels/:channelID/roles/:roleID/permissions',
105
105
  schedulesURI: '/channels/:channelID/schedules',
106
106
  scheduleURI: '/channels/:channelID/schedules/:scheduleID',
107
+ threadsURI: '/channels/:channelID/threads',
108
+ threadURI: '/channels/:channelID/threads/:threadID',
107
109
  guildPermissionURI: '/guilds/:guildID/api_permission',
108
110
  guildPermissionDemandURI: '/guilds/:guildID/api_permission/demand',
109
111
  wsInfo: '/gateway/bot',
@@ -735,7 +737,7 @@ try {
735
737
 
736
738
  var _regeneratorRuntime = /*@__PURE__*/getDefaultExportFromCjs(regenerator);
737
739
 
738
- var version = "2.0.7";
740
+ var version = "2.1.0";
739
741
 
740
742
  var loglevel = {exports: {}};
741
743
 
@@ -1261,6 +1263,7 @@ var Channel = /*#__PURE__*/function () {
1261
1263
  this.request = request;
1262
1264
  this.config = config;
1263
1265
  }
1266
+
1264
1267
  // 获取子频道信息
1265
1268
  return _createClass(Channel, [{
1266
1269
  key: "channel",
@@ -1324,6 +1327,7 @@ var Channel = /*#__PURE__*/function () {
1324
1327
  };
1325
1328
  return this.request(options);
1326
1329
  }
1330
+
1327
1331
  // 删除指定子频道
1328
1332
  }, {
1329
1333
  key: "deleteChannel",
@@ -1671,6 +1675,7 @@ var Role = /*#__PURE__*/function () {
1671
1675
  this.request = request;
1672
1676
  this.config = config;
1673
1677
  }
1678
+
1674
1679
  // 获取频道身份组列表
1675
1680
  return _createClass(Role, [{
1676
1681
  key: "roles",
@@ -1757,6 +1762,7 @@ var DirectMessage = /*#__PURE__*/function () {
1757
1762
  this.request = request;
1758
1763
  this.config = config;
1759
1764
  }
1765
+
1760
1766
  // 创建私信频道
1761
1767
  return _createClass(DirectMessage, [{
1762
1768
  key: "createDirectMessage",
@@ -1881,6 +1887,7 @@ var Audio = /*#__PURE__*/function () {
1881
1887
  this.request = request;
1882
1888
  this.config = config;
1883
1889
  }
1890
+
1884
1891
  // 执行音频播放,暂停等操作
1885
1892
  return _createClass(Audio, [{
1886
1893
  key: "postAudio",
@@ -1895,6 +1902,7 @@ var Audio = /*#__PURE__*/function () {
1895
1902
  };
1896
1903
  return this.request(options);
1897
1904
  }
1905
+
1898
1906
  // 机器人上麦
1899
1907
  }, {
1900
1908
  key: "botOnMic",
@@ -1909,6 +1917,7 @@ var Audio = /*#__PURE__*/function () {
1909
1917
  };
1910
1918
  return this.request(options);
1911
1919
  }
1920
+
1912
1921
  // 机器人下麦
1913
1922
  }, {
1914
1923
  key: "botOffMic",
@@ -2184,6 +2193,78 @@ var Schedule = /*#__PURE__*/function () {
2184
2193
  }]);
2185
2194
  }();
2186
2195
 
2196
+ var Threads = /*#__PURE__*/function () {
2197
+ function Threads(request, config) {
2198
+ _classCallCheck(this, Threads);
2199
+ _defineProperty(this, "request", void 0);
2200
+ _defineProperty(this, "config", void 0);
2201
+ this.request = request;
2202
+ this.config = config;
2203
+ }
2204
+
2205
+ // 获取帖子列表
2206
+ return _createClass(Threads, [{
2207
+ key: "threads",
2208
+ value: function threads(channelID) {
2209
+ var options = {
2210
+ method: 'GET',
2211
+ url: getURL('threadsURI'),
2212
+ rest: {
2213
+ channelID: channelID
2214
+ }
2215
+ };
2216
+ return this.request(options);
2217
+ }
2218
+
2219
+ // 获取帖子详情
2220
+ }, {
2221
+ key: "thread",
2222
+ value: function thread(channelID, ThreadsID) {
2223
+ var options = {
2224
+ method: 'GET',
2225
+ url: getURL('threadURI'),
2226
+ rest: {
2227
+ channelID: channelID,
2228
+ ThreadsID: ThreadsID
2229
+ }
2230
+ };
2231
+ return this.request(options);
2232
+ }
2233
+
2234
+ // 发表帖子
2235
+ }, {
2236
+ key: "putThreads",
2237
+ value: function putThreads(channelID, _Threads2) {
2238
+ var options = {
2239
+ method: 'POST',
2240
+ url: getURL('threadsURI'),
2241
+ rest: {
2242
+ channelID: channelID
2243
+ },
2244
+ data: {
2245
+ Threads: _Threads2
2246
+ }
2247
+ };
2248
+ return this.request(options);
2249
+ }
2250
+
2251
+ // 删除帖子
2252
+ }, {
2253
+ key: "deleteThreads",
2254
+ value: function deleteThreads(channelID, ThreadsID) {
2255
+ var options = {
2256
+ method: 'DELETE',
2257
+ url: getURL('threadURI'),
2258
+ rest: {
2259
+ channelID: channelID,
2260
+ ThreadsID: ThreadsID
2261
+ }
2262
+ };
2263
+ return this.request(options);
2264
+ }
2265
+ }]);
2266
+ }();
2267
+
2187
2268
  var GuildPermissions = /*#__PURE__*/function () {
2188
2269
  function GuildPermissions(request, config) {
2189
2270
  _classCallCheck(this, GuildPermissions);
@@ -2272,6 +2353,7 @@ var OpenAPI = /*#__PURE__*/function () {
2272
2353
  _defineProperty(this, "muteApi", void 0);
2273
2354
  _defineProperty(this, "announceApi", void 0);
2274
2355
  _defineProperty(this, "scheduleApi", void 0);
2356
+ _defineProperty(this, "threadsApi", void 0);
2275
2357
  _defineProperty(this, "directMessageApi", void 0);
2276
2358
  _defineProperty(this, "channelPermissionsApi", void 0);
2277
2359
  _defineProperty(this, "audioApi", void 0);
@@ -2295,6 +2377,7 @@ var OpenAPI = /*#__PURE__*/function () {
2295
2377
  client.muteApi = new Mute(this.request, this.config);
2296
2378
  client.announceApi = new Announce(this.request, this.config);
2297
2379
  client.scheduleApi = new Schedule(this.request, this.config);
2380
+ client.threadsApi = new Threads(this.request, this.config);
2298
2381
  client.directMessageApi = new DirectMessage(this.request, this.config);
2299
2382
  client.channelPermissionsApi = new ChannelPermissions(this.request, this.config);
2300
2383
  client.audioApi = new Audio(this.request, this.config);
@@ -3179,10 +3262,12 @@ function selectOpenAPIVersion(version) {
3179
3262
  }
3180
3263
  defaultImpl = versionMapping[version];
3181
3264
  }
3265
+
3182
3266
  // 如果需要使用其他版本的实现,需要在调用这个方法之前调用 SelectOpenAPIVersion 方法
3183
3267
  function createOpenAPI(config) {
3184
3268
  return defaultImpl.newClient(config);
3185
3269
  }
3270
+
3186
3271
  // ws连接新建
3187
3272
  function createWebsocket(config) {
3188
3273
  return new WebsocketClient(config);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "woodenfish-bot",
3
- "version": "2.0.7",
3
+ "version": "2.1.0",
4
4
  "description": "woodenfish-bot",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -69,7 +69,7 @@
69
69
  "prettier": "^3.2.5",
70
70
  "readline-sync": "^1.4.10",
71
71
  "rimraf": "^5.0.5",
72
- "rollup": "^4.14.1",
72
+ "rollup": "^4.14.2",
73
73
  "rollup-plugin-dts": "^6.1.0",
74
74
  "rollup-plugin-typescript-paths": "^1.5.0",
75
75
  "standard-version": "^9.5.0",
@@ -556,6 +556,21 @@ interface ISchedule extends ScheduleToCreate {
556
556
  }
557
557
  type ScheduleToPatch = Partial<Omit<ISchedule, 'id'>>;
558
558
 
559
+ /**
560
+ * ============= Threads 日程接口 =============
561
+ */
562
+ interface ThreadsAPI {
563
+ thread: (channelID: string, ThreadsID: string) => Promise<RestyResponse<any>>;
564
+ threads: (channelID: string) => Promise<RestyResponse<any>>;
565
+ putThreads: (channelID: string, Threads: ThreadsToCreate) => Promise<RestyResponse<any>>;
566
+ deleteThreads: (channelID: string, ThreadsID: string) => Promise<RestyResponse<any>>;
567
+ }
568
+ interface ThreadsToCreate {
569
+ title: string;
570
+ content?: string;
571
+ format?: number;
572
+ }
573
+
559
574
  /**
560
575
  * ============= Reaction 接口 =============
561
576
  */
@@ -651,6 +666,7 @@ interface IOpenAPI {
651
666
  muteApi: MuteAPI;
652
667
  announceApi: AnnounceAPI;
653
668
  scheduleApi: ScheduleAPI;
669
+ threadsApi: ThreadsAPI;
654
670
  directMessageApi: DirectMessageAPI;
655
671
  channelPermissionsApi: ChannelPermissionsAPI;
656
672
  audioApi: AudioAPI;
@@ -683,6 +699,7 @@ declare class OpenAPI implements IOpenAPI {
683
699
  muteApi: MuteAPI;
684
700
  announceApi: AnnounceAPI;
685
701
  scheduleApi: ScheduleAPI;
702
+ threadsApi: ThreadsAPI;
686
703
  directMessageApi: DirectMessageAPI;
687
704
  channelPermissionsApi: ChannelPermissionsAPI;
688
705
  audioApi: AudioAPI;
@@ -749,4 +766,4 @@ declare function selectOpenAPIVersion(version: APIVersion): false | undefined;
749
766
  declare function createOpenAPI(config: Config): OpenAPI;
750
767
  declare function createWebsocket(config: GetWsParam): WebsocketClient;
751
768
 
752
- export { type APIVersion, type Action, type AnnounceAPI, type Ark, type ArkKV, type ArkObj, type ArkObjKV, type AudioAPI, type AudioControl, AvailableIntentsEventsEnum, type Button, type ChannelAPI, type ChannelPermissionsAPI, type ChannelSubType, type ChannelType, type Config, type CustomKeyboard, type DirectMessageAPI, type DirectMessageToCreate, type Embed, type EmbedField, type EmbedThumbnail, type EventTypes, type GetWsParam, type GuildAPI, type GuildMembersPager, type GuildPermission, type GuildPermissionDemand, type GuildPermissionDemandIdentify, type GuildPermissionRes, type GuildPermissionsAPI, type GuildRoles, type HeartbeatParam, type IAnnounce, type IChannel, type IChannelPermissions, type IChannelRolePermissions, type IDirectMessage, type IGuild, type IMedia, type IMember, type IMessage, type IMessageRes, type IOpenAPI, type IPinsMessage, type IRole, type IRoleFilter, type ISchedule, type IUser, type IVoiceMember, type InputNotify, IntentEvents, type IntentEventsMapType, Intents, type InteractionAPI, type InteractionData, type MeAPI, type MeGuildsReq, type Media, type MediaToCreate, type MemberAPI, type MemberAddRoleBody, type MessageAPI, type MessageAttachment, type MessageKeyboard, type MessageReference, type MessageToCreate, type MessagesPager, type MuteAPI, type MuteOptions, type Nullish, OpCode, type OpenAPIRequest, type PatchChannelObj, type Permission, type PermissionDemandToCreate, type PinsMessageAPI, type PostChannelObj, type ReactionAPI, type ReactionObj, type ReactionUserListObj, type RecommendChannel, type RecommendObj, type RenderData, type RoleAPI, type Row, type ScheduleAPI, type ScheduleRemindType, type ScheduleToCreate, type ScheduleToPatch, SessionEvents, type SessionRecord, type Token, type UpdateChannelPermissions, type UpdateRoleRes, WSCodes, type WebsocketAPI, WebsocketCloseReason, WebsocketCode, type WsAddressObj, type WsDataInfo, WsEventType, WsObjRequestOptions, createOpenAPI, createWebsocket, selectOpenAPIVersion, type wsResData };
769
+ export { type APIVersion, type Action, type AnnounceAPI, type Ark, type ArkKV, type ArkObj, type ArkObjKV, type AudioAPI, type AudioControl, AvailableIntentsEventsEnum, type Button, type ChannelAPI, type ChannelPermissionsAPI, type ChannelSubType, type ChannelType, type Config, type CustomKeyboard, type DirectMessageAPI, type DirectMessageToCreate, type Embed, type EmbedField, type EmbedThumbnail, type EventTypes, type GetWsParam, type GuildAPI, type GuildMembersPager, type GuildPermission, type GuildPermissionDemand, type GuildPermissionDemandIdentify, type GuildPermissionRes, type GuildPermissionsAPI, type GuildRoles, type HeartbeatParam, type IAnnounce, type IChannel, type IChannelPermissions, type IChannelRolePermissions, type IDirectMessage, type IGuild, type IMedia, type IMember, type IMessage, type IMessageRes, type IOpenAPI, type IPinsMessage, type IRole, type IRoleFilter, type ISchedule, type IUser, type IVoiceMember, type InputNotify, IntentEvents, type IntentEventsMapType, Intents, type InteractionAPI, type InteractionData, type MeAPI, type MeGuildsReq, type Media, type MediaToCreate, type MemberAPI, type MemberAddRoleBody, type MessageAPI, type MessageAttachment, type MessageKeyboard, type MessageReference, type MessageToCreate, type MessagesPager, type MuteAPI, type MuteOptions, type Nullish, OpCode, type OpenAPIRequest, type PatchChannelObj, type Permission, type PermissionDemandToCreate, type PinsMessageAPI, type PostChannelObj, type ReactionAPI, type ReactionObj, type ReactionUserListObj, type RecommendChannel, type RecommendObj, type RenderData, type RoleAPI, type Row, type ScheduleAPI, type ScheduleRemindType, type ScheduleToCreate, type ScheduleToPatch, SessionEvents, type SessionRecord, type ThreadsAPI, type ThreadsToCreate, type Token, type UpdateChannelPermissions, type UpdateRoleRes, WSCodes, type WebsocketAPI, WebsocketCloseReason, WebsocketCode, type WsAddressObj, type WsDataInfo, WsEventType, WsObjRequestOptions, createOpenAPI, createWebsocket, selectOpenAPIVersion, type wsResData };