disgroove 2.2.2 → 2.2.3-dev.4f98e3d
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 +2 -2
- package/dist/lib/Client.d.ts +69 -77
- package/dist/lib/Client.js +204 -95
- package/dist/lib/gateway/Shard.d.ts +1 -0
- package/dist/lib/gateway/Shard.js +10 -4
- package/dist/lib/transformers/ApplicationCommands.d.ts +7 -0
- package/dist/lib/transformers/ApplicationCommands.js +90 -0
- package/dist/lib/transformers/ApplicationRoleConnectionMetadatas.d.ts +5 -0
- package/dist/lib/transformers/ApplicationRoleConnectionMetadatas.js +26 -0
- package/dist/lib/transformers/Applications.d.ts +0 -3
- package/dist/lib/transformers/Applications.js +0 -114
- package/dist/lib/transformers/AuditLogs.js +3 -3
- package/dist/lib/transformers/AutoModeration.d.ts +5 -1
- package/dist/lib/transformers/AutoModeration.js +44 -32
- package/dist/lib/transformers/Guilds.js +16 -0
- package/dist/lib/transformers/Presences.d.ts +0 -3
- package/dist/lib/transformers/Presences.js +52 -44
- package/dist/lib/transformers/Users.js +16 -2
- package/dist/lib/transformers/index.d.ts +2 -0
- package/dist/lib/transformers/index.js +2 -0
- package/dist/lib/types/guild.d.ts +3 -1
- package/dist/lib/types/user.d.ts +2 -2
- package/dist/lib/utils/errors.js +4 -4
- package/dist/lib/utils/formatters.d.ts +7 -0
- package/dist/lib/utils/formatters.js +7 -1
- package/dist/lib/utils/index.d.ts +0 -1
- package/dist/lib/utils/index.js +0 -1
- package/dist/package.json +1 -1
- package/package.json +1 -1
- package/dist/lib/utils/Util.d.ts +0 -4
- package/dist/lib/utils/Util.js +0 -63
@@ -0,0 +1,90 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.ApplicationCommands = void 0;
|
4
|
+
class ApplicationCommands {
|
5
|
+
static applicationCommandFromRaw(command) {
|
6
|
+
return {
|
7
|
+
id: command.id,
|
8
|
+
type: command.type,
|
9
|
+
applicationID: command.application_id,
|
10
|
+
guildID: command.guild_id,
|
11
|
+
name: command.name,
|
12
|
+
nameLocalizations: command.name_localizations,
|
13
|
+
description: command.description,
|
14
|
+
descriptionLocalizations: command.description_localizations,
|
15
|
+
options: command.options?.map((option) => this.optionFromRaw(option)),
|
16
|
+
defaultMemberPermissions: command.default_member_permissions,
|
17
|
+
dmPermission: command.dm_permission,
|
18
|
+
defaultPermission: command.default_permission,
|
19
|
+
integrationTypes: command.integration_types,
|
20
|
+
contexts: command.contexts,
|
21
|
+
nsfw: command.nsfw,
|
22
|
+
version: command.version,
|
23
|
+
};
|
24
|
+
}
|
25
|
+
static applicationCommandToRaw(command) {
|
26
|
+
return {
|
27
|
+
id: command.id,
|
28
|
+
type: command.type,
|
29
|
+
application_id: command.applicationID,
|
30
|
+
guild_id: command.guildID,
|
31
|
+
name: command.name,
|
32
|
+
name_localizations: command.nameLocalizations,
|
33
|
+
description: command.description,
|
34
|
+
description_localizations: command.descriptionLocalizations,
|
35
|
+
options: command.options?.map((option) => this.optionToRaw(option)),
|
36
|
+
default_member_permissions: command.defaultMemberPermissions,
|
37
|
+
dm_permission: command.dmPermission,
|
38
|
+
default_permission: command.defaultPermission,
|
39
|
+
integration_types: command.integrationTypes,
|
40
|
+
contexts: command.contexts,
|
41
|
+
nsfw: command.nsfw,
|
42
|
+
version: command.version,
|
43
|
+
};
|
44
|
+
}
|
45
|
+
static optionToRaw(option) {
|
46
|
+
return {
|
47
|
+
type: option.type,
|
48
|
+
name: option.name,
|
49
|
+
name_localizations: option.nameLocalizations,
|
50
|
+
description: option.description,
|
51
|
+
description_localizations: option.descriptionLocalizations,
|
52
|
+
required: option.required,
|
53
|
+
choices: option.choices?.map((choice) => ({
|
54
|
+
name: choice.name,
|
55
|
+
name_localizations: choice.nameLocalizations,
|
56
|
+
value: choice.value,
|
57
|
+
})),
|
58
|
+
options: option.options?.map((o) => this.optionFromRaw(o)),
|
59
|
+
channel_types: option.channelTypes,
|
60
|
+
min_value: option.minValue,
|
61
|
+
max_value: option.maxValue,
|
62
|
+
min_length: option.minLength,
|
63
|
+
max_length: option.maxLength,
|
64
|
+
autocomplete: option.autocomplete,
|
65
|
+
};
|
66
|
+
}
|
67
|
+
static optionFromRaw(option) {
|
68
|
+
return {
|
69
|
+
type: option.type,
|
70
|
+
name: option.name,
|
71
|
+
nameLocalizations: option.name_localizations,
|
72
|
+
description: option.description,
|
73
|
+
descriptionLocalizations: option.description_localizations,
|
74
|
+
required: option.required,
|
75
|
+
choices: option.choices?.map((choice) => ({
|
76
|
+
name: choice.name,
|
77
|
+
nameLocalizations: choice.name_localizations,
|
78
|
+
value: choice.value,
|
79
|
+
})),
|
80
|
+
options: option.options?.map((o) => this.optionFromRaw(o)),
|
81
|
+
channelTypes: option.channel_types,
|
82
|
+
minValue: option.min_value,
|
83
|
+
maxValue: option.max_value,
|
84
|
+
minLength: option.min_length,
|
85
|
+
maxLength: option.max_length,
|
86
|
+
autocomplete: option.autocomplete,
|
87
|
+
};
|
88
|
+
}
|
89
|
+
}
|
90
|
+
exports.ApplicationCommands = ApplicationCommands;
|
@@ -0,0 +1,5 @@
|
|
1
|
+
import type { ApplicationRoleConnectionMetadata, RawApplicationRoleConnectionMetadata } from "../types/application-role-connection-metadata";
|
2
|
+
export declare class ApplicationRoleConnectionMetadatas {
|
3
|
+
static applicationRoleConnectionMetadataFromRaw(connectionMetadata: RawApplicationRoleConnectionMetadata): ApplicationRoleConnectionMetadata;
|
4
|
+
static applicationRoleConnectionMetadataToRaw(connectionMetadata: ApplicationRoleConnectionMetadata): RawApplicationRoleConnectionMetadata;
|
5
|
+
}
|
@@ -0,0 +1,26 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.ApplicationRoleConnectionMetadatas = void 0;
|
4
|
+
class ApplicationRoleConnectionMetadatas {
|
5
|
+
static applicationRoleConnectionMetadataFromRaw(connectionMetadata) {
|
6
|
+
return {
|
7
|
+
type: connectionMetadata.type,
|
8
|
+
key: connectionMetadata.key,
|
9
|
+
name: connectionMetadata.name,
|
10
|
+
nameLocalizations: connectionMetadata.name_localizations,
|
11
|
+
description: connectionMetadata.description,
|
12
|
+
descriptionLocalizations: connectionMetadata.description_localizations,
|
13
|
+
};
|
14
|
+
}
|
15
|
+
static applicationRoleConnectionMetadataToRaw(connectionMetadata) {
|
16
|
+
return {
|
17
|
+
type: connectionMetadata.type,
|
18
|
+
key: connectionMetadata.key,
|
19
|
+
name: connectionMetadata.name,
|
20
|
+
name_localizations: connectionMetadata.nameLocalizations,
|
21
|
+
description: connectionMetadata.description,
|
22
|
+
description_localizations: connectionMetadata.descriptionLocalizations,
|
23
|
+
};
|
24
|
+
}
|
25
|
+
}
|
26
|
+
exports.ApplicationRoleConnectionMetadatas = ApplicationRoleConnectionMetadatas;
|
@@ -1,8 +1,5 @@
|
|
1
1
|
import type { RawApplication, Application } from "../types/application";
|
2
|
-
import type { RawApplicationCommand, ApplicationCommand } from "../types/application-command";
|
3
2
|
export declare class Applications {
|
4
|
-
static applicationCommandFromRaw(applicationCommand: RawApplicationCommand): ApplicationCommand;
|
5
|
-
static applicationCommandToRaw(applicationCommand: ApplicationCommand): RawApplicationCommand;
|
6
3
|
static applicationFromRaw(application: RawApplication): Application;
|
7
4
|
static applicationToRaw(application: Application): RawApplication;
|
8
5
|
}
|
@@ -5,120 +5,6 @@ const Guilds_1 = require("./Guilds");
|
|
5
5
|
const Teams_1 = require("./Teams");
|
6
6
|
const Users_1 = require("./Users");
|
7
7
|
class Applications {
|
8
|
-
static applicationCommandFromRaw(applicationCommand) {
|
9
|
-
return {
|
10
|
-
id: applicationCommand.id,
|
11
|
-
type: applicationCommand.type,
|
12
|
-
applicationID: applicationCommand.application_id,
|
13
|
-
guildID: applicationCommand.guild_id,
|
14
|
-
name: applicationCommand.name,
|
15
|
-
nameLocalizations: applicationCommand.name_localizations,
|
16
|
-
description: applicationCommand.description,
|
17
|
-
descriptionLocalizations: applicationCommand.description_localizations,
|
18
|
-
options: applicationCommand.options?.map((option) => ({
|
19
|
-
type: option.type,
|
20
|
-
name: option.name,
|
21
|
-
name_localizations: option.name_localizations,
|
22
|
-
description: option.description,
|
23
|
-
description_localizations: option.description_localizations,
|
24
|
-
required: option.required,
|
25
|
-
choices: option.choices?.map((choice) => ({
|
26
|
-
name: choice.name,
|
27
|
-
name_localizations: choice.name_localizations,
|
28
|
-
value: choice.value,
|
29
|
-
})),
|
30
|
-
options: option.options?.map((o) => ({
|
31
|
-
type: o.type,
|
32
|
-
name: o.name,
|
33
|
-
name_localizations: o.name_localizations,
|
34
|
-
description: o.description,
|
35
|
-
description_localizations: o.description_localizations,
|
36
|
-
required: o.required,
|
37
|
-
choices: o.choices?.map((choice) => ({
|
38
|
-
name: choice.name,
|
39
|
-
name_localizations: choice.name_localizations,
|
40
|
-
value: choice.value,
|
41
|
-
})),
|
42
|
-
channel_types: o.channel_types,
|
43
|
-
min_value: o.min_value,
|
44
|
-
max_value: o.max_value,
|
45
|
-
min_length: o.min_length,
|
46
|
-
max_length: o.max_length,
|
47
|
-
autocomplete: o.autocomplete,
|
48
|
-
})),
|
49
|
-
channel_types: option.channel_types,
|
50
|
-
min_value: option.min_value,
|
51
|
-
max_value: option.max_value,
|
52
|
-
min_length: option.min_length,
|
53
|
-
max_length: option.max_length,
|
54
|
-
autocomplete: option.autocomplete,
|
55
|
-
})),
|
56
|
-
defaultMemberPermissions: applicationCommand.default_member_permissions,
|
57
|
-
dmPermission: applicationCommand.dm_permission,
|
58
|
-
defaultPermission: applicationCommand.default_permission,
|
59
|
-
integrationTypes: applicationCommand.integration_types,
|
60
|
-
contexts: applicationCommand.contexts,
|
61
|
-
nsfw: applicationCommand.nsfw,
|
62
|
-
version: applicationCommand.version,
|
63
|
-
};
|
64
|
-
}
|
65
|
-
static applicationCommandToRaw(applicationCommand) {
|
66
|
-
return {
|
67
|
-
id: applicationCommand.id,
|
68
|
-
type: applicationCommand.type,
|
69
|
-
application_id: applicationCommand.applicationID,
|
70
|
-
guild_id: applicationCommand.guildID,
|
71
|
-
name: applicationCommand.name,
|
72
|
-
name_localizations: applicationCommand.nameLocalizations,
|
73
|
-
description: applicationCommand.description,
|
74
|
-
description_localizations: applicationCommand.descriptionLocalizations,
|
75
|
-
options: applicationCommand.options?.map((option) => ({
|
76
|
-
type: option.type,
|
77
|
-
name: option.name,
|
78
|
-
name_localizations: option.nameLocalizations,
|
79
|
-
description: option.description,
|
80
|
-
description_localizations: option.descriptionLocalizations,
|
81
|
-
required: option.required,
|
82
|
-
choices: option.choices?.map((choice) => ({
|
83
|
-
name: choice.name,
|
84
|
-
name_localizations: choice.nameLocalizations,
|
85
|
-
value: choice.value,
|
86
|
-
})),
|
87
|
-
options: option.options?.map((o) => ({
|
88
|
-
type: o.type,
|
89
|
-
name: o.name,
|
90
|
-
name_localizations: o.nameLocalizations,
|
91
|
-
description: o.description,
|
92
|
-
description_localizations: o.descriptionLocalizations,
|
93
|
-
required: o.required,
|
94
|
-
choices: o.choices?.map((choice) => ({
|
95
|
-
name: choice.name,
|
96
|
-
name_localizations: choice.nameLocalizations,
|
97
|
-
value: choice.value,
|
98
|
-
})),
|
99
|
-
channel_types: o.channelTypes,
|
100
|
-
min_value: o.minValue,
|
101
|
-
max_value: o.maxValue,
|
102
|
-
min_length: o.minLength,
|
103
|
-
max_length: o.maxLength,
|
104
|
-
autocomplete: o.autocomplete,
|
105
|
-
})),
|
106
|
-
channel_types: option.channelTypes,
|
107
|
-
min_value: option.minValue,
|
108
|
-
max_value: option.maxValue,
|
109
|
-
min_length: option.minLength,
|
110
|
-
max_length: option.maxLength,
|
111
|
-
autocomplete: option.autocomplete,
|
112
|
-
})),
|
113
|
-
default_member_permissions: applicationCommand.defaultMemberPermissions,
|
114
|
-
dm_permission: applicationCommand.dmPermission,
|
115
|
-
default_permission: applicationCommand.defaultPermission,
|
116
|
-
integration_types: applicationCommand.integrationTypes,
|
117
|
-
contexts: applicationCommand.contexts,
|
118
|
-
nsfw: applicationCommand.nsfw,
|
119
|
-
version: applicationCommand.version,
|
120
|
-
};
|
121
|
-
}
|
122
8
|
static applicationFromRaw(application) {
|
123
9
|
return {
|
124
10
|
id: application.id,
|
@@ -1,7 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.AuditLogs = void 0;
|
4
|
-
const
|
4
|
+
const ApplicationCommands_1 = require("./ApplicationCommands");
|
5
5
|
const AutoModeration_1 = require("./AutoModeration");
|
6
6
|
const Channels_1 = require("./Channels");
|
7
7
|
const Guilds_1 = require("./Guilds");
|
@@ -71,7 +71,7 @@ class AuditLogs {
|
|
71
71
|
}
|
72
72
|
static auditLogFromRaw(auditLog) {
|
73
73
|
return {
|
74
|
-
applicationCommands: auditLog.application_commands.map((applicationCommand) =>
|
74
|
+
applicationCommands: auditLog.application_commands.map((applicationCommand) => ApplicationCommands_1.ApplicationCommands.applicationCommandFromRaw(applicationCommand)),
|
75
75
|
auditLogEntries: auditLog.audit_log_entries.map((auditLogEntry) => AuditLogs.auditLogEntryFromRaw(auditLogEntry)),
|
76
76
|
autoModerationRules: auditLog.auto_moderation_rules.map((autoModerationRule) => AutoModeration_1.AutoModeration.autoModerationRuleFromRaw(autoModerationRule)),
|
77
77
|
guildScheduledEvents: auditLog.guild_scheduled_events.map((guildScheduledEvent) => GuildScheduledEvents_1.GuildScheduledEvents.guildScheduledEventFromRaw(guildScheduledEvent)),
|
@@ -83,7 +83,7 @@ class AuditLogs {
|
|
83
83
|
}
|
84
84
|
static auditLogToRaw(auditLog) {
|
85
85
|
return {
|
86
|
-
application_commands: auditLog.applicationCommands.map((applicationCommand) =>
|
86
|
+
application_commands: auditLog.applicationCommands.map((applicationCommand) => ApplicationCommands_1.ApplicationCommands.applicationCommandToRaw(applicationCommand)),
|
87
87
|
audit_log_entries: auditLog.auditLogEntries.map((auditLogEntry) => AuditLogs.auditLogEntryToRaw(auditLogEntry)),
|
88
88
|
auto_moderation_rules: auditLog.autoModerationRules.map((autoModerationRule) => AutoModeration_1.AutoModeration.autoModerationRuleToRaw(autoModerationRule)),
|
89
89
|
guild_scheduled_events: auditLog.guildScheduledEvents.map((guildScheduledEvent) => GuildScheduledEvents_1.GuildScheduledEvents.guildScheduledEventToRaw(guildScheduledEvent)),
|
@@ -1,5 +1,9 @@
|
|
1
|
-
import type { AutoModerationRule, RawAutoModerationRule } from "../types/auto-moderation";
|
1
|
+
import type { AutoModerationAction, AutoModerationRule, RawAutoModerationAction, RawAutoModerationRule, RawTriggerMetadata, TriggerMetadata } from "../types/auto-moderation";
|
2
2
|
export declare class AutoModeration {
|
3
|
+
static actionFromRaw(action: RawAutoModerationAction): AutoModerationAction;
|
4
|
+
static actionToRaw(action: AutoModerationAction): RawAutoModerationAction;
|
3
5
|
static autoModerationRuleFromRaw(autoModerationRule: RawAutoModerationRule): AutoModerationRule;
|
4
6
|
static autoModerationRuleToRaw(autoModerationRule: AutoModerationRule): RawAutoModerationRule;
|
7
|
+
static triggerMetadataFromRaw(triggerMetadata: RawTriggerMetadata): TriggerMetadata;
|
8
|
+
static triggerMetadataToRaw(triggerMetadata: TriggerMetadata): RawTriggerMetadata;
|
5
9
|
}
|
@@ -2,6 +2,26 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.AutoModeration = void 0;
|
4
4
|
class AutoModeration {
|
5
|
+
static actionFromRaw(action) {
|
6
|
+
return {
|
7
|
+
type: action.type,
|
8
|
+
metadata: {
|
9
|
+
channelID: action.metadata.channel_id,
|
10
|
+
durationSeconds: action.metadata.duration_seconds,
|
11
|
+
customMessage: action.metadata.custom_message,
|
12
|
+
},
|
13
|
+
};
|
14
|
+
}
|
15
|
+
static actionToRaw(action) {
|
16
|
+
return {
|
17
|
+
type: action.type,
|
18
|
+
metadata: {
|
19
|
+
channel_id: action.metadata.channelID,
|
20
|
+
duration_seconds: action.metadata.durationSeconds,
|
21
|
+
custom_message: action.metadata.customMessage,
|
22
|
+
},
|
23
|
+
};
|
24
|
+
}
|
5
25
|
static autoModerationRuleFromRaw(autoModerationRule) {
|
6
26
|
return {
|
7
27
|
id: autoModerationRule.id,
|
@@ -10,22 +30,8 @@ class AutoModeration {
|
|
10
30
|
creatorID: autoModerationRule.creator_id,
|
11
31
|
eventType: autoModerationRule.event_type,
|
12
32
|
triggerType: autoModerationRule.trigger_type,
|
13
|
-
triggerMetadata:
|
14
|
-
|
15
|
-
regexPatterns: autoModerationRule.trigger_metadata.regex_patterns,
|
16
|
-
presets: autoModerationRule.trigger_metadata.presets,
|
17
|
-
allowList: autoModerationRule.trigger_metadata.allow_list,
|
18
|
-
mentionTotalLimit: autoModerationRule.trigger_metadata.mention_total_limit,
|
19
|
-
mentionRaidProtection: autoModerationRule.trigger_metadata.mention_raid_protection,
|
20
|
-
},
|
21
|
-
actions: autoModerationRule.actions.map((action) => ({
|
22
|
-
type: action.type,
|
23
|
-
metadata: {
|
24
|
-
channelID: action.metadata.channel_id,
|
25
|
-
durationSeconds: action.metadata.duration_seconds,
|
26
|
-
customMessage: action.metadata.custom_message,
|
27
|
-
},
|
28
|
-
})),
|
33
|
+
triggerMetadata: this.triggerMetadataFromRaw(autoModerationRule.trigger_metadata),
|
34
|
+
actions: autoModerationRule.actions.map((action) => this.actionFromRaw(action)),
|
29
35
|
enabled: autoModerationRule.enabled,
|
30
36
|
exemptRoles: autoModerationRule.exempt_roles,
|
31
37
|
exemptChannels: autoModerationRule.exempt_channels,
|
@@ -39,26 +45,32 @@ class AutoModeration {
|
|
39
45
|
creator_id: autoModerationRule.creatorID,
|
40
46
|
event_type: autoModerationRule.eventType,
|
41
47
|
trigger_type: autoModerationRule.triggerType,
|
42
|
-
trigger_metadata:
|
43
|
-
|
44
|
-
regex_patterns: autoModerationRule.triggerMetadata.regexPatterns,
|
45
|
-
presets: autoModerationRule.triggerMetadata.presets,
|
46
|
-
allow_list: autoModerationRule.triggerMetadata.allowList,
|
47
|
-
mention_total_limit: autoModerationRule.triggerMetadata.mentionTotalLimit,
|
48
|
-
mention_raid_protection: autoModerationRule.triggerMetadata.mentionRaidProtection,
|
49
|
-
},
|
50
|
-
actions: autoModerationRule.actions.map((action) => ({
|
51
|
-
type: action.type,
|
52
|
-
metadata: {
|
53
|
-
channel_id: action.metadata.channelID,
|
54
|
-
duration_seconds: action.metadata.durationSeconds,
|
55
|
-
custom_message: action.metadata.customMessage,
|
56
|
-
},
|
57
|
-
})),
|
48
|
+
trigger_metadata: this.triggerMetadataToRaw(autoModerationRule.triggerMetadata),
|
49
|
+
actions: autoModerationRule.actions.map((action) => this.actionToRaw(action)),
|
58
50
|
enabled: autoModerationRule.enabled,
|
59
51
|
exempt_roles: autoModerationRule.exemptRoles,
|
60
52
|
exempt_channels: autoModerationRule.exemptChannels,
|
61
53
|
};
|
62
54
|
}
|
55
|
+
static triggerMetadataFromRaw(triggerMetadata) {
|
56
|
+
return {
|
57
|
+
keywordFilter: triggerMetadata.keyword_filter,
|
58
|
+
regexPatterns: triggerMetadata.regex_patterns,
|
59
|
+
presets: triggerMetadata.presets,
|
60
|
+
allowList: triggerMetadata.allow_list,
|
61
|
+
mentionTotalLimit: triggerMetadata.mention_total_limit,
|
62
|
+
mentionRaidProtection: triggerMetadata.mention_raid_protection,
|
63
|
+
};
|
64
|
+
}
|
65
|
+
static triggerMetadataToRaw(triggerMetadata) {
|
66
|
+
return {
|
67
|
+
keyword_filter: triggerMetadata.keywordFilter,
|
68
|
+
regex_patterns: triggerMetadata.regexPatterns,
|
69
|
+
presets: triggerMetadata.presets,
|
70
|
+
allow_list: triggerMetadata.allowList,
|
71
|
+
mention_total_limit: triggerMetadata.mentionTotalLimit,
|
72
|
+
mention_raid_protection: triggerMetadata.mentionRaidProtection,
|
73
|
+
};
|
74
|
+
}
|
63
75
|
}
|
64
76
|
exports.AutoModeration = AutoModeration;
|
@@ -103,6 +103,14 @@ class Guilds {
|
|
103
103
|
pending: guildMember.pending,
|
104
104
|
permissions: guildMember.permissions,
|
105
105
|
communicationDisabledUntil: guildMember.communication_disabled_until,
|
106
|
+
avatarDecorationData: guildMember.avatar_decoration_data !== undefined
|
107
|
+
? guildMember.avatar_decoration_data !== null
|
108
|
+
? {
|
109
|
+
asset: guildMember.avatar_decoration_data.asset,
|
110
|
+
skuID: guildMember.avatar_decoration_data.sku_id,
|
111
|
+
}
|
112
|
+
: null
|
113
|
+
: undefined,
|
106
114
|
};
|
107
115
|
}
|
108
116
|
static guildMemberToRaw(guildMember) {
|
@@ -121,6 +129,14 @@ class Guilds {
|
|
121
129
|
pending: guildMember.pending,
|
122
130
|
permissions: guildMember.permissions,
|
123
131
|
communication_disabled_until: guildMember.communicationDisabledUntil,
|
132
|
+
avatar_decoration_data: guildMember.avatarDecorationData !== undefined
|
133
|
+
? guildMember.avatarDecorationData !== null
|
134
|
+
? {
|
135
|
+
asset: guildMember.avatarDecorationData.asset,
|
136
|
+
sku_id: guildMember.avatarDecorationData.skuID,
|
137
|
+
}
|
138
|
+
: null
|
139
|
+
: undefined,
|
124
140
|
};
|
125
141
|
}
|
126
142
|
static guildToRaw(guild) {
|
@@ -1,8 +1,5 @@
|
|
1
1
|
import type { RawPresenceUpdateEventFields, PresenceUpdateEventFields } from "../types/gateway-events";
|
2
|
-
import type { RawUser, User } from "../types/user";
|
3
2
|
export declare class Presences {
|
4
3
|
static presenceFromRaw(presence: RawPresenceUpdateEventFields): PresenceUpdateEventFields;
|
5
4
|
static presenceToRaw(presence: PresenceUpdateEventFields): RawPresenceUpdateEventFields;
|
6
|
-
static presenceUserFromRaw(user: Pick<RawUser, "id"> & Partial<RawUser>): Pick<User, "id"> & Partial<User>;
|
7
|
-
static presenceUserToRaw(user: Pick<User, "id"> & Partial<User>): Pick<RawUser, "id"> & Partial<RawUser>;
|
8
5
|
}
|
@@ -4,7 +4,32 @@ exports.Presences = void 0;
|
|
4
4
|
class Presences {
|
5
5
|
static presenceFromRaw(presence) {
|
6
6
|
return {
|
7
|
-
user:
|
7
|
+
user: {
|
8
|
+
id: presence.user.id,
|
9
|
+
username: presence.user.username,
|
10
|
+
discriminator: presence.user.discriminator,
|
11
|
+
globalName: presence.user.global_name,
|
12
|
+
avatar: presence.user.avatar,
|
13
|
+
bot: presence.user.bot,
|
14
|
+
system: presence.user.system,
|
15
|
+
mfaEnabled: presence.user.mfa_enabled,
|
16
|
+
banner: presence.user.banner,
|
17
|
+
accentColor: presence.user.accent_color,
|
18
|
+
locale: presence.user.locale,
|
19
|
+
verified: presence.user.verified,
|
20
|
+
email: presence.user.email,
|
21
|
+
flags: presence.user.flags,
|
22
|
+
premiumType: presence.user.premium_type,
|
23
|
+
publicFlags: presence.user.public_flags,
|
24
|
+
avatarDecorationData: presence.user.avatar_decoration_data !== undefined
|
25
|
+
? presence.user.avatar_decoration_data !== null
|
26
|
+
? {
|
27
|
+
asset: presence.user.avatar_decoration_data.asset,
|
28
|
+
skuID: presence.user.avatar_decoration_data.sku_id,
|
29
|
+
}
|
30
|
+
: null
|
31
|
+
: undefined,
|
32
|
+
},
|
8
33
|
guildID: presence.guild_id,
|
9
34
|
status: presence.status,
|
10
35
|
activities: presence.activities.map((activity) => ({
|
@@ -34,7 +59,32 @@ class Presences {
|
|
34
59
|
}
|
35
60
|
static presenceToRaw(presence) {
|
36
61
|
return {
|
37
|
-
user:
|
62
|
+
user: {
|
63
|
+
id: presence.user.id,
|
64
|
+
username: presence.user.username,
|
65
|
+
discriminator: presence.user.discriminator,
|
66
|
+
global_name: presence.user.globalName,
|
67
|
+
avatar: presence.user.avatar,
|
68
|
+
bot: presence.user.bot,
|
69
|
+
system: presence.user.system,
|
70
|
+
mfa_enabled: presence.user.mfaEnabled,
|
71
|
+
banner: presence.user.banner,
|
72
|
+
accent_color: presence.user.accentColor,
|
73
|
+
locale: presence.user.locale,
|
74
|
+
verified: presence.user.verified,
|
75
|
+
email: presence.user.email,
|
76
|
+
flags: presence.user.flags,
|
77
|
+
premium_type: presence.user.premiumType,
|
78
|
+
public_flags: presence.user.publicFlags,
|
79
|
+
avatar_decoration_data: presence.user.avatarDecorationData !== undefined
|
80
|
+
? presence.user.avatarDecorationData !== null
|
81
|
+
? {
|
82
|
+
asset: presence.user.avatarDecorationData.asset,
|
83
|
+
sku_id: presence.user.avatarDecorationData.skuID,
|
84
|
+
}
|
85
|
+
: null
|
86
|
+
: undefined,
|
87
|
+
},
|
38
88
|
guild_id: presence.guildID,
|
39
89
|
status: presence.status,
|
40
90
|
activities: presence.activities.map((activity) => ({
|
@@ -62,47 +112,5 @@ class Presences {
|
|
62
112
|
client_status: presence.clientStatus,
|
63
113
|
};
|
64
114
|
}
|
65
|
-
static presenceUserFromRaw(user) {
|
66
|
-
return {
|
67
|
-
id: user.id,
|
68
|
-
username: user.username,
|
69
|
-
discriminator: user.discriminator,
|
70
|
-
globalName: user.global_name,
|
71
|
-
avatar: user.avatar,
|
72
|
-
bot: user.bot,
|
73
|
-
system: user.system,
|
74
|
-
mfaEnabled: user.mfa_enabled,
|
75
|
-
banner: user.banner,
|
76
|
-
accentColor: user.accent_color,
|
77
|
-
locale: user.locale,
|
78
|
-
verified: user.verified,
|
79
|
-
email: user.email,
|
80
|
-
flags: user.flags,
|
81
|
-
premiumType: user.premium_type,
|
82
|
-
publicFlags: user.public_flags,
|
83
|
-
avatarDecoration: user.avatar_decoration,
|
84
|
-
};
|
85
|
-
}
|
86
|
-
static presenceUserToRaw(user) {
|
87
|
-
return {
|
88
|
-
id: user.id,
|
89
|
-
username: user.username,
|
90
|
-
discriminator: user.discriminator,
|
91
|
-
global_name: user.globalName,
|
92
|
-
avatar: user.avatar,
|
93
|
-
bot: user.bot,
|
94
|
-
system: user.system,
|
95
|
-
mfa_enabled: user.mfaEnabled,
|
96
|
-
banner: user.banner,
|
97
|
-
accent_color: user.accentColor,
|
98
|
-
locale: user.locale,
|
99
|
-
verified: user.verified,
|
100
|
-
email: user.email,
|
101
|
-
flags: user.flags,
|
102
|
-
premium_type: user.premiumType,
|
103
|
-
public_flags: user.publicFlags,
|
104
|
-
avatar_decoration: user.avatarDecoration,
|
105
|
-
};
|
106
|
-
}
|
107
115
|
}
|
108
116
|
exports.Presences = Presences;
|
@@ -20,7 +20,14 @@ class Users {
|
|
20
20
|
flags: user.flags,
|
21
21
|
premiumType: user.premium_type,
|
22
22
|
publicFlags: user.public_flags,
|
23
|
-
|
23
|
+
avatarDecorationData: user.avatar_decoration_data !== undefined
|
24
|
+
? user.avatar_decoration_data !== null
|
25
|
+
? {
|
26
|
+
asset: user.avatar_decoration_data.asset,
|
27
|
+
skuID: user.avatar_decoration_data.sku_id,
|
28
|
+
}
|
29
|
+
: null
|
30
|
+
: undefined,
|
24
31
|
};
|
25
32
|
}
|
26
33
|
static userToRaw(user) {
|
@@ -41,7 +48,14 @@ class Users {
|
|
41
48
|
flags: user.flags,
|
42
49
|
premium_type: user.premiumType,
|
43
50
|
public_flags: user.publicFlags,
|
44
|
-
|
51
|
+
avatar_decoration_data: user.avatarDecorationData !== undefined
|
52
|
+
? user.avatarDecorationData !== null
|
53
|
+
? {
|
54
|
+
asset: user.avatarDecorationData.asset,
|
55
|
+
sku_id: user.avatarDecorationData.skuID,
|
56
|
+
}
|
57
|
+
: null
|
58
|
+
: undefined,
|
45
59
|
};
|
46
60
|
}
|
47
61
|
}
|
@@ -14,6 +14,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
15
15
|
};
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
17
|
+
__exportStar(require("./ApplicationCommands"), exports);
|
18
|
+
__exportStar(require("./ApplicationRoleConnectionMetadatas"), exports);
|
17
19
|
__exportStar(require("./Applications"), exports);
|
18
20
|
__exportStar(require("./AuditLogs"), exports);
|
19
21
|
__exportStar(require("./AutoModeration"), exports);
|
@@ -4,7 +4,7 @@ import type { snowflake, timestamp } from "./common";
|
|
4
4
|
import type { RawEmoji, Emoji } from "./emoji";
|
5
5
|
import type { RawRole, Role } from "./role";
|
6
6
|
import type { RawSticker, Sticker } from "./sticker";
|
7
|
-
import type { RawUser, User } from "./user";
|
7
|
+
import type { AvatarDecorationData, RawAvatarDecorationData, RawUser, User } from "./user";
|
8
8
|
/** https://discord.com/developers/docs/resources/guild#guild-object-guild-structure */
|
9
9
|
export interface RawGuild {
|
10
10
|
id: snowflake;
|
@@ -98,6 +98,7 @@ export interface RawGuildMember {
|
|
98
98
|
pending?: boolean;
|
99
99
|
permissions?: string;
|
100
100
|
communication_disabled_until?: number | null;
|
101
|
+
avatar_decoration_data?: RawAvatarDecorationData | null;
|
101
102
|
}
|
102
103
|
/** https://discord.com/developers/docs/resources/guild#integration-object-integration-structure */
|
103
104
|
export interface RawIntegration {
|
@@ -265,6 +266,7 @@ export interface GuildMember {
|
|
265
266
|
pending?: boolean;
|
266
267
|
permissions?: string;
|
267
268
|
communicationDisabledUntil?: number | null;
|
269
|
+
avatarDecorationData?: AvatarDecorationData | null;
|
268
270
|
}
|
269
271
|
export interface Integration {
|
270
272
|
id: snowflake;
|
package/dist/lib/types/user.d.ts
CHANGED
@@ -20,7 +20,7 @@ export interface RawUser {
|
|
20
20
|
flags?: UserFlags;
|
21
21
|
premium_type?: PremiumTypes;
|
22
22
|
public_flags?: UserFlags;
|
23
|
-
|
23
|
+
avatar_decoration_data?: RawAvatarDecorationData | null;
|
24
24
|
}
|
25
25
|
/** https://discord.com/developers/docs/resources/user#avatar-decoration-data-object-avatar-decoration-data-structure */
|
26
26
|
export interface RawAvatarDecorationData {
|
@@ -63,7 +63,7 @@ export interface User {
|
|
63
63
|
flags?: UserFlags;
|
64
64
|
premiumType?: PremiumTypes;
|
65
65
|
publicFlags?: UserFlags;
|
66
|
-
|
66
|
+
avatarDecorationData?: AvatarDecorationData | null;
|
67
67
|
}
|
68
68
|
export interface AvatarDecorationData {
|
69
69
|
asset: string;
|