disgroove 0.0.1
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/dist/class/Client.d.ts +306 -0
- package/dist/class/Client.js +771 -0
- package/dist/class/Client.js.map +1 -0
- package/dist/class/index.d.ts +1 -0
- package/dist/class/index.js +18 -0
- package/dist/class/index.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +22 -0
- package/dist/index.js.map +1 -0
- package/dist/rest/Endpoints.d.ts +97 -0
- package/dist/rest/Endpoints.js +205 -0
- package/dist/rest/Endpoints.js.map +1 -0
- package/dist/rest/REST.d.ts +16 -0
- package/dist/rest/REST.js +55 -0
- package/dist/rest/REST.js.map +1 -0
- package/dist/rest/index.d.ts +2 -0
- package/dist/rest/index.js +32 -0
- package/dist/rest/index.js.map +1 -0
- package/dist/structures/Application.d.ts +250 -0
- package/dist/structures/Application.js +258 -0
- package/dist/structures/Application.js.map +1 -0
- package/dist/structures/ApplicationCommand.d.ts +68 -0
- package/dist/structures/ApplicationCommand.js +133 -0
- package/dist/structures/ApplicationCommand.js.map +1 -0
- package/dist/structures/AuditLogEntry.d.ts +16 -0
- package/dist/structures/AuditLogEntry.js +54 -0
- package/dist/structures/AuditLogEntry.js.map +1 -0
- package/dist/structures/AutoModerationRule.d.ts +29 -0
- package/dist/structures/AutoModerationRule.js +85 -0
- package/dist/structures/AutoModerationRule.js.map +1 -0
- package/dist/structures/Channel.d.ts +296 -0
- package/dist/structures/Channel.js +579 -0
- package/dist/structures/Channel.js.map +1 -0
- package/dist/structures/Guild.d.ts +452 -0
- package/dist/structures/Guild.js +1161 -0
- package/dist/structures/Guild.js.map +1 -0
- package/dist/structures/GuildMember.d.ts +46 -0
- package/dist/structures/GuildMember.js +126 -0
- package/dist/structures/GuildMember.js.map +1 -0
- package/dist/structures/GuildScheduledEvent.d.ts +45 -0
- package/dist/structures/GuildScheduledEvent.js +115 -0
- package/dist/structures/GuildScheduledEvent.js.map +1 -0
- package/dist/structures/GuildTemplate.d.ts +25 -0
- package/dist/structures/GuildTemplate.js +80 -0
- package/dist/structures/GuildTemplate.js.map +1 -0
- package/dist/structures/Integration.d.ts +28 -0
- package/dist/structures/Integration.js +96 -0
- package/dist/structures/Integration.js.map +1 -0
- package/dist/structures/Interaction.d.ts +204 -0
- package/dist/structures/Interaction.js +368 -0
- package/dist/structures/Interaction.js.map +1 -0
- package/dist/structures/Invite.d.ts +22 -0
- package/dist/structures/Invite.js +108 -0
- package/dist/structures/Invite.js.map +1 -0
- package/dist/structures/Message.d.ts +97 -0
- package/dist/structures/Message.js +327 -0
- package/dist/structures/Message.js.map +1 -0
- package/dist/structures/Role.d.ts +35 -0
- package/dist/structures/Role.js +81 -0
- package/dist/structures/Role.js.map +1 -0
- package/dist/structures/StageInstance.d.ts +20 -0
- package/dist/structures/StageInstance.js +53 -0
- package/dist/structures/StageInstance.js.map +1 -0
- package/dist/structures/User.d.ts +53 -0
- package/dist/structures/User.js +168 -0
- package/dist/structures/User.js.map +1 -0
- package/dist/structures/Webhook.d.ts +133 -0
- package/dist/structures/Webhook.js +189 -0
- package/dist/structures/Webhook.js.map +1 -0
- package/dist/structures/index.d.ts +17 -0
- package/dist/structures/index.js +34 -0
- package/dist/structures/index.js.map +1 -0
- package/dist/types/application-command.d.ts +97 -0
- package/dist/types/application-command.js +3 -0
- package/dist/types/application-command.js.map +1 -0
- package/dist/types/application-role-connection-metadata.d.ts +17 -0
- package/dist/types/application-role-connection-metadata.js +3 -0
- package/dist/types/application-role-connection-metadata.js.map +1 -0
- package/dist/types/application.d.ts +55 -0
- package/dist/types/application.js +3 -0
- package/dist/types/application.js.map +1 -0
- package/dist/types/audit-log.d.ts +77 -0
- package/dist/types/audit-log.js +3 -0
- package/dist/types/audit-log.js.map +1 -0
- package/dist/types/auto-moderation.d.ts +61 -0
- package/dist/types/auto-moderation.js +3 -0
- package/dist/types/auto-moderation.js.map +1 -0
- package/dist/types/channel.d.ts +411 -0
- package/dist/types/channel.js +3 -0
- package/dist/types/channel.js.map +1 -0
- package/dist/types/emoji.d.ts +22 -0
- package/dist/types/emoji.js +3 -0
- package/dist/types/emoji.js.map +1 -0
- package/dist/types/gateway-events.d.ts +53 -0
- package/dist/types/gateway-events.js +3 -0
- package/dist/types/gateway-events.js.map +1 -0
- package/dist/types/guild-scheduled-event.d.ts +55 -0
- package/dist/types/guild-scheduled-event.js +3 -0
- package/dist/types/guild-scheduled-event.js.map +1 -0
- package/dist/types/guild-template.d.ts +28 -0
- package/dist/types/guild-template.js +3 -0
- package/dist/types/guild-template.js.map +1 -0
- package/dist/types/guild.d.ts +305 -0
- package/dist/types/guild.js +3 -0
- package/dist/types/guild.js.map +1 -0
- package/dist/types/index.d.ts +22 -0
- package/dist/types/index.js +39 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/interaction.d.ts +141 -0
- package/dist/types/interaction.js +3 -0
- package/dist/types/interaction.js.map +1 -0
- package/dist/types/invite.d.ts +56 -0
- package/dist/types/invite.js +3 -0
- package/dist/types/invite.js.map +1 -0
- package/dist/types/message-components.d.ts +76 -0
- package/dist/types/message-components.js +3 -0
- package/dist/types/message-components.js.map +1 -0
- package/dist/types/oauth2.d.ts +14 -0
- package/dist/types/oauth2.js +3 -0
- package/dist/types/oauth2.js.map +1 -0
- package/dist/types/role.d.ts +42 -0
- package/dist/types/role.js +3 -0
- package/dist/types/role.js.map +1 -0
- package/dist/types/stage-instance.d.ts +18 -0
- package/dist/types/stage-instance.js +3 -0
- package/dist/types/stage-instance.js.map +1 -0
- package/dist/types/sticker.d.ts +59 -0
- package/dist/types/sticker.js +3 -0
- package/dist/types/sticker.js.map +1 -0
- package/dist/types/team.d.ts +28 -0
- package/dist/types/team.js +3 -0
- package/dist/types/team.js.map +1 -0
- package/dist/types/user.d.ts +73 -0
- package/dist/types/user.js +3 -0
- package/dist/types/user.js.map +1 -0
- package/dist/types/voice.d.ts +46 -0
- package/dist/types/voice.js +3 -0
- package/dist/types/voice.js.map +1 -0
- package/dist/types/webhook.d.ts +31 -0
- package/dist/types/webhook.js +3 -0
- package/dist/types/webhook.js.map +1 -0
- package/dist/utils/constants.d.ts +963 -0
- package/dist/utils/constants.js +1147 -0
- package/dist/utils/constants.js.map +1 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.js +19 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/rawers.d.ts +467 -0
- package/dist/utils/rawers.js +295 -0
- package/dist/utils/rawers.js.map +1 -0
- package/package.json +27 -0
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Role = void 0;
|
|
4
|
+
const rest_1 = require("../rest");
|
|
5
|
+
class Role {
|
|
6
|
+
client;
|
|
7
|
+
id;
|
|
8
|
+
name;
|
|
9
|
+
color;
|
|
10
|
+
hoist;
|
|
11
|
+
icon;
|
|
12
|
+
unicodeEmoji;
|
|
13
|
+
position;
|
|
14
|
+
permissions;
|
|
15
|
+
managed;
|
|
16
|
+
mentionable;
|
|
17
|
+
tags;
|
|
18
|
+
guildId;
|
|
19
|
+
constructor(data, client) {
|
|
20
|
+
this.client = client;
|
|
21
|
+
this.id = data.id;
|
|
22
|
+
this.name = data.name;
|
|
23
|
+
this.color = data.color;
|
|
24
|
+
this.hoist = data.hoist;
|
|
25
|
+
this.position = data.position;
|
|
26
|
+
this.permissions = data.permissions;
|
|
27
|
+
this.managed = data.managed;
|
|
28
|
+
this.mentionable = data.mentionable;
|
|
29
|
+
this.update(data);
|
|
30
|
+
}
|
|
31
|
+
update(data) {
|
|
32
|
+
if (data.icon !== undefined)
|
|
33
|
+
this.icon = data.icon;
|
|
34
|
+
if (data.unicode_emoji !== undefined)
|
|
35
|
+
this.unicodeEmoji = data.unicode_emoji;
|
|
36
|
+
if (data.tags !== undefined)
|
|
37
|
+
this.tags = {
|
|
38
|
+
botId: data.tags.bot_id,
|
|
39
|
+
integrationId: data.tags.integration_id,
|
|
40
|
+
premiumSubscriber: data.tags.premium_subscriber,
|
|
41
|
+
subscriptionListingId: data.tags.subscription_listing_id,
|
|
42
|
+
availableForPurchase: data.tags.available_for_purchase,
|
|
43
|
+
guildConnections: data.tags.guild_connections,
|
|
44
|
+
};
|
|
45
|
+
if (data.guild_id !== undefined)
|
|
46
|
+
this.guildId = data.guild_id;
|
|
47
|
+
}
|
|
48
|
+
/* https://discord.com/developers/docs/resources/guild#modify-guild-role */
|
|
49
|
+
async modify(options, reason) {
|
|
50
|
+
return new Role(await this.client.rest.request("PATCH", rest_1.Endpoints.guildRole(this.guildId, this.id), {
|
|
51
|
+
json: {
|
|
52
|
+
name: options?.name,
|
|
53
|
+
permissions: options?.permissions,
|
|
54
|
+
color: options?.color,
|
|
55
|
+
hoist: options?.hoist,
|
|
56
|
+
icon: options?.icon,
|
|
57
|
+
unicode_emoji: options?.unicodeEmoji,
|
|
58
|
+
mentionable: options?.mentionable,
|
|
59
|
+
},
|
|
60
|
+
reason,
|
|
61
|
+
}), this.client);
|
|
62
|
+
}
|
|
63
|
+
toJSON() {
|
|
64
|
+
return {
|
|
65
|
+
id: this.id,
|
|
66
|
+
name: this.name,
|
|
67
|
+
color: this.color,
|
|
68
|
+
hoist: this.hoist,
|
|
69
|
+
icon: this.icon,
|
|
70
|
+
unicodeEmoji: this.unicodeEmoji,
|
|
71
|
+
position: this.position,
|
|
72
|
+
permissions: this.permissions,
|
|
73
|
+
managed: this.managed,
|
|
74
|
+
mentionable: this.mentionable,
|
|
75
|
+
tags: this.tags,
|
|
76
|
+
guildId: this.guildId,
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
exports.Role = Role;
|
|
81
|
+
//# sourceMappingURL=Role.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Role.js","sourceRoot":"","sources":["../../src/structures/Role.ts"],"names":[],"mappings":";;;AACA,kCAAoC;AAGpC,MAAa,IAAI;IACP,MAAM,CAA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WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,OAAO,EAAE,IAAI,CAAC,OAAO;SACtB,CAAC;IACJ,CAAC;CACF;AA/FD,oBA+FC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Client } from "../class";
|
|
2
|
+
import type { JSONStageInstance, RawStageInstance } from "../types";
|
|
3
|
+
import type { PrivacyLevel } from "../utils";
|
|
4
|
+
export declare class StageInstance {
|
|
5
|
+
private client;
|
|
6
|
+
id: string;
|
|
7
|
+
guildId: string;
|
|
8
|
+
channelId: string;
|
|
9
|
+
topic: string;
|
|
10
|
+
privacyLevel: number;
|
|
11
|
+
discoverableDisabled: boolean;
|
|
12
|
+
guildScheduledEventId: string | null;
|
|
13
|
+
constructor(data: RawStageInstance, client: Client);
|
|
14
|
+
modify(options: {
|
|
15
|
+
topic?: string;
|
|
16
|
+
privacyLevel?: PrivacyLevel;
|
|
17
|
+
}, reason?: string): Promise<StageInstance>;
|
|
18
|
+
delete(reason?: string): Promise<void>;
|
|
19
|
+
toJSON(): JSONStageInstance;
|
|
20
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.StageInstance = void 0;
|
|
4
|
+
const rest_1 = require("../rest");
|
|
5
|
+
class StageInstance {
|
|
6
|
+
client;
|
|
7
|
+
id;
|
|
8
|
+
guildId;
|
|
9
|
+
channelId;
|
|
10
|
+
topic;
|
|
11
|
+
privacyLevel;
|
|
12
|
+
discoverableDisabled;
|
|
13
|
+
guildScheduledEventId;
|
|
14
|
+
constructor(data, client) {
|
|
15
|
+
this.client = client;
|
|
16
|
+
this.id = data.id;
|
|
17
|
+
this.guildId = data.guild_id;
|
|
18
|
+
this.channelId = data.channel_id;
|
|
19
|
+
this.topic = data.topic;
|
|
20
|
+
this.privacyLevel = data.privacy_level;
|
|
21
|
+
this.discoverableDisabled = data.discoverable_disabled;
|
|
22
|
+
this.guildScheduledEventId = data.guild_scheduled_event_id;
|
|
23
|
+
}
|
|
24
|
+
/* https://discord.com/developers/docs/resources/stage-instance#modify-stage-instance */
|
|
25
|
+
async modify(options, reason) {
|
|
26
|
+
return new StageInstance(await this.client.rest.request("PATCH", rest_1.Endpoints.stageInstance(this.channelId), {
|
|
27
|
+
json: {
|
|
28
|
+
topic: options?.topic,
|
|
29
|
+
privacy_level: options?.privacyLevel,
|
|
30
|
+
},
|
|
31
|
+
reason,
|
|
32
|
+
}), this.client);
|
|
33
|
+
}
|
|
34
|
+
/* https://discord.com/developers/docs/resources/stage-instance#delete-stage-instance */
|
|
35
|
+
async delete(reason) {
|
|
36
|
+
this.client.rest.request("DELETE", rest_1.Endpoints.stageInstance(this.channelId), {
|
|
37
|
+
reason,
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
toJSON() {
|
|
41
|
+
return {
|
|
42
|
+
id: this.id,
|
|
43
|
+
guildId: this.guildId,
|
|
44
|
+
channelId: this.channelId,
|
|
45
|
+
topic: this.topic,
|
|
46
|
+
privacyLevel: this.privacyLevel,
|
|
47
|
+
discoverableDisabled: this.discoverableDisabled,
|
|
48
|
+
guildScheduledEventId: this.guildScheduledEventId,
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
exports.StageInstance = StageInstance;
|
|
53
|
+
//# sourceMappingURL=StageInstance.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StageInstance.js","sourceRoot":"","sources":["../../src/structures/StageInstance.ts"],"names":[],"mappings":";;;AACA,kCAAoC;AAIpC,MAAa,aAAa;IAChB,MAAM,CAAU;IACjB,EAAE,CAAS;IACX,OAAO,CAAS;IAChB,SAAS,CAAS;IAClB,KAAK,CAAS;IACd,YAAY,CAAS;IACrB,oBAAoB,CAAU;IAC9B,qBAAqB,CAAgB;IAE5C,YAAY,IAAsB,EAAE,MAAc;QAChD,IA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oBAAoB,EAAE,IAAI,CAAC,oBAAoB;YAC/C,qBAAqB,EAAE,IAAI,CAAC,qBAAqB;SAClD,CAAC;IACJ,CAAC;CACF;AAnED,sCAmEC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { Channel, GuildMember } from ".";
|
|
2
|
+
import type { Client } from "../class";
|
|
3
|
+
import type { JSONApplicationRoleConnection, JSONConnection, JSONUser, RawUser } from "../types";
|
|
4
|
+
import type { ApplicationRoleConnectionMetadataType, Locale, UserFlags } from "../utils";
|
|
5
|
+
export declare class User {
|
|
6
|
+
private client;
|
|
7
|
+
id: string;
|
|
8
|
+
username: string;
|
|
9
|
+
discriminator: string;
|
|
10
|
+
avatar: string;
|
|
11
|
+
globalName: string | null;
|
|
12
|
+
bot?: boolean;
|
|
13
|
+
system?: boolean;
|
|
14
|
+
mfaEnabled?: boolean;
|
|
15
|
+
banner?: string;
|
|
16
|
+
accentColor?: number;
|
|
17
|
+
locale?: string;
|
|
18
|
+
verified?: boolean;
|
|
19
|
+
email?: string;
|
|
20
|
+
flags?: UserFlags;
|
|
21
|
+
premiumType?: number;
|
|
22
|
+
publicFlags?: UserFlags;
|
|
23
|
+
constructor(data: RawUser, client: Client);
|
|
24
|
+
protected update(data: RawUser): void;
|
|
25
|
+
modifyCurrentUser(options: {
|
|
26
|
+
username?: string;
|
|
27
|
+
avatar?: string | null;
|
|
28
|
+
}): Promise<User>;
|
|
29
|
+
getCurrentUserGuildMember(guildId: string): Promise<GuildMember>;
|
|
30
|
+
leaveGuild(guildId: string): Promise<void>;
|
|
31
|
+
createDM(options: {
|
|
32
|
+
recipientId: string;
|
|
33
|
+
}): Promise<Channel>;
|
|
34
|
+
createGroupDM(options: {
|
|
35
|
+
accessTokens: Array<string>;
|
|
36
|
+
nicks: Array<string>;
|
|
37
|
+
}): Promise<Channel>;
|
|
38
|
+
getUserConnections(): Promise<Array<JSONConnection>>;
|
|
39
|
+
getUserApplicationRoleConnection(): Promise<JSONApplicationRoleConnection>;
|
|
40
|
+
updateUserApplicationRoleConnection(options: {
|
|
41
|
+
platformName?: string;
|
|
42
|
+
platformUsername?: string;
|
|
43
|
+
metadata?: {
|
|
44
|
+
type: ApplicationRoleConnectionMetadataType;
|
|
45
|
+
key: string;
|
|
46
|
+
name: string;
|
|
47
|
+
nameLocalizations?: Partial<Record<Locale, string>> | null;
|
|
48
|
+
description: string;
|
|
49
|
+
descriptionLocalizations?: Partial<Record<Locale, string>> | null;
|
|
50
|
+
};
|
|
51
|
+
}): Promise<JSONApplicationRoleConnection>;
|
|
52
|
+
toJSON(): JSONUser;
|
|
53
|
+
}
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.User = void 0;
|
|
4
|
+
const _1 = require(".");
|
|
5
|
+
const rest_1 = require("../rest");
|
|
6
|
+
class User {
|
|
7
|
+
client;
|
|
8
|
+
id;
|
|
9
|
+
username;
|
|
10
|
+
discriminator;
|
|
11
|
+
avatar;
|
|
12
|
+
globalName;
|
|
13
|
+
bot;
|
|
14
|
+
system;
|
|
15
|
+
mfaEnabled;
|
|
16
|
+
banner;
|
|
17
|
+
accentColor;
|
|
18
|
+
locale;
|
|
19
|
+
verified;
|
|
20
|
+
email;
|
|
21
|
+
flags;
|
|
22
|
+
premiumType;
|
|
23
|
+
publicFlags;
|
|
24
|
+
constructor(data, client) {
|
|
25
|
+
this.client = client;
|
|
26
|
+
this.id = data.id;
|
|
27
|
+
this.username = data.username;
|
|
28
|
+
this.discriminator = data.discriminator;
|
|
29
|
+
this.globalName = data.global_name;
|
|
30
|
+
this.avatar = data.avatar;
|
|
31
|
+
this.update(data);
|
|
32
|
+
}
|
|
33
|
+
update(data) {
|
|
34
|
+
if (data.bot !== undefined)
|
|
35
|
+
this.bot = data.bot;
|
|
36
|
+
if (data.system !== undefined)
|
|
37
|
+
this.system = data.system;
|
|
38
|
+
if (data.mfa_enabled !== undefined)
|
|
39
|
+
this.mfaEnabled = data.mfa_enabled;
|
|
40
|
+
if (data.banner !== undefined)
|
|
41
|
+
this.banner = data.banner;
|
|
42
|
+
if (data.accent_color !== undefined)
|
|
43
|
+
this.accentColor = data.accent_color;
|
|
44
|
+
if (data.locale !== undefined)
|
|
45
|
+
this.locale = data.locale;
|
|
46
|
+
if (data.verified !== undefined)
|
|
47
|
+
this.verified = data.verified;
|
|
48
|
+
if (data.email !== undefined)
|
|
49
|
+
this.email = data.email;
|
|
50
|
+
if (data.flags !== undefined)
|
|
51
|
+
this.flags = data.flags;
|
|
52
|
+
if (data.premium_type !== undefined)
|
|
53
|
+
this.premiumType = data.premium_type;
|
|
54
|
+
if (data.public_flags !== undefined)
|
|
55
|
+
this.publicFlags = data.public_flags;
|
|
56
|
+
}
|
|
57
|
+
/* https://discord.com/developers/docs/resources/user#modify-current-user */
|
|
58
|
+
async modifyCurrentUser(options) {
|
|
59
|
+
return new User(await this.client.rest.request("PATCH", rest_1.Endpoints.user(), {
|
|
60
|
+
json: {
|
|
61
|
+
username: options?.username,
|
|
62
|
+
avatar: options?.avatar,
|
|
63
|
+
},
|
|
64
|
+
}), this.client);
|
|
65
|
+
}
|
|
66
|
+
/* https://discord.com/developers/docs/resources/user#get-current-user-guild-member */
|
|
67
|
+
async getCurrentUserGuildMember(guildId) {
|
|
68
|
+
return new _1.GuildMember(await this.client.rest.request("GET", rest_1.Endpoints.guildMember(guildId)), this.client);
|
|
69
|
+
}
|
|
70
|
+
/* https://discord.com/developers/docs/resources/user#leave-guild */
|
|
71
|
+
async leaveGuild(guildId) {
|
|
72
|
+
this.client.rest.request("DELETE", rest_1.Endpoints.userGuild(guildId));
|
|
73
|
+
}
|
|
74
|
+
/* https://discord.com/developers/docs/resources/user#create-dm */
|
|
75
|
+
async createDM(options) {
|
|
76
|
+
return new _1.Channel(await this.client.rest.request("POST", rest_1.Endpoints.userChannels(), {
|
|
77
|
+
json: {
|
|
78
|
+
recipient_id: options.recipientId,
|
|
79
|
+
},
|
|
80
|
+
}), this.client);
|
|
81
|
+
}
|
|
82
|
+
/* https://discord.com/developers/docs/resources/user#create-group-dm */
|
|
83
|
+
async createGroupDM(options) {
|
|
84
|
+
return new _1.Channel(await this.client.rest.request("POST", rest_1.Endpoints.userChannels(), {
|
|
85
|
+
json: {
|
|
86
|
+
access_tokens: options.accessTokens,
|
|
87
|
+
nicks: options.nicks,
|
|
88
|
+
},
|
|
89
|
+
}), this.client);
|
|
90
|
+
}
|
|
91
|
+
/* https://discord.com/developers/docs/resources/user#get-user-connections */
|
|
92
|
+
async getUserConnections() {
|
|
93
|
+
return this.client.rest
|
|
94
|
+
.request("GET", rest_1.Endpoints.userConnections())
|
|
95
|
+
.then((response) => response.map((data) => ({
|
|
96
|
+
id: data.id,
|
|
97
|
+
name: data.name,
|
|
98
|
+
type: data.type,
|
|
99
|
+
revoked: data?.revoked,
|
|
100
|
+
integrations: data?.integrations?.map((integration) => new _1.Integration(integration, this.client)),
|
|
101
|
+
verified: data.verified,
|
|
102
|
+
friendSync: data.friend_sync,
|
|
103
|
+
showActivity: data.show_activity,
|
|
104
|
+
twoWayLink: data.two_way_link,
|
|
105
|
+
visibility: data.visibility,
|
|
106
|
+
})));
|
|
107
|
+
}
|
|
108
|
+
/* https://discord.com/developers/docs/resources/user#get-user-application-role-connection */
|
|
109
|
+
async getUserApplicationRoleConnection() {
|
|
110
|
+
const data = await this.client.rest.request("GET", rest_1.Endpoints.userApplicationRoleConnection((await this.client.getApplication()).id));
|
|
111
|
+
return {
|
|
112
|
+
platformName: data.platform_name,
|
|
113
|
+
platformUsername: data.platform_username,
|
|
114
|
+
metadata: {
|
|
115
|
+
type: data.metadata.type,
|
|
116
|
+
key: data.metadata.key,
|
|
117
|
+
name: data.metadata.name,
|
|
118
|
+
nameLocalizations: data.metadata?.name_localizations,
|
|
119
|
+
description: data.metadata.description,
|
|
120
|
+
descriptionLocalizations: data.metadata?.description_localizations,
|
|
121
|
+
},
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
/* https://discord.com/developers/docs/resources/user#update-user-application-role-connection */
|
|
125
|
+
async updateUserApplicationRoleConnection(options) {
|
|
126
|
+
const data = await this.client.rest.request("PUT", rest_1.Endpoints.userApplicationRoleConnection((await this.client.getApplication()).id), {
|
|
127
|
+
json: {
|
|
128
|
+
platform_name: options?.platformName,
|
|
129
|
+
platform_username: options?.platformUsername,
|
|
130
|
+
metadata: options?.metadata,
|
|
131
|
+
},
|
|
132
|
+
});
|
|
133
|
+
return {
|
|
134
|
+
platformName: data.platform_name,
|
|
135
|
+
platformUsername: data.platform_username,
|
|
136
|
+
metadata: {
|
|
137
|
+
type: data.metadata.type,
|
|
138
|
+
key: data.metadata.key,
|
|
139
|
+
name: data.metadata.name,
|
|
140
|
+
nameLocalizations: data.metadata?.name_localizations,
|
|
141
|
+
description: data.metadata.description,
|
|
142
|
+
descriptionLocalizations: data.metadata?.description_localizations,
|
|
143
|
+
},
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
toJSON() {
|
|
147
|
+
return {
|
|
148
|
+
id: this.id,
|
|
149
|
+
username: this.username,
|
|
150
|
+
discriminator: this.discriminator,
|
|
151
|
+
globalName: this.globalName,
|
|
152
|
+
avatar: this.avatar,
|
|
153
|
+
bot: this.bot,
|
|
154
|
+
system: this.system,
|
|
155
|
+
mfaEnabled: this.mfaEnabled,
|
|
156
|
+
banner: this.banner,
|
|
157
|
+
accentColor: this.accentColor,
|
|
158
|
+
locale: this.locale,
|
|
159
|
+
verified: this.verified,
|
|
160
|
+
email: this.email,
|
|
161
|
+
flags: this.flags,
|
|
162
|
+
premiumType: this.premiumType,
|
|
163
|
+
publicFlags: this.publicFlags,
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
exports.User = User;
|
|
168
|
+
//# sourceMappingURL=User.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"User.js","sourceRoot":"","sources":["../../src/structures/User.ts"],"names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AW,EAAE,IAAI,CAAC,WAAW;SAC9B,CAAC;IACJ,CAAC;CACF;AArND,oBAqNC"}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { Channel, Guild, Message, User } from ".";
|
|
2
|
+
import type { Client } from "../class";
|
|
3
|
+
import { File } from "../rest";
|
|
4
|
+
import type { JSONAllowedMentions, JSONAttachment, JSONEmbed, JSONEmoji, JSONSelectOption, JSONWebhook, RawWebhook } from "../types";
|
|
5
|
+
import { ChannelTypes, ComponentTypes, MessageFlags, WebhookTypes } from "../utils";
|
|
6
|
+
export declare class Webhook {
|
|
7
|
+
private client;
|
|
8
|
+
id: string;
|
|
9
|
+
type: WebhookTypes;
|
|
10
|
+
guildId?: string | null;
|
|
11
|
+
channelId: string | null;
|
|
12
|
+
user?: User;
|
|
13
|
+
name: string | null;
|
|
14
|
+
avatar: string | null;
|
|
15
|
+
token?: string;
|
|
16
|
+
applicationId: string | null;
|
|
17
|
+
sourceGuild?: Guild;
|
|
18
|
+
sourceChannel?: Channel;
|
|
19
|
+
url?: string;
|
|
20
|
+
constructor(data: RawWebhook, client: Client);
|
|
21
|
+
protected update(data: RawWebhook): void;
|
|
22
|
+
modifyWebhook(options: {
|
|
23
|
+
name?: string;
|
|
24
|
+
avatar?: string | null;
|
|
25
|
+
channelId?: string;
|
|
26
|
+
}, reason?: string): Promise<Webhook>;
|
|
27
|
+
modifyWithToken(token: string, options: {
|
|
28
|
+
name?: string;
|
|
29
|
+
avatar?: string | null;
|
|
30
|
+
}, reason?: string): Promise<Webhook>;
|
|
31
|
+
delete(reason?: string): Promise<void>;
|
|
32
|
+
deleteWithToken(token: string, reason?: string): Promise<void>;
|
|
33
|
+
execute(token: string, options: {
|
|
34
|
+
wait?: boolean;
|
|
35
|
+
threadId?: string;
|
|
36
|
+
content?: string | null;
|
|
37
|
+
username?: string;
|
|
38
|
+
avatarURL?: string;
|
|
39
|
+
tts?: boolean;
|
|
40
|
+
embeds?: Array<JSONEmbed> | null;
|
|
41
|
+
allowedMentions?: JSONAllowedMentions | null;
|
|
42
|
+
components?: Array<{
|
|
43
|
+
type: ComponentTypes.ActionRow;
|
|
44
|
+
components: Array<{
|
|
45
|
+
type: ComponentTypes.Button;
|
|
46
|
+
style: number;
|
|
47
|
+
label?: string;
|
|
48
|
+
emoji?: JSONEmoji;
|
|
49
|
+
customId?: string;
|
|
50
|
+
url?: string;
|
|
51
|
+
disabled?: boolean;
|
|
52
|
+
} | {
|
|
53
|
+
type: ComponentTypes.SelectMenu | ComponentTypes.ChannelSelect | ComponentTypes.MentionableSelect | ComponentTypes.RoleSelect | ComponentTypes.UserSelect;
|
|
54
|
+
customId: string;
|
|
55
|
+
options?: Array<JSONSelectOption>;
|
|
56
|
+
channelTypes?: Array<ChannelTypes>;
|
|
57
|
+
placeholder?: string;
|
|
58
|
+
minValues?: number;
|
|
59
|
+
maxValues?: number;
|
|
60
|
+
disabled?: boolean;
|
|
61
|
+
} | {
|
|
62
|
+
type: ComponentTypes.TextInput;
|
|
63
|
+
customId: string;
|
|
64
|
+
style: number;
|
|
65
|
+
label: string;
|
|
66
|
+
minLength?: number;
|
|
67
|
+
maxLength?: number;
|
|
68
|
+
required?: boolean;
|
|
69
|
+
value?: string;
|
|
70
|
+
placeholder?: string;
|
|
71
|
+
}>;
|
|
72
|
+
}> | null;
|
|
73
|
+
files?: Array<File> | null;
|
|
74
|
+
attachments?: Array<JSONAttachment> | null;
|
|
75
|
+
flags?: MessageFlags | null;
|
|
76
|
+
threadName?: string;
|
|
77
|
+
}): Promise<Message>;
|
|
78
|
+
executeSlackCompatible(token: string, options: {
|
|
79
|
+
threadId?: string;
|
|
80
|
+
wait?: boolean;
|
|
81
|
+
}): Promise<Message>;
|
|
82
|
+
executeGitHubCompatible(token: string, options: {
|
|
83
|
+
threadId?: string;
|
|
84
|
+
wait?: boolean;
|
|
85
|
+
}): Promise<Message>;
|
|
86
|
+
getMessage(token: string, messageId: string, options?: {
|
|
87
|
+
threadId?: string;
|
|
88
|
+
}): Promise<Message>;
|
|
89
|
+
editMessage(messageId: string, options: {
|
|
90
|
+
threadId?: string;
|
|
91
|
+
content?: string | null;
|
|
92
|
+
embeds?: Array<JSONEmbed> | null;
|
|
93
|
+
flags?: MessageFlags | null;
|
|
94
|
+
allowedMentions?: JSONAllowedMentions | null;
|
|
95
|
+
components?: Array<{
|
|
96
|
+
type: ComponentTypes.ActionRow;
|
|
97
|
+
components: Array<{
|
|
98
|
+
type: ComponentTypes.Button;
|
|
99
|
+
style: number;
|
|
100
|
+
label?: string;
|
|
101
|
+
emoji?: JSONEmoji;
|
|
102
|
+
customId?: string;
|
|
103
|
+
url?: string;
|
|
104
|
+
disabled?: boolean;
|
|
105
|
+
} | {
|
|
106
|
+
type: ComponentTypes.SelectMenu | ComponentTypes.ChannelSelect | ComponentTypes.MentionableSelect | ComponentTypes.RoleSelect | ComponentTypes.UserSelect;
|
|
107
|
+
customId: string;
|
|
108
|
+
options?: Array<JSONSelectOption>;
|
|
109
|
+
channelTypes?: Array<ChannelTypes>;
|
|
110
|
+
placeholder?: string;
|
|
111
|
+
minValues?: number;
|
|
112
|
+
maxValues?: number;
|
|
113
|
+
disabled?: boolean;
|
|
114
|
+
} | {
|
|
115
|
+
type: ComponentTypes.TextInput;
|
|
116
|
+
customId: string;
|
|
117
|
+
style: number;
|
|
118
|
+
label: string;
|
|
119
|
+
minLength?: number;
|
|
120
|
+
maxLength?: number;
|
|
121
|
+
required?: boolean;
|
|
122
|
+
value?: string;
|
|
123
|
+
placeholder?: string;
|
|
124
|
+
}>;
|
|
125
|
+
}> | null;
|
|
126
|
+
files?: Array<File> | null;
|
|
127
|
+
attachments?: Array<JSONAttachment> | null;
|
|
128
|
+
}): Promise<Message>;
|
|
129
|
+
deleteMessage(token: string, messageId: string, options?: {
|
|
130
|
+
threadId?: string;
|
|
131
|
+
}): Promise<void>;
|
|
132
|
+
toJSON(): JSONWebhook;
|
|
133
|
+
}
|