disgroove 2.0.0-dev.40377cb → 2.0.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.
Files changed (61) hide show
  1. package/README.md +9 -9
  2. package/dist/lib/Client.d.ts +560 -142
  3. package/dist/lib/Client.js +1794 -124
  4. package/dist/lib/Client.js.map +1 -1
  5. package/dist/lib/constants.d.ts +7 -7
  6. package/dist/lib/constants.js +218 -218
  7. package/dist/lib/gateway/Shard.d.ts +0 -1
  8. package/dist/lib/gateway/Shard.js +65 -261
  9. package/dist/lib/gateway/Shard.js.map +1 -1
  10. package/dist/lib/gateway/ShardManager.d.ts +1 -2
  11. package/dist/lib/gateway/ShardManager.js +1 -2
  12. package/dist/lib/gateway/ShardManager.js.map +1 -1
  13. package/dist/lib/index.d.ts +0 -1
  14. package/dist/lib/index.js +0 -1
  15. package/dist/lib/index.js.map +1 -1
  16. package/dist/lib/rest/Endpoints.d.ts +3 -3
  17. package/dist/lib/rest/Endpoints.js +8 -8
  18. package/dist/lib/rest/Endpoints.js.map +1 -1
  19. package/dist/lib/rest/RequestManager.d.ts +8 -2
  20. package/dist/lib/rest/RequestManager.js +17 -10
  21. package/dist/lib/rest/RequestManager.js.map +1 -1
  22. package/dist/lib/rest/index.d.ts +0 -1
  23. package/dist/lib/rest/index.js +0 -1
  24. package/dist/lib/rest/index.js.map +1 -1
  25. package/dist/lib/structures/Webhook.js +14 -3
  26. package/dist/lib/structures/Webhook.js.map +1 -1
  27. package/dist/lib/types/application-command.d.ts +94 -20
  28. package/dist/lib/types/application-role-connection-metadata.d.ts +7 -6
  29. package/dist/lib/types/application.d.ts +24 -13
  30. package/dist/lib/types/audit-log.d.ts +15 -16
  31. package/dist/lib/types/auto-moderation.d.ts +27 -7
  32. package/dist/lib/types/channel.d.ts +170 -68
  33. package/dist/lib/types/emoji.d.ts +12 -3
  34. package/dist/lib/types/entitlements.d.ts +6 -1
  35. package/dist/lib/types/gateway-events.d.ts +11 -336
  36. package/dist/lib/types/guild-scheduled-event.d.ts +31 -8
  37. package/dist/lib/types/guild-template.d.ts +16 -4
  38. package/dist/lib/types/guild.d.ts +190 -37
  39. package/dist/lib/types/index.d.ts +2 -0
  40. package/dist/lib/types/index.js.map +1 -1
  41. package/dist/lib/types/interaction.d.ts +37 -36
  42. package/dist/lib/types/invite.d.ts +12 -12
  43. package/dist/lib/types/message-components.d.ts +12 -12
  44. package/dist/lib/types/role.d.ts +3 -3
  45. package/dist/lib/types/sku.d.ts +8 -8
  46. package/dist/lib/types/stage-instance.d.ts +12 -1
  47. package/dist/lib/types/sticker.d.ts +18 -6
  48. package/dist/lib/types/team.d.ts +5 -5
  49. package/dist/lib/types/user.d.ts +30 -7
  50. package/dist/lib/types/voice.d.ts +4 -4
  51. package/dist/lib/types/webhook.d.ts +38 -6
  52. package/dist/lib/utils/Util.d.ts +2 -13
  53. package/dist/lib/utils/Util.js +39 -535
  54. package/dist/lib/utils/Util.js.map +1 -1
  55. package/dist/lib/utils/errors.d.ts +1 -1
  56. package/dist/lib/utils/errors.js +4 -4
  57. package/dist/lib/utils/index.d.ts +0 -1
  58. package/dist/lib/utils/index.js +0 -1
  59. package/dist/lib/utils/index.js.map +1 -1
  60. package/dist/package.json +7 -7
  61. package/package.json +7 -7
@@ -1,5 +1,6 @@
1
1
  import type { StickerTypes, StickerFormatTypes } from "../constants";
2
- import type { JSONUser, RawUser } from ".";
2
+ import type { User, RawUser } from ".";
3
+ import type { File } from "../rest";
3
4
  /** https://discord.com/developers/docs/resources/sticker#sticker-object-sticker-structure */
4
5
  export interface RawSticker {
5
6
  id: string;
@@ -31,7 +32,7 @@ export interface RawStickerPack {
31
32
  description: string;
32
33
  banner_asset_id?: string;
33
34
  }
34
- export interface JSONSticker {
35
+ export interface Sticker {
35
36
  id: string;
36
37
  packId?: string;
37
38
  name: string;
@@ -42,20 +43,31 @@ export interface JSONSticker {
42
43
  formatType: StickerFormatTypes;
43
44
  available?: boolean;
44
45
  guildId?: string;
45
- user?: JSONUser;
46
+ user?: User;
46
47
  sortValue?: number;
47
48
  }
48
- export interface JSONStickerItem {
49
+ export interface StickerItem {
49
50
  id: string;
50
51
  name: string;
51
52
  formatType: StickerFormatTypes;
52
53
  }
53
- export interface JSONStickerPack {
54
+ export interface StickerPack {
54
55
  id: string;
55
- stickers: Array<JSONSticker>;
56
+ stickers: Array<Sticker>;
56
57
  name: string;
57
58
  skuId: string;
58
59
  coverStickerId?: string;
59
60
  description: string;
60
61
  bannerAssetId?: string;
61
62
  }
63
+ export interface CreateGuildStickerParams {
64
+ name: string;
65
+ description: string;
66
+ tags: string;
67
+ file: File;
68
+ }
69
+ export interface EditGuildStickerParams {
70
+ name?: string;
71
+ description?: string | null;
72
+ tags?: string;
73
+ }
@@ -1,4 +1,4 @@
1
- import type { JSONUser, RawUser } from ".";
1
+ import type { User, RawUser } from ".";
2
2
  import type { TeamMemberRoleTypes } from "../constants";
3
3
  /** https://discord.com/developers/docs/topics/teams#data-models-team-object */
4
4
  export interface RawTeam {
@@ -15,16 +15,16 @@ export interface RawTeamMember {
15
15
  user: RawUser;
16
16
  role: TeamMemberRoleTypes;
17
17
  }
18
- export interface JSONTeam {
18
+ export interface Team {
19
19
  icon: string | null;
20
20
  id: string;
21
- members: Array<JSONTeamMember>;
21
+ members: Array<TeamMember>;
22
22
  name: string;
23
23
  ownerUserId: string;
24
24
  }
25
- export interface JSONTeamMember {
25
+ export interface TeamMember {
26
26
  membershipState: number;
27
27
  teamId: string;
28
- user: JSONUser;
28
+ user: User;
29
29
  role: TeamMemberRoleTypes;
30
30
  }
@@ -1,5 +1,5 @@
1
- import type { UserFlags, Services, VisibilityTypes, PremiumTypes } from "../constants";
2
- import type { JSONApplicationRoleConnectionMetadata, JSONIntegration, RawApplicationRoleConnectionMetadata, RawIntegration } from ".";
1
+ import type { UserFlags, Services, VisibilityTypes, PremiumTypes, ApplicationRoleConnectionMetadataType } from "../constants";
2
+ import type { ApplicationRoleConnectionMetadata, Integration, LocaleMap, RawApplicationRoleConnectionMetadata, RawIntegration } from ".";
3
3
  /** https://discord.com/developers/docs/resources/user#user-object-user-structure */
4
4
  export interface RawUser {
5
5
  id: string;
@@ -39,7 +39,7 @@ export interface RawApplicationRoleConnection {
39
39
  platform_username: string | null;
40
40
  metadata: RawApplicationRoleConnectionMetadata;
41
41
  }
42
- export interface JSONUser {
42
+ export interface User {
43
43
  id: string;
44
44
  username: string;
45
45
  discriminator: string;
@@ -58,20 +58,43 @@ export interface JSONUser {
58
58
  publicFlags?: UserFlags;
59
59
  avatarDecoration?: string | null;
60
60
  }
61
- export interface JSONConnection {
61
+ export interface Connection {
62
62
  id: string;
63
63
  name: string;
64
64
  type: Services;
65
65
  revoked?: boolean;
66
- integrations?: Array<JSONIntegration>;
66
+ integrations?: Array<Integration>;
67
67
  verified: boolean;
68
68
  friendSync: boolean;
69
69
  showActivity: boolean;
70
70
  twoWayLink: boolean;
71
71
  visibility: VisibilityTypes;
72
72
  }
73
- export interface JSONApplicationRoleConnection {
73
+ export interface ApplicationRoleConnection {
74
74
  platformName: string | null;
75
75
  platformUsername: string | null;
76
- metadata: JSONApplicationRoleConnectionMetadata;
76
+ metadata: ApplicationRoleConnectionMetadata;
77
+ }
78
+ export interface EditCurrentUserParams {
79
+ username?: string;
80
+ avatar?: string | null;
81
+ }
82
+ export interface CreateDMParams {
83
+ recipientId: string;
84
+ }
85
+ export interface CreateGrupDMParams {
86
+ accessTokens: Array<string>;
87
+ nicks: Array<string>;
88
+ }
89
+ export interface UpdateCurrentUserApplicationRoleConnection {
90
+ platformName?: string;
91
+ platformUsername?: string;
92
+ metadata?: {
93
+ type: ApplicationRoleConnectionMetadataType;
94
+ key: string;
95
+ name: string;
96
+ nameLocalizations?: LocaleMap | null;
97
+ description: string;
98
+ descriptionLocalizations?: LocaleMap | null;
99
+ };
77
100
  }
@@ -1,4 +1,4 @@
1
- import type { JSONGuildMember, RawGuildMember } from ".";
1
+ import type { GuildMember, RawGuildMember } from ".";
2
2
  /** https://discord.com/developers/docs/resources/voice#voice-state-object-voice-state-structure */
3
3
  export interface RawVoiceState {
4
4
  guild_id?: string;
@@ -23,11 +23,11 @@ export interface RawVoiceRegion {
23
23
  deprecated: boolean;
24
24
  custom: boolean;
25
25
  }
26
- export interface JSONVoiceState {
26
+ export interface VoiceState {
27
27
  guildId?: string;
28
28
  channelId: string | null;
29
29
  userId: string;
30
- member?: JSONGuildMember;
30
+ member?: GuildMember;
31
31
  sessionId: string;
32
32
  deaf: boolean;
33
33
  mute: boolean;
@@ -38,7 +38,7 @@ export interface JSONVoiceState {
38
38
  suppress: boolean;
39
39
  requestToSpeakTimestamp: string | null;
40
40
  }
41
- export interface JSONVoiceRegion {
41
+ export interface VoiceRegion {
42
42
  id: string;
43
43
  name: string;
44
44
  optimal: boolean;
@@ -1,5 +1,6 @@
1
- import type { WebhookTypes } from "../constants";
2
- import type { JSONChannel, JSONGuild, JSONUser, RawChannel, RawGuild, RawUser } from ".";
1
+ import type { MessageFlags, WebhookTypes } from "../constants";
2
+ import type { ActionRow, AllowedMentions, Attachment, Channel, Embed, Guild, User, RawChannel, RawGuild, RawUser } from ".";
3
+ import type { File } from "../rest";
3
4
  /** https://discord.com/developers/docs/resources/webhook#webhook-object-webhook-structure */
4
5
  export interface RawWebhook {
5
6
  id: string;
@@ -15,17 +16,48 @@ export interface RawWebhook {
15
16
  source_channel?: RawChannel;
16
17
  url?: string;
17
18
  }
18
- export interface JSONWebhook {
19
+ export interface Webhook {
19
20
  id: string;
20
21
  type: WebhookTypes;
21
22
  guildId?: string | null;
22
23
  channelId: string | null;
23
- user?: JSONUser;
24
+ user?: User;
24
25
  name: string | null;
25
26
  avatar: string | null;
26
27
  token?: string;
27
28
  applicationId: string | null;
28
- sourceGuild?: JSONGuild;
29
- sourceChannel?: JSONChannel;
29
+ sourceGuild?: Guild;
30
+ sourceChannel?: Channel;
30
31
  url?: string;
31
32
  }
33
+ export interface CreateWebhookParams {
34
+ name: string;
35
+ avatar?: string | null;
36
+ }
37
+ export interface EditWebhookParams {
38
+ name?: string;
39
+ avatar?: string | null;
40
+ channelId?: string;
41
+ }
42
+ export interface ExecuteWebhookParams {
43
+ content?: string | null;
44
+ username?: string;
45
+ avatarUrl?: string;
46
+ tts?: boolean;
47
+ embeds?: Array<Embed> | null;
48
+ allowedMentions?: AllowedMentions | null;
49
+ components?: Array<ActionRow> | null;
50
+ files?: Array<File> | null;
51
+ attachments?: Array<Attachment> | null;
52
+ flags?: MessageFlags | null;
53
+ threadName?: string;
54
+ }
55
+ export interface EditWebhookMessageParams {
56
+ content?: string | null;
57
+ embeds?: Array<Embed> | null;
58
+ flags?: MessageFlags | null;
59
+ allowedMentions?: AllowedMentions | null;
60
+ components?: Array<ActionRow> | null;
61
+ files?: Array<File> | null;
62
+ attachments?: Array<Attachment> | null;
63
+ }
@@ -1,15 +1,4 @@
1
- import type { JSONActionRow, JSONApplicationCommand, JSONAttachment, JSONChannel, JSONEmbed, JSONEmoji, JSONRole, JSONUser, PresenceUpdateEventFields, RawActionRow, RawApplicationCommand, RawAttachment, RawChannel, RawEmbed, RawEmoji, RawPresenceUpdateEventFields, RawRole, RawUser } from "../types";
2
- import type { Client } from "../Client";
3
1
  export declare class Util {
4
- applicationCommandToRaw(command: Partial<JSONApplicationCommand>): Partial<RawApplicationCommand>;
5
- attachmentToJSON(attachment: RawAttachment): JSONAttachment;
6
- channelToRaw(channel: JSONChannel): RawChannel;
7
- embedsToJSON(embeds: Array<RawEmbed>): Array<JSONEmbed>;
8
- embedsToRaw(embeds: Array<JSONEmbed>): Array<RawEmbed>;
9
- emojiToRaw(emoji: JSONEmoji): RawEmoji;
10
- messageComponentsToJSON(components: Array<RawActionRow>): Array<JSONActionRow>;
11
- messageComponentsToRaw(components: Array<JSONActionRow>): Array<RawActionRow>;
12
- presenceToREST(presence: RawPresenceUpdateEventFields, client: Client): PresenceUpdateEventFields;
13
- roleToRaw(role: JSONRole | Partial<JSONRole>): RawRole | Partial<RawRole>;
14
- userToRaw(user: JSONUser): RawUser;
2
+ toCamelCase<T>(obj: Record<string, any>): T;
3
+ toSnakeCase<T>(obj: Record<string, any>): T;
15
4
  }