disgroove 1.3.4 → 2.0.0-dev.0f17bf6
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 +9 -9
- package/dist/lib/Client.d.ts +562 -144
- package/dist/lib/Client.js +1795 -125
- package/dist/lib/Client.js.map +1 -1
- package/dist/lib/constants.d.ts +7 -7
- package/dist/lib/constants.js +218 -218
- package/dist/lib/gateway/Shard.d.ts +0 -1
- package/dist/lib/gateway/Shard.js +65 -261
- package/dist/lib/gateway/Shard.js.map +1 -1
- package/dist/lib/gateway/ShardManager.d.ts +5 -0
- package/dist/lib/gateway/ShardManager.js +13 -0
- package/dist/lib/gateway/ShardManager.js.map +1 -0
- package/dist/lib/gateway/index.d.ts +1 -1
- package/dist/lib/gateway/index.js +1 -1
- package/dist/lib/gateway/index.js.map +1 -1
- package/dist/lib/index.d.ts +0 -1
- package/dist/lib/index.js +0 -1
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/rest/CDN.d.ts +21 -21
- package/dist/lib/rest/CDN.js +21 -21
- package/dist/lib/rest/CDN.js.map +1 -1
- package/dist/lib/rest/Endpoints.d.ts +3 -3
- package/dist/lib/rest/Endpoints.js +8 -8
- package/dist/lib/rest/Endpoints.js.map +1 -1
- package/dist/lib/rest/REST.d.ts +2 -2
- package/dist/lib/rest/REST.js +1 -1
- package/dist/lib/rest/REST.js.map +1 -1
- package/dist/lib/rest/RequestManager.d.ts +28 -0
- package/dist/lib/rest/RequestManager.js +130 -0
- package/dist/lib/rest/RequestManager.js.map +1 -0
- package/dist/lib/rest/index.d.ts +1 -2
- package/dist/lib/rest/index.js +1 -2
- package/dist/lib/rest/index.js.map +1 -1
- package/dist/lib/types/application-command.d.ts +94 -20
- package/dist/lib/types/application-role-connection-metadata.d.ts +7 -6
- package/dist/lib/types/application.d.ts +24 -13
- package/dist/lib/types/audit-log.d.ts +15 -16
- package/dist/lib/types/auto-moderation.d.ts +27 -7
- package/dist/lib/types/channel.d.ts +170 -68
- package/dist/lib/types/emoji.d.ts +12 -3
- package/dist/lib/types/entitlements.d.ts +6 -1
- package/dist/lib/types/gateway-events.d.ts +11 -336
- package/dist/lib/types/guild-scheduled-event.d.ts +31 -8
- package/dist/lib/types/guild-template.d.ts +16 -4
- package/dist/lib/types/guild.d.ts +190 -37
- package/dist/lib/types/index.d.ts +2 -0
- package/dist/lib/types/index.js.map +1 -1
- package/dist/lib/types/interaction.d.ts +37 -36
- package/dist/lib/types/invite.d.ts +12 -12
- package/dist/lib/types/message-components.d.ts +12 -12
- package/dist/lib/types/role.d.ts +3 -3
- package/dist/lib/types/sku.d.ts +8 -8
- package/dist/lib/types/stage-instance.d.ts +12 -1
- package/dist/lib/types/sticker.d.ts +18 -6
- package/dist/lib/types/team.d.ts +5 -5
- package/dist/lib/types/user.d.ts +30 -7
- package/dist/lib/types/voice.d.ts +4 -4
- package/dist/lib/types/webhook.d.ts +38 -6
- package/dist/lib/utils/Util.d.ts +2 -13
- package/dist/lib/utils/Util.js +39 -535
- package/dist/lib/utils/Util.js.map +1 -1
- package/dist/lib/utils/errors.d.ts +1 -1
- package/dist/lib/utils/errors.js +4 -4
- package/dist/lib/utils/index.d.ts +0 -1
- package/dist/lib/utils/index.js +0 -1
- package/dist/lib/utils/index.js.map +1 -1
- package/dist/package.json +1 -1
- package/package.json +1 -1
@@ -1,4 +1,5 @@
|
|
1
|
-
import type {
|
1
|
+
import type { LocaleMap } from ".";
|
2
|
+
import type { ApplicationCommandTypes, ApplicationCommandOptionType, ChannelTypes, ApplicationCommandPermissionType } from "../constants";
|
2
3
|
/** https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-structure */
|
3
4
|
export interface RawApplicationCommand {
|
4
5
|
id: string;
|
@@ -6,9 +7,9 @@ export interface RawApplicationCommand {
|
|
6
7
|
application_id: string;
|
7
8
|
guild_id?: string;
|
8
9
|
name: string;
|
9
|
-
name_localizations?:
|
10
|
+
name_localizations?: LocaleMap | null;
|
10
11
|
description: string;
|
11
|
-
description_localizations?:
|
12
|
+
description_localizations?: LocaleMap | null;
|
12
13
|
options?: Array<RawApplicationCommandOption>;
|
13
14
|
default_member_permissions: string | null;
|
14
15
|
dm_permission?: boolean;
|
@@ -20,9 +21,9 @@ export interface RawApplicationCommand {
|
|
20
21
|
export interface RawApplicationCommandOption {
|
21
22
|
type: ApplicationCommandOptionType;
|
22
23
|
name: string;
|
23
|
-
name_localizations?:
|
24
|
+
name_localizations?: LocaleMap | null;
|
24
25
|
description: string;
|
25
|
-
description_localizations?:
|
26
|
+
description_localizations?: LocaleMap | null;
|
26
27
|
required?: boolean;
|
27
28
|
choices?: Array<RawApplicationCommandOptionChoice>;
|
28
29
|
options?: Array<RawApplicationCommandOption>;
|
@@ -36,7 +37,7 @@ export interface RawApplicationCommandOption {
|
|
36
37
|
/** https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-choice-structure */
|
37
38
|
export interface RawApplicationCommandOptionChoice {
|
38
39
|
name: string;
|
39
|
-
name_localizations?:
|
40
|
+
name_localizations?: LocaleMap | null;
|
40
41
|
value: string;
|
41
42
|
}
|
42
43
|
/** https://discord.com/developers/docs/interactions/application-commands#application-command-permissions-object-guild-application-command-permissions-structure */
|
@@ -52,31 +53,31 @@ export interface RawApplicationCommandPermission {
|
|
52
53
|
type: ApplicationCommandPermissionType;
|
53
54
|
permission: boolean;
|
54
55
|
}
|
55
|
-
export interface
|
56
|
+
export interface ApplicationCommand {
|
56
57
|
id: string;
|
57
58
|
type?: ApplicationCommandTypes;
|
58
59
|
applicationId: string;
|
59
60
|
guildId?: string;
|
60
61
|
name: string;
|
61
|
-
nameLocalizations?:
|
62
|
+
nameLocalizations?: LocaleMap | null;
|
62
63
|
description: string;
|
63
|
-
descriptionLocalizations?:
|
64
|
-
options?: Array<
|
64
|
+
descriptionLocalizations?: LocaleMap | null;
|
65
|
+
options?: Array<ApplicationCommandOption>;
|
65
66
|
defaultMemberPermissions: string | null;
|
66
67
|
dmPermission?: boolean;
|
67
68
|
defaultPermission?: boolean | null;
|
68
69
|
nsfw?: boolean;
|
69
70
|
version: string;
|
70
71
|
}
|
71
|
-
export interface
|
72
|
+
export interface ApplicationCommandOption {
|
72
73
|
type: ApplicationCommandOptionType;
|
73
74
|
name: string;
|
74
|
-
nameLocalizations?:
|
75
|
+
nameLocalizations?: LocaleMap | null;
|
75
76
|
description: string;
|
76
|
-
descriptionLocalizations?:
|
77
|
+
descriptionLocalizations?: LocaleMap | null;
|
77
78
|
required?: boolean;
|
78
|
-
choices?: Array<
|
79
|
-
options?: Array<
|
79
|
+
choices?: Array<ApplicationCommandOptionChoice>;
|
80
|
+
options?: Array<ApplicationCommandOption>;
|
80
81
|
channelTypes?: Array<ChannelTypes>;
|
81
82
|
minValue?: number;
|
82
83
|
maxValue?: number;
|
@@ -84,19 +85,92 @@ export interface JSONApplicationCommandOption {
|
|
84
85
|
maxLength?: number;
|
85
86
|
autocomplete?: boolean;
|
86
87
|
}
|
87
|
-
export interface
|
88
|
+
export interface ApplicationCommandOptionChoice {
|
88
89
|
name: string;
|
89
|
-
nameLocalizations?:
|
90
|
+
nameLocalizations?: LocaleMap | null;
|
90
91
|
value: string;
|
91
92
|
}
|
92
|
-
export interface
|
93
|
+
export interface GuildApplicationCommandPermissions {
|
93
94
|
id: string;
|
94
95
|
applicationId: string;
|
95
96
|
guildId: string;
|
96
|
-
permissions: Array<
|
97
|
+
permissions: Array<ApplicationCommandPermission>;
|
97
98
|
}
|
98
|
-
export interface
|
99
|
+
export interface ApplicationCommandPermission {
|
99
100
|
id: string;
|
100
101
|
type: ApplicationCommandPermissionType;
|
101
102
|
permission: boolean;
|
102
103
|
}
|
104
|
+
export interface CreateGlobalApplicationCommandParams {
|
105
|
+
name: string;
|
106
|
+
nameLocalizations?: LocaleMap | null;
|
107
|
+
description?: string;
|
108
|
+
descriptionLocalizations?: LocaleMap | null;
|
109
|
+
options?: Array<ApplicationCommandOption>;
|
110
|
+
defaultMemberPermissions?: string | null;
|
111
|
+
dmPermission?: boolean;
|
112
|
+
defaultPermission?: boolean | null;
|
113
|
+
type?: ApplicationCommandTypes;
|
114
|
+
nsfw?: boolean;
|
115
|
+
}
|
116
|
+
export interface EditGlobalApplicationCommandParams {
|
117
|
+
name?: string;
|
118
|
+
nameLocalizations?: LocaleMap | null;
|
119
|
+
description?: string;
|
120
|
+
descriptionLocalizations?: LocaleMap | null;
|
121
|
+
options?: Array<ApplicationCommandOption>;
|
122
|
+
defaultMemberPermissions?: string | null;
|
123
|
+
defaultPermission?: boolean | null;
|
124
|
+
dmPermission?: boolean;
|
125
|
+
nsfw?: boolean;
|
126
|
+
}
|
127
|
+
export type BulkEditGlobalApplicationCommandsParams = Array<{
|
128
|
+
id?: string;
|
129
|
+
name: string;
|
130
|
+
nameLocalizations?: LocaleMap | null;
|
131
|
+
description?: string;
|
132
|
+
descriptionLocalizations?: LocaleMap | null;
|
133
|
+
options?: Array<ApplicationCommandOption>;
|
134
|
+
defaultMemberPermissions?: string | null;
|
135
|
+
dmPermission?: boolean;
|
136
|
+
defaultPermission?: boolean | null;
|
137
|
+
type?: ApplicationCommandTypes;
|
138
|
+
nsfw?: boolean;
|
139
|
+
}>;
|
140
|
+
export interface CreateGuildApplicationCommandParams {
|
141
|
+
name: string;
|
142
|
+
nameLocalizations?: LocaleMap | null;
|
143
|
+
description?: string;
|
144
|
+
descriptionLocalizations?: LocaleMap | null;
|
145
|
+
options?: Array<ApplicationCommandOption>;
|
146
|
+
defaultMemberPermissions?: string | null;
|
147
|
+
defaultPermission?: boolean | null;
|
148
|
+
type?: ApplicationCommandTypes;
|
149
|
+
nsfw?: boolean;
|
150
|
+
}
|
151
|
+
export interface EditGuildApplicationCommandParams {
|
152
|
+
name?: string;
|
153
|
+
nameLocalizations?: LocaleMap | null;
|
154
|
+
description?: string;
|
155
|
+
descriptionLocalizations?: LocaleMap | null;
|
156
|
+
options?: Array<ApplicationCommandOption>;
|
157
|
+
defaultMemberPermissions?: string | null;
|
158
|
+
defaultPermission?: boolean | null;
|
159
|
+
nsfw?: boolean;
|
160
|
+
}
|
161
|
+
export type BulkEditGuildApplicationCommandsParams = Array<{
|
162
|
+
id?: string;
|
163
|
+
name: string;
|
164
|
+
nameLocalizations?: LocaleMap | null;
|
165
|
+
description?: string;
|
166
|
+
descriptionLocalizations?: LocaleMap | null;
|
167
|
+
options?: Array<ApplicationCommandOption>;
|
168
|
+
defaultMemberPermissions?: string | null;
|
169
|
+
dmPermission?: boolean;
|
170
|
+
defaultPermission?: boolean | null;
|
171
|
+
type: ApplicationCommandTypes;
|
172
|
+
nsfw?: boolean;
|
173
|
+
}>;
|
174
|
+
export interface EditApplicationCommandPermissionsParams {
|
175
|
+
permissions: Array<GuildApplicationCommandPermissions>;
|
176
|
+
}
|
@@ -1,18 +1,19 @@
|
|
1
|
-
import type {
|
1
|
+
import type { LocaleMap } from ".";
|
2
|
+
import type { ApplicationRoleConnectionMetadataType } from "../constants";
|
2
3
|
/** https://discord.com/developers/docs/resources/application-role-connection-metadata#application-role-connection-metadata-object-application-role-connection-metadata-structure */
|
3
4
|
export interface RawApplicationRoleConnectionMetadata {
|
4
5
|
type: ApplicationRoleConnectionMetadataType;
|
5
6
|
key: string;
|
6
7
|
name: string;
|
7
|
-
name_localizations?:
|
8
|
+
name_localizations?: LocaleMap | null;
|
8
9
|
description: string;
|
9
|
-
description_localizations?:
|
10
|
+
description_localizations?: LocaleMap | null;
|
10
11
|
}
|
11
|
-
export interface
|
12
|
+
export interface ApplicationRoleConnectionMetadata {
|
12
13
|
type: ApplicationRoleConnectionMetadataType;
|
13
14
|
key: string;
|
14
15
|
name: string;
|
15
|
-
nameLocalizations?:
|
16
|
+
nameLocalizations?: LocaleMap | null;
|
16
17
|
description: string;
|
17
|
-
descriptionLocalizations?:
|
18
|
+
descriptionLocalizations?: LocaleMap | null;
|
18
19
|
}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import type { RawUser, RawTeam,
|
1
|
+
import type { RawUser, RawTeam, Team, User, RawGuild, Guild } from ".";
|
2
2
|
import type { ApplicationFlags, OAuth2Scopes } from "../constants";
|
3
3
|
/** https://discord.com/developers/docs/resources/application#application-object-application-structure */
|
4
4
|
export interface RawApplication {
|
@@ -33,7 +33,7 @@ export interface RawInstallParams {
|
|
33
33
|
scopes: Array<OAuth2Scopes>;
|
34
34
|
permissions: string;
|
35
35
|
}
|
36
|
-
export interface
|
36
|
+
export interface Application {
|
37
37
|
id: string;
|
38
38
|
name: string;
|
39
39
|
icon: string | null;
|
@@ -41,26 +41,37 @@ export interface JSONApplication {
|
|
41
41
|
rpcOrigins?: Array<string>;
|
42
42
|
botPublic: boolean;
|
43
43
|
botRequireCodeGrant: boolean;
|
44
|
-
|
45
|
-
|
46
|
-
owner?:
|
44
|
+
termsOfServiceUrl?: string;
|
45
|
+
privacyPolicyUrl?: string;
|
46
|
+
owner?: User;
|
47
47
|
verifyKey: string;
|
48
|
-
team:
|
48
|
+
team: Team | null;
|
49
49
|
guildId?: string;
|
50
|
-
guild?:
|
51
|
-
|
50
|
+
guild?: Guild;
|
51
|
+
primarySkuId?: string;
|
52
52
|
slug?: string;
|
53
53
|
coverImage?: string;
|
54
54
|
flags?: ApplicationFlags;
|
55
55
|
approximateGuildCount?: number;
|
56
56
|
redirectURIs?: Array<string>;
|
57
|
-
|
58
|
-
|
57
|
+
interactionsEndpointUrl?: string;
|
58
|
+
roleConnectionsVerificationUrl?: string;
|
59
59
|
tags?: Array<string>;
|
60
|
-
installParams?:
|
61
|
-
|
60
|
+
installParams?: InstallParams;
|
61
|
+
customInstallUrl?: string;
|
62
62
|
}
|
63
|
-
export interface
|
63
|
+
export interface InstallParams {
|
64
64
|
scopes: Array<OAuth2Scopes>;
|
65
65
|
permissions: string;
|
66
66
|
}
|
67
|
+
export interface EditCurrentApplicationParams {
|
68
|
+
customInstallUrl?: string;
|
69
|
+
description?: string;
|
70
|
+
roleConnectionsVerificationUrl?: string;
|
71
|
+
installParams?: InstallParams;
|
72
|
+
flags?: ApplicationFlags;
|
73
|
+
icon?: string;
|
74
|
+
coverImage?: string;
|
75
|
+
interactionsEndpointUrl?: string;
|
76
|
+
tags?: Array<string>;
|
77
|
+
}
|
@@ -1,6 +1,5 @@
|
|
1
|
-
import type { RawApplicationCommand, RawGuildScheduledEvent, RawAutoModerationRule, RawIntegration, RawChannel, RawUser, RawWebhook,
|
1
|
+
import type { RawApplicationCommand, RawGuildScheduledEvent, RawAutoModerationRule, RawIntegration, RawChannel, RawUser, RawWebhook, User, ApplicationCommand, AutoModerationRule, GuildScheduledEvent, Integration, Channel, Webhook } from ".";
|
2
2
|
import type { AuditLogEvents } from "../constants";
|
3
|
-
import { Collection } from "../utils";
|
4
3
|
/** https://discord.com/developers/docs/resources/audit-log#audit-log-object-audit-log-structure */
|
5
4
|
export interface RawAuditLog {
|
6
5
|
application_commands: Array<RawApplicationCommand>;
|
@@ -43,26 +42,26 @@ export interface RawAuditLogChange {
|
|
43
42
|
old_value?: any;
|
44
43
|
key: string;
|
45
44
|
}
|
46
|
-
export interface
|
47
|
-
applicationCommands:
|
48
|
-
auditLogEntries:
|
49
|
-
autoModerationRules:
|
50
|
-
guildScheduledEvents:
|
51
|
-
integrations:
|
52
|
-
threads:
|
53
|
-
users:
|
54
|
-
webhooks:
|
45
|
+
export interface AuditLog {
|
46
|
+
applicationCommands: Array<ApplicationCommand>;
|
47
|
+
auditLogEntries: Array<AuditLogEntry>;
|
48
|
+
autoModerationRules: Array<AutoModerationRule>;
|
49
|
+
guildScheduledEvents: Array<GuildScheduledEvent>;
|
50
|
+
integrations: Array<Integration>;
|
51
|
+
threads: Array<Channel>;
|
52
|
+
users: Array<User>;
|
53
|
+
webhooks: Array<Webhook>;
|
55
54
|
}
|
56
|
-
export interface
|
55
|
+
export interface AuditLogEntry {
|
57
56
|
targetId: string | null;
|
58
|
-
changes?: Array<
|
57
|
+
changes?: Array<AuditLogChange>;
|
59
58
|
userId: string | null;
|
60
59
|
id: string;
|
61
60
|
actionType: AuditLogEvents;
|
62
|
-
options?:
|
61
|
+
options?: OptionalAuditLogEntryInfo;
|
63
62
|
reason?: string;
|
64
63
|
}
|
65
|
-
export interface
|
64
|
+
export interface OptionalAuditLogEntryInfo {
|
66
65
|
applicationId: string;
|
67
66
|
autoModerationRuleName: string;
|
68
67
|
autoModerationRuleTriggerType: string;
|
@@ -76,7 +75,7 @@ export interface JSONOptionalAuditLogEntryInfo {
|
|
76
75
|
type: string;
|
77
76
|
integrationType: string;
|
78
77
|
}
|
79
|
-
export interface
|
78
|
+
export interface AuditLogChange {
|
80
79
|
newValue?: any;
|
81
80
|
oldValue?: any;
|
82
81
|
key: string;
|
@@ -33,20 +33,20 @@ export interface RawActionMetadata {
|
|
33
33
|
duration_seconds: number;
|
34
34
|
custom_message?: string;
|
35
35
|
}
|
36
|
-
export interface
|
36
|
+
export interface AutoModerationRule {
|
37
37
|
id: string;
|
38
38
|
guildId: string;
|
39
39
|
name: string;
|
40
40
|
creatorId: string;
|
41
41
|
eventType: EventTypes;
|
42
42
|
triggerType: TriggerTypes;
|
43
|
-
triggerMetadata:
|
44
|
-
actions: Array<
|
43
|
+
triggerMetadata: TriggerMetadata;
|
44
|
+
actions: Array<AutoModerationAction>;
|
45
45
|
enabled: boolean;
|
46
46
|
exemptRoles: Array<string>;
|
47
47
|
exemptChannels: Array<string>;
|
48
48
|
}
|
49
|
-
export interface
|
49
|
+
export interface TriggerMetadata {
|
50
50
|
keywordFilter: Array<string>;
|
51
51
|
regexPatterns: Array<string>;
|
52
52
|
presets: KeywordPresetTypes;
|
@@ -54,12 +54,32 @@ export interface JSONTriggerMetadata {
|
|
54
54
|
mentionTotalLimit: number;
|
55
55
|
mentionRaidProtection: boolean;
|
56
56
|
}
|
57
|
-
export interface
|
57
|
+
export interface AutoModerationAction {
|
58
58
|
type: ActionTypes;
|
59
|
-
metadata:
|
59
|
+
metadata: ActionMetadata;
|
60
60
|
}
|
61
|
-
export interface
|
61
|
+
export interface ActionMetadata {
|
62
62
|
channelId: string;
|
63
63
|
durationSeconds: number;
|
64
64
|
customMessage?: string;
|
65
65
|
}
|
66
|
+
export interface CreateAutoModerationRuleParams {
|
67
|
+
name: string;
|
68
|
+
eventType: EventTypes;
|
69
|
+
triggerType: TriggerTypes;
|
70
|
+
triggerMetadata?: TriggerMetadata;
|
71
|
+
actions: Array<AutoModerationAction>;
|
72
|
+
enabled?: boolean;
|
73
|
+
exemptRoles?: Array<string>;
|
74
|
+
exemptChannels?: Array<string>;
|
75
|
+
}
|
76
|
+
export interface EditAutoModerationRuleParams {
|
77
|
+
name?: string;
|
78
|
+
eventType?: EventTypes;
|
79
|
+
triggerType?: TriggerTypes;
|
80
|
+
triggerMetadata?: TriggerMetadata;
|
81
|
+
actions?: Array<AutoModerationAction>;
|
82
|
+
enabled?: boolean;
|
83
|
+
exemptRoles?: Array<string>;
|
84
|
+
exemptChannels?: Array<string>;
|
85
|
+
}
|