disgroove 2.1.3 → 2.2.0-dev.15819eb

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.
Files changed (40) hide show
  1. package/dist/lib/Client.d.ts +213 -195
  2. package/dist/lib/constants.d.ts +1 -1
  3. package/dist/lib/constants.js +7 -7
  4. package/dist/lib/gateway/Shard.d.ts +2 -1
  5. package/dist/lib/gateway/Shard.js +2 -0
  6. package/dist/lib/index.d.ts +0 -1
  7. package/dist/lib/index.js +0 -1
  8. package/dist/lib/rest/CDN.d.ts +21 -20
  9. package/dist/lib/rest/Endpoints.d.ts +82 -81
  10. package/dist/lib/rest/RequestManager.d.ts +7 -0
  11. package/dist/lib/rest/RequestManager.js +1 -5
  12. package/dist/lib/types/application-command.d.ts +21 -21
  13. package/dist/lib/types/application-role-connection-metadata.d.ts +1 -1
  14. package/dist/lib/types/application.d.ts +10 -7
  15. package/dist/lib/types/audit-log.d.ts +21 -14
  16. package/dist/lib/types/auto-moderation.d.ts +13 -12
  17. package/dist/lib/types/channel.d.ts +96 -88
  18. package/dist/lib/types/common.d.ts +4 -0
  19. package/dist/lib/types/common.js +2 -0
  20. package/dist/lib/types/emoji.d.ts +6 -5
  21. package/dist/lib/types/entitlements.d.ts +19 -18
  22. package/dist/lib/types/gateway-events.d.ts +158 -149
  23. package/dist/lib/types/guild-scheduled-event.d.ts +21 -19
  24. package/dist/lib/types/guild-template.d.ts +11 -9
  25. package/dist/lib/types/guild.d.ts +84 -79
  26. package/dist/lib/types/interaction.d.ts +38 -29
  27. package/dist/lib/types/invite.d.ts +9 -4
  28. package/dist/lib/types/message-components.d.ts +4 -3
  29. package/dist/lib/types/role.d.ts +9 -8
  30. package/dist/lib/types/sku.d.ts +5 -4
  31. package/dist/lib/types/stage-instance.d.ts +11 -10
  32. package/dist/lib/types/sticker.d.ts +18 -17
  33. package/dist/lib/types/team.d.ts +8 -7
  34. package/dist/lib/types/user.d.ts +11 -9
  35. package/dist/lib/types/voice.d.ts +12 -11
  36. package/dist/lib/types/webhook.d.ts +15 -10
  37. package/dist/package.json +3 -3
  38. package/package.json +1 -1
  39. package/dist/lib/types/index.d.ts +0 -26
  40. package/dist/lib/types/index.js +0 -40
@@ -1,5 +1,6 @@
1
- import type { Emoji, RawEmoji } from ".";
2
1
  import type { ButtonStyles, ChannelTypes, ComponentTypes, TextInputStyles } from "../constants";
2
+ import type { snowflake } from "./common";
3
+ import type { RawEmoji, Emoji } from "./emoji";
3
4
  /** https://discord.com/developers/docs/interactions/message-components#button-object-button-structure */
4
5
  export interface RawButton {
5
6
  type: ComponentTypes.Button;
@@ -32,7 +33,7 @@ export interface RawSelectOption {
32
33
  }
33
34
  /** https://discord.com/developers/docs/interactions/message-components#select-menu-object-select-default-value-structure */
34
35
  export interface RawDefaultValue {
35
- id: string;
36
+ id: snowflake;
36
37
  type: string;
37
38
  }
38
39
  /** https://discord.com/developers/docs/interactions/message-components#text-inputs-text-input-structure */
@@ -80,7 +81,7 @@ export interface SelectOption {
80
81
  default?: boolean;
81
82
  }
82
83
  export interface DefaultValue {
83
- id: string;
84
+ id: snowflake;
84
85
  type: string;
85
86
  }
86
87
  export interface TextInput {
@@ -1,7 +1,8 @@
1
1
  import type { RoleFlags } from "../constants";
2
+ import type { snowflake } from "./common";
2
3
  /** https://discord.com/developers/docs/topics/permissions#role-object-role-structure */
3
4
  export interface RawRole {
4
- id: string;
5
+ id: snowflake;
5
6
  name: string;
6
7
  color: number;
7
8
  hoist: boolean;
@@ -16,15 +17,15 @@ export interface RawRole {
16
17
  }
17
18
  /** https://discord.com/developers/docs/topics/permissions#role-object-role-tags-structure */
18
19
  export interface RawRoleTags {
19
- bot_id?: string;
20
- integration_id?: string;
20
+ bot_id?: snowflake;
21
+ integration_id?: snowflake;
21
22
  premium_subscriber?: null;
22
- subscription_listing_id?: string;
23
+ subscription_listing_id?: snowflake;
23
24
  available_for_purchase?: null;
24
25
  guild_connections?: null;
25
26
  }
26
27
  export interface Role {
27
- id: string;
28
+ id: snowflake;
28
29
  name: string;
29
30
  color: number;
30
31
  hoist: boolean;
@@ -38,10 +39,10 @@ export interface Role {
38
39
  flags: RoleFlags;
39
40
  }
40
41
  export interface RoleTags {
41
- botId?: string;
42
- integrationId?: string;
42
+ botId?: snowflake;
43
+ integrationId?: snowflake;
43
44
  premiumSubscriber?: null;
44
- subscriptionListingId?: string;
45
+ subscriptionListingId?: snowflake;
45
46
  availableForPurchase?: null;
46
47
  guildConnections?: null;
47
48
  }
@@ -1,10 +1,11 @@
1
1
  import type { SkuFlags, SkuTypes } from "../constants";
2
+ import type { snowflake } from "./common";
2
3
  /** https://discord.com/developers/docs/monetization/skus#sku-object-sku-structure */
3
4
  export interface RawSku {
4
- id: string;
5
+ id: snowflake;
5
6
  type: SkuTypes;
6
7
  dependent_sku_id?: string | null;
7
- application_id: string;
8
+ application_id: snowflake;
8
9
  manifest_labels?: null;
9
10
  access_type?: number;
10
11
  name: string;
@@ -15,10 +16,10 @@ export interface RawSku {
15
16
  show_age_gate?: boolean;
16
17
  }
17
18
  export interface Sku {
18
- id: string;
19
+ id: snowflake;
19
20
  type: SkuTypes;
20
21
  dependentSkuId?: string | null;
21
- applicationId: string;
22
+ applicationId: snowflake;
22
23
  manifestLabels?: null;
23
24
  accessType?: number;
24
25
  name: string;
@@ -1,29 +1,30 @@
1
1
  import type { PrivacyLevel } from "../constants";
2
+ import type { snowflake } from "./common";
2
3
  /** https://discord.com/developers/docs/resources/stage-instance#stage-instance-object-stage-instance-structure */
3
4
  export interface RawStageInstance {
4
- id: string;
5
- guild_id: string;
6
- channel_id: string;
5
+ id: snowflake;
6
+ guild_id: snowflake;
7
+ channel_id: snowflake;
7
8
  topic: string;
8
9
  privacy_level: PrivacyLevel;
9
10
  discoverable_disabled: boolean;
10
- guild_scheduled_event_id: string | null;
11
+ guild_scheduled_event_id: snowflake | null;
11
12
  }
12
13
  export interface StageInstance {
13
- id: string;
14
- guildId: string;
15
- channelId: string;
14
+ id: snowflake;
15
+ guildId: snowflake;
16
+ channelId: snowflake;
16
17
  topic: string;
17
18
  privacyLevel: PrivacyLevel;
18
19
  discoverableDisabled: boolean;
19
- guildScheduledEventId: string | null;
20
+ guildScheduledEventId: snowflake | null;
20
21
  }
21
22
  export interface CreateStageInstanceParams {
22
- channelId: string;
23
+ channelId: snowflake;
23
24
  topic: string;
24
25
  privacyLevel?: PrivacyLevel;
25
26
  sendStartNotifications?: boolean;
26
- guildScheduledEventId?: string;
27
+ guildScheduledEventId?: snowflake;
27
28
  }
28
29
  export interface EditStageInstanceParams {
29
30
  topic?: string;
@@ -1,10 +1,11 @@
1
1
  import type { StickerTypes, StickerFormatTypes } from "../constants";
2
- import type { User, RawUser } from ".";
3
2
  import type { File } from "../rest";
3
+ import type { snowflake } from "./common";
4
+ import type { RawUser, User } from "./user";
4
5
  /** https://discord.com/developers/docs/resources/sticker#sticker-object-sticker-structure */
5
6
  export interface RawSticker {
6
- id: string;
7
- pack_id?: string;
7
+ id: snowflake;
8
+ pack_id?: snowflake;
8
9
  name: string;
9
10
  description: string | null;
10
11
  tags: string;
@@ -12,29 +13,29 @@ export interface RawSticker {
12
13
  type: StickerTypes;
13
14
  format_type: StickerFormatTypes;
14
15
  available?: boolean;
15
- guild_id?: string;
16
+ guild_id?: snowflake;
16
17
  user?: RawUser;
17
18
  sort_value?: number;
18
19
  }
19
20
  /** https://discord.com/developers/docs/resources/sticker#sticker-item-object-sticker-item-structure */
20
21
  export interface RawStickerItem {
21
- id: string;
22
+ id: snowflake;
22
23
  name: string;
23
24
  format_type: StickerFormatTypes;
24
25
  }
25
26
  /** https://discord.com/developers/docs/resources/sticker#sticker-pack-object-sticker-pack-structure */
26
27
  export interface RawStickerPack {
27
- id: string;
28
+ id: snowflake;
28
29
  stickers: Array<RawSticker>;
29
30
  name: string;
30
- sku_id: string;
31
- cover_sticker_id?: string;
31
+ sku_id: snowflake;
32
+ cover_sticker_id?: snowflake;
32
33
  description: string;
33
- banner_asset_id?: string;
34
+ banner_asset_id?: snowflake;
34
35
  }
35
36
  export interface Sticker {
36
- id: string;
37
- packId?: string;
37
+ id: snowflake;
38
+ packId?: snowflake;
38
39
  name: string;
39
40
  description: string | null;
40
41
  tags: string;
@@ -42,23 +43,23 @@ export interface Sticker {
42
43
  type: StickerTypes;
43
44
  formatType: StickerFormatTypes;
44
45
  available?: boolean;
45
- guildId?: string;
46
+ guildId?: snowflake;
46
47
  user?: User;
47
48
  sortValue?: number;
48
49
  }
49
50
  export interface StickerItem {
50
- id: string;
51
+ id: snowflake;
51
52
  name: string;
52
53
  formatType: StickerFormatTypes;
53
54
  }
54
55
  export interface StickerPack {
55
- id: string;
56
+ id: snowflake;
56
57
  stickers: Array<Sticker>;
57
58
  name: string;
58
- skuId: string;
59
- coverStickerId?: string;
59
+ skuId: snowflake;
60
+ coverStickerId?: snowflake;
60
61
  description: string;
61
- bannerAssetId?: string;
62
+ bannerAssetId?: snowflake;
62
63
  }
63
64
  export interface CreateGuildStickerParams {
64
65
  name: string;
@@ -1,30 +1,31 @@
1
- import type { User, RawUser } from ".";
2
1
  import type { TeamMemberRoleTypes } from "../constants";
2
+ import type { snowflake } from "./common";
3
+ import type { RawUser, User } from "./user";
3
4
  /** https://discord.com/developers/docs/topics/teams#data-models-team-object */
4
5
  export interface RawTeam {
5
6
  icon: string | null;
6
- id: string;
7
+ id: snowflake;
7
8
  members: Array<RawTeamMember>;
8
9
  name: string;
9
- owner_user_id: string;
10
+ owner_user_id: snowflake;
10
11
  }
11
12
  /** https://discord.com/developers/docs/topics/teams#data-models-team-member-object */
12
13
  export interface RawTeamMember {
13
14
  membership_state: number;
14
- team_id: string;
15
+ team_id: snowflake;
15
16
  user: RawUser;
16
17
  role: TeamMemberRoleTypes;
17
18
  }
18
19
  export interface Team {
19
20
  icon: string | null;
20
- id: string;
21
+ id: snowflake;
21
22
  members: Array<TeamMember>;
22
23
  name: string;
23
- ownerUserId: string;
24
+ ownerUserId: snowflake;
24
25
  }
25
26
  export interface TeamMember {
26
27
  membershipState: number;
27
- teamId: string;
28
+ teamId: snowflake;
28
29
  user: User;
29
30
  role: TeamMemberRoleTypes;
30
31
  }
@@ -1,8 +1,10 @@
1
1
  import type { UserFlags, Services, VisibilityTypes, PremiumTypes, ApplicationRoleConnectionMetadataType } from "../constants";
2
- import type { ApplicationRoleConnectionMetadata, Integration, LocaleMap, RawApplicationRoleConnectionMetadata, RawIntegration } from ".";
2
+ import type { RawApplicationRoleConnectionMetadata, ApplicationRoleConnectionMetadata } from "./application-role-connection-metadata";
3
+ import type { snowflake, LocaleMap } from "./common";
4
+ import type { RawIntegration, Integration } from "./guild";
3
5
  /** https://discord.com/developers/docs/resources/user#user-object-user-structure */
4
6
  export interface RawUser {
5
- id: string;
7
+ id: snowflake;
6
8
  username: string;
7
9
  discriminator: string;
8
10
  global_name: string | null;
@@ -23,11 +25,11 @@ export interface RawUser {
23
25
  /** https://discord.com/developers/docs/resources/user#avatar-decoration-data-object-avatar-decoration-data-structure */
24
26
  export interface RawAvatarDecorationData {
25
27
  asset: string;
26
- sku_id: string;
28
+ sku_id: snowflake;
27
29
  }
28
30
  /** https://discord.com/developers/docs/resources/user#connection-object-connection-structure */
29
31
  export interface RawConnection {
30
- id: string;
32
+ id: snowflake;
31
33
  name: string;
32
34
  type: Services;
33
35
  revoked?: boolean;
@@ -45,7 +47,7 @@ export interface RawApplicationRoleConnection {
45
47
  metadata: RawApplicationRoleConnectionMetadata;
46
48
  }
47
49
  export interface User {
48
- id: string;
50
+ id: snowflake;
49
51
  username: string;
50
52
  discriminator: string;
51
53
  globalName: string | null;
@@ -65,10 +67,10 @@ export interface User {
65
67
  }
66
68
  export interface AvatarDecorationData {
67
69
  asset: string;
68
- skuId: string;
70
+ skuId: snowflake;
69
71
  }
70
72
  export interface Connection {
71
- id: string;
73
+ id: snowflake;
72
74
  name: string;
73
75
  type: Services;
74
76
  revoked?: boolean;
@@ -90,9 +92,9 @@ export interface EditCurrentUserParams {
90
92
  banner?: string | null;
91
93
  }
92
94
  export interface CreateDMParams {
93
- recipientId: string;
95
+ recipientId: snowflake;
94
96
  }
95
- export interface CreateGrupDMParams {
97
+ export interface CreateGroupDMParams {
96
98
  accessTokens: Array<string>;
97
99
  nicks: Array<string>;
98
100
  }
@@ -1,9 +1,10 @@
1
- import type { GuildMember, RawGuildMember } from ".";
1
+ import type { snowflake, timestamp } from "./common";
2
+ import type { RawGuildMember, GuildMember } from "./guild";
2
3
  /** https://discord.com/developers/docs/resources/voice#voice-state-object-voice-state-structure */
3
4
  export interface RawVoiceState {
4
- guild_id?: string;
5
- channel_id: string | null;
6
- user_id: string;
5
+ guild_id?: snowflake;
6
+ channel_id: snowflake | null;
7
+ user_id: snowflake;
7
8
  member?: RawGuildMember;
8
9
  session_id: string;
9
10
  deaf: boolean;
@@ -13,20 +14,20 @@ export interface RawVoiceState {
13
14
  self_stream?: boolean;
14
15
  self_video: boolean;
15
16
  suppress: boolean;
16
- request_to_speak_timestamp: string | null;
17
+ request_to_speak_timestamp: timestamp | null;
17
18
  }
18
19
  /** https://discord.com/developers/docs/resources/voice#voice-region-object-voice-region-structure */
19
20
  export interface RawVoiceRegion {
20
- id: string;
21
+ id: snowflake;
21
22
  name: string;
22
23
  optimal: boolean;
23
24
  deprecated: boolean;
24
25
  custom: boolean;
25
26
  }
26
27
  export interface VoiceState {
27
- guildId?: string;
28
- channelId: string | null;
29
- userId: string;
28
+ guildId?: snowflake;
29
+ channelId: snowflake | null;
30
+ userId: snowflake;
30
31
  member?: GuildMember;
31
32
  sessionId: string;
32
33
  deaf: boolean;
@@ -36,10 +37,10 @@ export interface VoiceState {
36
37
  selfStream?: boolean;
37
38
  selfVideo: boolean;
38
39
  suppress: boolean;
39
- requestToSpeakTimestamp: string | null;
40
+ requestToSpeakTimestamp: timestamp | null;
40
41
  }
41
42
  export interface VoiceRegion {
42
- id: string;
43
+ id: snowflake;
43
44
  name: string;
44
45
  optimal: boolean;
45
46
  deprecated: boolean;
@@ -1,31 +1,36 @@
1
1
  import type { MessageFlags, WebhookTypes } from "../constants";
2
- import type { ActionRow, AllowedMentions, Attachment, Channel, Embed, Guild, User, RawChannel, RawGuild, RawUser, PollCreateParams } from ".";
3
2
  import type { File } from "../rest";
3
+ import type { RawChannel, Channel, Embed, AllowedMentions, Attachment } from "./channel";
4
+ import type { snowflake } from "./common";
5
+ import type { RawGuild, Guild } from "./guild";
6
+ import type { ActionRow } from "./message-components";
7
+ import type { PollCreateParams } from "./poll";
8
+ import type { RawUser, User } from "./user";
4
9
  /** https://discord.com/developers/docs/resources/webhook#webhook-object-webhook-structure */
5
10
  export interface RawWebhook {
6
- id: string;
11
+ id: snowflake;
7
12
  type: WebhookTypes;
8
- guild_id?: string | null;
9
- channel_id: string | null;
13
+ guild_id?: snowflake | null;
14
+ channel_id: snowflake | null;
10
15
  user?: RawUser;
11
16
  name: string | null;
12
17
  avatar: string | null;
13
18
  token?: string;
14
- application_id: string | null;
19
+ application_id: snowflake | null;
15
20
  source_guild?: RawGuild;
16
21
  source_channel?: RawChannel;
17
22
  url?: string;
18
23
  }
19
24
  export interface Webhook {
20
- id: string;
25
+ id: snowflake;
21
26
  type: WebhookTypes;
22
- guildId?: string | null;
23
- channelId: string | null;
27
+ guildId?: snowflake | null;
28
+ channelId: snowflake | null;
24
29
  user?: User;
25
30
  name: string | null;
26
31
  avatar: string | null;
27
32
  token?: string;
28
- applicationId: string | null;
33
+ applicationId: snowflake | null;
29
34
  sourceGuild?: Guild;
30
35
  sourceChannel?: Channel;
31
36
  url?: string;
@@ -37,7 +42,7 @@ export interface CreateWebhookParams {
37
42
  export interface EditWebhookParams {
38
43
  name?: string;
39
44
  avatar?: string | null;
40
- channelId?: string;
45
+ channelId?: snowflake;
41
46
  }
42
47
  export interface ExecuteWebhookParams {
43
48
  content?: string | null;
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "disgroove",
3
- "version": "2.1.3-dev.837d772",
3
+ "version": "2.2.0-dev.15819eb",
4
4
  "description": "A module to interface with Discord",
5
5
  "main": "./dist/lib/index.js",
6
6
  "types": "./dist/lib/index.d.ts",
@@ -22,11 +22,11 @@
22
22
  },
23
23
  "homepage": "https://github.com/XenKys/disgroove#readme",
24
24
  "devDependencies": {
25
- "@types/node": "^20.13.0",
25
+ "@types/node": "^20.14.6",
26
26
  "@types/ws": "^8.5.10",
27
27
  "typescript": "^5.4.5"
28
28
  },
29
29
  "dependencies": {
30
- "ws": "^8.17.0"
30
+ "ws": "^8.17.1"
31
31
  }
32
32
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "disgroove",
3
- "version": "2.1.3",
3
+ "version": "2.2.0-dev.15819eb",
4
4
  "description": "A module to interface with Discord",
5
5
  "main": "./dist/lib/index.js",
6
6
  "types": "./dist/lib/index.d.ts",
@@ -1,26 +0,0 @@
1
- import type { Locales } from "../constants";
2
- export * from "./application-command";
3
- export * from "./application-role-connection-metadata";
4
- export * from "./application";
5
- export * from "./audit-log";
6
- export * from "./auto-moderation";
7
- export * from "./channel";
8
- export * from "./emoji";
9
- export * from "./entitlements";
10
- export * from "./gateway-events";
11
- export * from "./guild-scheduled-event";
12
- export * from "./guild-template";
13
- export * from "./guild";
14
- export * from "./interaction";
15
- export * from "./invite";
16
- export * from "./message-components";
17
- export * from "./poll";
18
- export * from "./role";
19
- export * from "./sku";
20
- export * from "./stage-instance";
21
- export * from "./sticker";
22
- export * from "./team";
23
- export * from "./user";
24
- export * from "./voice";
25
- export * from "./webhook";
26
- export type LocaleMap = Partial<Record<Locales, string>>;
@@ -1,40 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./application-command"), exports);
18
- __exportStar(require("./application-role-connection-metadata"), exports);
19
- __exportStar(require("./application"), exports);
20
- __exportStar(require("./audit-log"), exports);
21
- __exportStar(require("./auto-moderation"), exports);
22
- __exportStar(require("./channel"), exports);
23
- __exportStar(require("./emoji"), exports);
24
- __exportStar(require("./entitlements"), exports);
25
- __exportStar(require("./gateway-events"), exports);
26
- __exportStar(require("./guild-scheduled-event"), exports);
27
- __exportStar(require("./guild-template"), exports);
28
- __exportStar(require("./guild"), exports);
29
- __exportStar(require("./interaction"), exports);
30
- __exportStar(require("./invite"), exports);
31
- __exportStar(require("./message-components"), exports);
32
- __exportStar(require("./poll"), exports);
33
- __exportStar(require("./role"), exports);
34
- __exportStar(require("./sku"), exports);
35
- __exportStar(require("./stage-instance"), exports);
36
- __exportStar(require("./sticker"), exports);
37
- __exportStar(require("./team"), exports);
38
- __exportStar(require("./user"), exports);
39
- __exportStar(require("./voice"), exports);
40
- __exportStar(require("./webhook"), exports);