disgroove 2.2.2-dev.4aafdf4 → 2.2.2-dev.bd3875c
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 +4 -2
- package/dist/lib/Client.d.ts +15 -5
- package/dist/lib/Client.js +21 -12
- package/dist/lib/constants.d.ts +66 -70
- package/dist/lib/constants.js +66 -70
- package/dist/lib/gateway/Shard.d.ts +1 -1
- package/dist/lib/gateway/Shard.js +169 -141
- package/dist/lib/rest/RequestManager.d.ts +1 -1
- package/dist/lib/rest/RequestManager.js +1 -1
- package/dist/lib/types/gateway-events.d.ts +21 -8
- package/dist/lib/utils/Util.d.ts +16 -14
- package/dist/lib/utils/Util.js +473 -429
- package/dist/lib/utils/errors.d.ts +3 -3
- package/dist/lib/utils/errors.js +6 -8
- package/dist/package.json +1 -1
- package/package.json +1 -1
@@ -23,7 +23,7 @@ export interface RawIdentify {
|
|
23
23
|
compress?: boolean;
|
24
24
|
large_threshold?: number;
|
25
25
|
shard?: [number, number];
|
26
|
-
presence?: RawGatewayPresenceUpdate
|
26
|
+
presence?: Partial<Pick<RawGatewayPresenceUpdate, "since" | "activities" | "status" | "afk">>;
|
27
27
|
intents: GatewayIntents;
|
28
28
|
}
|
29
29
|
/** https://discord.com/developers/docs/topics/gateway-events#identify-identify-connection-properties */
|
@@ -50,7 +50,7 @@ export interface RawRequestGuildMembers {
|
|
50
50
|
/** https://discord.com/developers/docs/topics/gateway-events#update-presence-gateway-presence-update-structure */
|
51
51
|
export interface RawGatewayPresenceUpdate {
|
52
52
|
since: number | null;
|
53
|
-
activities: Array<Pick<RawActivity, "name" | "type" | "url" | "state"
|
53
|
+
activities: Array<Partial<Pick<RawActivity, "name" | "type" | "url" | "state">>>;
|
54
54
|
status: StatusTypes;
|
55
55
|
afk: boolean;
|
56
56
|
}
|
@@ -258,7 +258,7 @@ export interface RawMessageReactionRemoveEmojiEventFields {
|
|
258
258
|
}
|
259
259
|
/** https://discord.com/developers/docs/topics/gateway-events#presence-update-presence-update-event-fields */
|
260
260
|
export interface RawPresenceUpdateEventFields {
|
261
|
-
user: RawUser
|
261
|
+
user: Pick<RawUser, "id"> & Partial<RawUser>;
|
262
262
|
guild_id: snowflake;
|
263
263
|
status: StatusTypes;
|
264
264
|
activities: Array<RawActivity>;
|
@@ -275,11 +275,12 @@ export interface RawActivity {
|
|
275
275
|
name: string;
|
276
276
|
type: ActivityType;
|
277
277
|
url?: string | null;
|
278
|
-
created_at:
|
278
|
+
created_at: number;
|
279
279
|
timestamps?: RawActivityTimestamps;
|
280
280
|
application_id?: snowflake;
|
281
281
|
details?: string | null;
|
282
282
|
state?: string | null;
|
283
|
+
emoji?: RawActivityEmoji | null;
|
283
284
|
party?: RawActivityParty;
|
284
285
|
assets?: RawActivityAssets;
|
285
286
|
secrets?: RawActivitySecrets;
|
@@ -292,6 +293,12 @@ export interface RawActivityTimestamps {
|
|
292
293
|
start?: number;
|
293
294
|
end?: number;
|
294
295
|
}
|
296
|
+
/** https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-emoji */
|
297
|
+
export interface RawActivityEmoji {
|
298
|
+
name: string;
|
299
|
+
id?: snowflake;
|
300
|
+
animated?: boolean;
|
301
|
+
}
|
295
302
|
/** https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-party */
|
296
303
|
export interface RawActivityParty {
|
297
304
|
id?: string;
|
@@ -357,7 +364,7 @@ export interface Identify {
|
|
357
364
|
compress?: boolean;
|
358
365
|
largeThreshold?: number;
|
359
366
|
shard?: [number, number];
|
360
|
-
presence?: GatewayPresenceUpdate
|
367
|
+
presence?: Partial<Pick<GatewayPresenceUpdate, "since" | "activities" | "status" | "afk">>;
|
361
368
|
intents: GatewayIntents;
|
362
369
|
}
|
363
370
|
export interface IdentifyConnectionProperties {
|
@@ -380,7 +387,7 @@ export interface RequestGuildMembers {
|
|
380
387
|
}
|
381
388
|
export interface GatewayPresenceUpdate {
|
382
389
|
since: number | null;
|
383
|
-
activities: Array<Pick<Activity, "name" | "type" | "url" | "state"
|
390
|
+
activities: Array<Partial<Pick<Activity, "name" | "type" | "url" | "state">>>;
|
384
391
|
status: StatusTypes;
|
385
392
|
afk: boolean;
|
386
393
|
}
|
@@ -560,7 +567,7 @@ export interface MessageReactionRemoveEmojiEventFields {
|
|
560
567
|
emoji: Emoji;
|
561
568
|
}
|
562
569
|
export interface PresenceUpdateEventFields {
|
563
|
-
user: User
|
570
|
+
user: Pick<User, "id"> & Partial<User>;
|
564
571
|
guildID: snowflake;
|
565
572
|
status: StatusTypes;
|
566
573
|
activities: Array<Activity>;
|
@@ -575,11 +582,12 @@ export interface Activity {
|
|
575
582
|
name: string;
|
576
583
|
type: ActivityType;
|
577
584
|
url?: string | null;
|
578
|
-
createdAt:
|
585
|
+
createdAt: number;
|
579
586
|
timestamps?: ActivityTimestamps;
|
580
587
|
applicationID?: snowflake;
|
581
588
|
details?: string | null;
|
582
589
|
state?: string | null;
|
590
|
+
emoji?: ActivityEmoji | null;
|
583
591
|
party?: ActivityParty;
|
584
592
|
assets?: ActivityAssets;
|
585
593
|
secrets?: ActivitySecrets;
|
@@ -591,6 +599,11 @@ export interface ActivityTimestamps {
|
|
591
599
|
start?: number;
|
592
600
|
end?: number;
|
593
601
|
}
|
602
|
+
export interface ActivityEmoji {
|
603
|
+
name: string;
|
604
|
+
id?: snowflake;
|
605
|
+
animated?: boolean;
|
606
|
+
}
|
594
607
|
export interface ActivityParty {
|
595
608
|
id?: string;
|
596
609
|
size?: Array<number>;
|
package/dist/lib/utils/Util.d.ts
CHANGED
@@ -22,18 +22,18 @@ import type { AuditLog, AuditLogEntry, RawAuditLog, RawAuditLogEntry } from "../
|
|
22
22
|
import type { RawSKU, SKU } from "../types/sku";
|
23
23
|
import type { PresenceUpdateEventFields, RawPresenceUpdateEventFields } from "../types/gateway-events";
|
24
24
|
export declare class Util {
|
25
|
-
|
26
|
-
|
25
|
+
applicationCommandFromRaw(applicationCommand: RawApplicationCommand): ApplicationCommand;
|
26
|
+
applicationCommandToRaw(applicationCommand: ApplicationCommand): RawApplicationCommand;
|
27
|
+
applicationFromRaw(application: RawApplication): Application;
|
28
|
+
applicationToRaw(application: Application): RawApplication;
|
29
|
+
attachmentFromRaw(attachment: RawAttachment): Attachment;
|
30
|
+
attachmentToRaw(attachment: Attachment): RawAttachment;
|
27
31
|
auditLogEntryFromRaw(auditLogEntry: RawAuditLogEntry): AuditLogEntry;
|
28
32
|
auditLogEntryToRaw(auditLogEntry: AuditLogEntry): RawAuditLogEntry;
|
33
|
+
auditLogFromRaw(auditLog: RawAuditLog): AuditLog;
|
34
|
+
auditLogToRaw(auditLog: AuditLog): RawAuditLog;
|
29
35
|
autoModerationRuleFromRaw(autoModerationRule: RawAutoModerationRule): AutoModerationRule;
|
30
36
|
autoModerationRuleToRaw(autoModerationRule: AutoModerationRule): RawAutoModerationRule;
|
31
|
-
attachmentFromRaw(attachment: RawAttachment): Attachment;
|
32
|
-
attachmentToRaw(attachment: Attachment): RawAttachment;
|
33
|
-
applicationFromRaw(application: RawApplication): Application;
|
34
|
-
applicationToRaw(application: Application): RawApplication;
|
35
|
-
applicationCommandFromRaw(applicationCommand: RawApplicationCommand): ApplicationCommand;
|
36
|
-
applicationCommandToRaw(applicationCommand: ApplicationCommand): RawApplicationCommand;
|
37
37
|
channelFromRaw(channel: RawChannel): Channel;
|
38
38
|
channelToRaw(channel: Channel): RawChannel;
|
39
39
|
embedFromRaw(embed: RawEmbed): Embed;
|
@@ -45,19 +45,19 @@ export declare class Util {
|
|
45
45
|
guildApplicationCommandPermissionsFromRaw(guildApplicationCommandPermissions: RawGuildApplicationCommandPermissions): GuildApplicationCommandPermissions;
|
46
46
|
guildApplicationCommandPermissionsToRaw(guildApplicationCommandPermissions: GuildApplicationCommandPermissions): RawGuildApplicationCommandPermissions;
|
47
47
|
guildFromRaw(guild: RawGuild): Guild;
|
48
|
-
guildToRaw(guild: Guild): RawGuild;
|
49
48
|
guildMemberFromRaw(guildMember: RawGuildMember): GuildMember;
|
50
49
|
guildMemberToRaw(guildMember: GuildMember): RawGuildMember;
|
51
50
|
guildScheduledEventFromRaw(guildScheduledEvent: RawGuildScheduledEvent): GuildScheduledEvent;
|
52
51
|
guildScheduledEventToRaw(guildScheduledEvent: GuildScheduledEvent): RawGuildScheduledEvent;
|
53
52
|
guildTemplateFromRaw(guildTemplate: RawGuildTemplate): GuildTemplate;
|
54
53
|
guildTemplateToRaw(guildTemplate: GuildTemplate): RawGuildTemplate;
|
54
|
+
guildToRaw(guild: Guild): RawGuild;
|
55
55
|
integrationFromRaw(integration: RawIntegration): Integration;
|
56
56
|
integrationToRaw(integration: Integration): RawIntegration;
|
57
57
|
interactionFromRaw(interaction: RawInteraction): Interaction;
|
58
|
-
interactionToRaw(interaction: Interaction): RawInteraction;
|
59
58
|
interactionMetadataFromRaw(interactionMetadata: RawMessageInteractionMetadata): MessageInteractionMetadata;
|
60
59
|
interactionMetadataToRaw(interactionMetadata: MessageInteractionMetadata): RawMessageInteractionMetadata;
|
60
|
+
interactionToRaw(interaction: Interaction): RawInteraction;
|
61
61
|
inviteFromRaw(invite: RawInvite): Invite;
|
62
62
|
inviteToRaw(invite: Invite): RawInvite;
|
63
63
|
messageComponentsFromRaw(components: Array<RawActionRow>): Array<ActionRow>;
|
@@ -67,10 +67,12 @@ export declare class Util {
|
|
67
67
|
partialApplicationCommandToRaw(applicationCommand: Partial<ApplicationCommand>): Partial<RawApplicationCommand>;
|
68
68
|
presenceFromRaw(presence: RawPresenceUpdateEventFields): PresenceUpdateEventFields;
|
69
69
|
presenceToRaw(presence: PresenceUpdateEventFields): RawPresenceUpdateEventFields;
|
70
|
-
|
71
|
-
|
70
|
+
presenceUserFromRaw(user: Pick<RawUser, "id"> & Partial<RawUser>): Pick<User, "id"> & Partial<User>;
|
71
|
+
presenceUserToRaw(user: Pick<User, "id"> & Partial<User>): Pick<RawUser, "id"> & Partial<RawUser>;
|
72
72
|
pollFromRaw(poll: RawPoll): Poll;
|
73
73
|
pollToRaw(poll: Poll): RawPoll;
|
74
|
+
resolvedDataFromRaw(resolvedData: RawResolvedData): ResolvedData;
|
75
|
+
resolvedDataToRaw(resolvedData: ResolvedData): RawResolvedData;
|
74
76
|
roleFromRaw(role: RawRole): Role;
|
75
77
|
roleToRaw(role: Role): RawRole;
|
76
78
|
skuFromRaw(sku: RawSKU): SKU;
|
@@ -81,10 +83,10 @@ export declare class Util {
|
|
81
83
|
stickerToRaw(sticker: Sticker): RawSticker;
|
82
84
|
teamFromRaw(team: RawTeam): Team;
|
83
85
|
teamToRaw(team: Team): RawTeam;
|
84
|
-
threadMemberFromRaw(threadMember: RawThreadMember): ThreadMember;
|
85
|
-
threadMemberToRaw(threadMember: ThreadMember): RawThreadMember;
|
86
86
|
testEntitlementFromRaw(entitlement: Omit<RawEntitlement, "starts_at" | "ends_at" | "subscription_id">): Omit<Entitlement, "startsAt" | "endsAt" | "subscriptionID">;
|
87
87
|
testEntitlementToRaw(entitlement: Omit<Entitlement, "startsAt" | "endsAt" | "subscriptionID">): Omit<RawEntitlement, "starts_at" | "ends_at" | "subscription_id">;
|
88
|
+
threadMemberFromRaw(threadMember: RawThreadMember): ThreadMember;
|
89
|
+
threadMemberToRaw(threadMember: ThreadMember): RawThreadMember;
|
88
90
|
userFromRaw(user: RawUser): User;
|
89
91
|
userToRaw(user: User): RawUser;
|
90
92
|
voiceStateFromRaw(voiceState: RawVoiceState): VoiceState;
|