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,133 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ApplicationCommand = void 0;
|
|
4
|
+
const rest_1 = require("../rest");
|
|
5
|
+
const utils_1 = require("../utils");
|
|
6
|
+
class ApplicationCommand {
|
|
7
|
+
client;
|
|
8
|
+
id;
|
|
9
|
+
type;
|
|
10
|
+
applicationId;
|
|
11
|
+
guildId;
|
|
12
|
+
name;
|
|
13
|
+
nameLocalizations;
|
|
14
|
+
description;
|
|
15
|
+
descriptionLocalizations;
|
|
16
|
+
options;
|
|
17
|
+
defaultMemberPermissions;
|
|
18
|
+
dmPermission;
|
|
19
|
+
defaultPermission;
|
|
20
|
+
nsfw;
|
|
21
|
+
version;
|
|
22
|
+
constructor(data, client) {
|
|
23
|
+
this.client = client;
|
|
24
|
+
this.id = data.id;
|
|
25
|
+
this.applicationId = data.application_id;
|
|
26
|
+
this.name = data.name;
|
|
27
|
+
this.description = data.description;
|
|
28
|
+
this.defaultMemberPermissions = data.default_member_permissions;
|
|
29
|
+
this.version = data.version;
|
|
30
|
+
this.update(data);
|
|
31
|
+
}
|
|
32
|
+
update(data) {
|
|
33
|
+
if (data.type !== undefined)
|
|
34
|
+
this.type = data.type;
|
|
35
|
+
if (data.guild_id !== undefined)
|
|
36
|
+
this.guildId = data.guild_id;
|
|
37
|
+
if (data.name_localizations !== undefined)
|
|
38
|
+
this.nameLocalizations = data.name_localizations;
|
|
39
|
+
if (data.description_localizations !== undefined)
|
|
40
|
+
this.descriptionLocalizations = data.description_localizations;
|
|
41
|
+
if (data.options !== undefined)
|
|
42
|
+
this.options = data.options;
|
|
43
|
+
if (data.dm_permission !== undefined)
|
|
44
|
+
this.dmPermission = data.dm_permission;
|
|
45
|
+
if (data.default_permission !== undefined)
|
|
46
|
+
this.defaultPermission = data.default_permission;
|
|
47
|
+
if (data.nsfw !== undefined)
|
|
48
|
+
this.nsfw = data.nsfw;
|
|
49
|
+
}
|
|
50
|
+
/* https://discord.com/developers/docs/interactions/application-commands#edit-global-application-command */
|
|
51
|
+
async edit(options) {
|
|
52
|
+
return new ApplicationCommand(this.guildId !== undefined
|
|
53
|
+
? await this.client.rest.request("PATCH", rest_1.Endpoints.applicationGuildCommand(this.id, this.guildId, this.id), {
|
|
54
|
+
json: (0, utils_1.rawApplicationCommand)(options),
|
|
55
|
+
})
|
|
56
|
+
: await this.client.rest.request("PATCH", rest_1.Endpoints.applicationCommand(this.applicationId, this.id), {
|
|
57
|
+
json: (0, utils_1.rawApplicationCommand)(options),
|
|
58
|
+
}), this.client);
|
|
59
|
+
}
|
|
60
|
+
/* https://discord.com/developers/docs/interactions/application-commands#delete-guild-application-command */
|
|
61
|
+
async delete() {
|
|
62
|
+
this.guildId !== undefined
|
|
63
|
+
? await this.client.rest.request("DELETE", rest_1.Endpoints.applicationGuildCommand(this.applicationId, this.guildId, this.id))
|
|
64
|
+
: await this.client.rest.request("DELETE", rest_1.Endpoints.applicationCommand(this.applicationId, this.id));
|
|
65
|
+
}
|
|
66
|
+
/* https://discord.com/developers/docs/interactions/application-commands#get-application-command-permissions */
|
|
67
|
+
async getGuildApplicationCommandPermissions() {
|
|
68
|
+
if (!this.guildId)
|
|
69
|
+
throw new Error("[disgroove] Can't get the permissions of a global application command");
|
|
70
|
+
return this.client.rest
|
|
71
|
+
.request("GET", rest_1.Endpoints.applicationCommandPermissions(this.applicationId, this.guildId, this.id))
|
|
72
|
+
.then((response) => response.map((permissions) => ({
|
|
73
|
+
id: permissions.id,
|
|
74
|
+
applicationId: permissions.application_id,
|
|
75
|
+
guildId: permissions.guild_id,
|
|
76
|
+
permissions: permissions.permissions.map((permission) => ({
|
|
77
|
+
id: permission.id,
|
|
78
|
+
type: permission.type,
|
|
79
|
+
permission: permission.permission,
|
|
80
|
+
})),
|
|
81
|
+
})));
|
|
82
|
+
}
|
|
83
|
+
/* https://discord.com/developers/docs/interactions/application-commands#edit-application-command-permissions */
|
|
84
|
+
async editGuildApplicationPermissions(options) {
|
|
85
|
+
if (!this.guildId)
|
|
86
|
+
throw new Error("[disgroove] Can't edit the permissions of a global application command");
|
|
87
|
+
return this.client.rest
|
|
88
|
+
.request("PATCH", rest_1.Endpoints.applicationCommandPermissions(this.applicationId, this.guildId, this.id), {
|
|
89
|
+
json: {
|
|
90
|
+
permissions: options.permissions.map((option) => ({
|
|
91
|
+
id: option.id,
|
|
92
|
+
application_id: option.applicationId,
|
|
93
|
+
guild_id: option.guildId,
|
|
94
|
+
permissions: option.permissions.map((permission) => ({
|
|
95
|
+
id: permission.id,
|
|
96
|
+
type: permission.type,
|
|
97
|
+
permission: permission.permission,
|
|
98
|
+
})),
|
|
99
|
+
})),
|
|
100
|
+
},
|
|
101
|
+
})
|
|
102
|
+
.then((response) => response.map((permissions) => ({
|
|
103
|
+
id: permissions.id,
|
|
104
|
+
applicationId: permissions.application_id,
|
|
105
|
+
guildId: permissions.guild_id,
|
|
106
|
+
permissions: permissions.permissions.map((permission) => ({
|
|
107
|
+
id: permission.id,
|
|
108
|
+
type: permission.type,
|
|
109
|
+
permission: permission.permission,
|
|
110
|
+
})),
|
|
111
|
+
})));
|
|
112
|
+
}
|
|
113
|
+
toJSON() {
|
|
114
|
+
return {
|
|
115
|
+
id: this.id,
|
|
116
|
+
type: this.type,
|
|
117
|
+
applicationId: this.applicationId,
|
|
118
|
+
guildId: this.guildId,
|
|
119
|
+
name: this.name,
|
|
120
|
+
nameLocalizations: this.nameLocalizations,
|
|
121
|
+
description: this.description,
|
|
122
|
+
descriptionLocalizations: this.descriptionLocalizations,
|
|
123
|
+
options: this.options,
|
|
124
|
+
defaultMemberPermissions: this.defaultMemberPermissions,
|
|
125
|
+
dmPermission: this.dmPermission,
|
|
126
|
+
defaultPermission: this.defaultPermission,
|
|
127
|
+
nsfw: this.nsfw,
|
|
128
|
+
version: this.version,
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
exports.ApplicationCommand = ApplicationCommand;
|
|
133
|
+
//# sourceMappingURL=ApplicationCommand.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ApplicationCommand.js","sourceRoot":"","sources":["../../src/structures/ApplicationCommand.ts"],"names":[],"mappings":";;;AACA,kCAAoC;AASpC,oCAAiD;AAQjD,MAAa,kBAAkB;IACrB,MAAM,CAAU;IACjB,EAAE,CAAS;IACX,IAAI,CAA2B;IAC/B,aAAa,CAAS;IACtB,OAAO,CAAU;IACjB,IAAI,CAAS;IACb,iBAAiB,CAA0C;IAC3D,WAAW,CAAS;IACpB,wBAAwB,CAA0C;IAClE,OAAO,CAAuC;IAC9C,wBAAwB,CAAgB;IACxC,YAAY,CAAW;IACvB,iBAAiB,CAAkB;IACnC,IAAI,CAAW;IACf,OAAO,CAAS;IAEvB,YAAY,IAA2B,EAAE,MAAc;QACrD,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC;QAClB,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,cAAc,CAAC;QACzC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QACtB,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC;QACpC,IAAI,CAAC,wBAAwB,GAAG,IAAI,CAAC,0BAA0B,CAAC;QAChE,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;QAE5B,IAAI,CA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AAE,WAAW,CAAC,cAAc;YACzC,OAAO,EAAE,WAAW,CAAC,QAAQ;YAC7B,WAAW,EAAE,WAAW,CAAC,WAAW,CAAC,GAAG,CACtC,CAAC,UAA2C,EAAE,EAAE,CAAC,CAAC;gBAChD,EAAE,EAAE,UAAU,CAAC,EAAE;gBACjB,IAAI,EAAE,UAAU,CAAC,IAAI;gBACrB,UAAU,EAAE,UAAU,CAAC,UAAU;aAClC,CAAC,CACH;SACF,CAAC,CAAC,CACJ,CAAC;IACN,CAAC;IAEM,MAAM;QACX,OAAO;YACL,EAAE,EAAE,IAAI,CAAC,EAAE;YACX,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,aAAa,EAAE,IAAI,CAAC,aAAa;YACjC,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,iBAAiB,EAAE,IAAI,CAAC,iBAAiB;YACzC,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,wBAAwB,EAAE,IAAI,CAAC,wBAAwB;YACvD,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,wBAAwB,EAAE,IAAI,CAAC,wBAAwB;YACvD,YAAY,EAAE,IAAI,CAAC,YAAY;YAC/B,iBAAiB,EAAE,IAAI,CAAC,iBAAiB;YACzC,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,OAAO,EAAE,IAAI,CAAC,OAAO;SACtB,CAAC;IACJ,CAAC;CACF;AA9ND,gDA8NC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Client } from "../class";
|
|
2
|
+
import type { JSONAuditLogChange, JSONAuditLogEntry, JSONOptionalAuditLogEntryInfo, RawAuditLogEntry } from "../types";
|
|
3
|
+
import type { AuditLogEvents } from "../utils";
|
|
4
|
+
export declare class AuditLogEntry {
|
|
5
|
+
private client;
|
|
6
|
+
id: string;
|
|
7
|
+
targetId: string | null;
|
|
8
|
+
changes?: Array<JSONAuditLogChange>;
|
|
9
|
+
userId: string | null;
|
|
10
|
+
actionType: AuditLogEvents;
|
|
11
|
+
options?: JSONOptionalAuditLogEntryInfo;
|
|
12
|
+
reason?: string;
|
|
13
|
+
constructor(data: RawAuditLogEntry, client: Client);
|
|
14
|
+
protected update(data: RawAuditLogEntry): void;
|
|
15
|
+
toJSON(): JSONAuditLogEntry;
|
|
16
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AuditLogEntry = void 0;
|
|
4
|
+
class AuditLogEntry {
|
|
5
|
+
client;
|
|
6
|
+
id;
|
|
7
|
+
targetId;
|
|
8
|
+
changes;
|
|
9
|
+
userId;
|
|
10
|
+
actionType;
|
|
11
|
+
options;
|
|
12
|
+
reason;
|
|
13
|
+
constructor(data, client) {
|
|
14
|
+
this.client = client;
|
|
15
|
+
this.id = data.id;
|
|
16
|
+
this.targetId = data.target_id;
|
|
17
|
+
this.userId = data.user_id;
|
|
18
|
+
this.actionType = data.action_type;
|
|
19
|
+
this.update(data);
|
|
20
|
+
}
|
|
21
|
+
update(data) {
|
|
22
|
+
if (data.changes !== undefined)
|
|
23
|
+
this.changes = data.changes;
|
|
24
|
+
if (data.options !== undefined)
|
|
25
|
+
this.options = {
|
|
26
|
+
applicationId: data.options.application_id,
|
|
27
|
+
autoModerationRuleName: data.options.auto_moderation_rule_name,
|
|
28
|
+
autoModerationRuleTriggerType: data.options.auto_moderation_rule_trigger_type,
|
|
29
|
+
channelId: data.options.channel_id,
|
|
30
|
+
count: data.options.count,
|
|
31
|
+
deleteMemberDays: data.options.delete_member_days,
|
|
32
|
+
id: data.options.id,
|
|
33
|
+
membersRemoved: data.options.members_removed,
|
|
34
|
+
messageId: data.options.message_id,
|
|
35
|
+
roleName: data.options.role_name,
|
|
36
|
+
type: data.options.type,
|
|
37
|
+
};
|
|
38
|
+
if (data.reason !== undefined)
|
|
39
|
+
this.reason = data.reason;
|
|
40
|
+
}
|
|
41
|
+
toJSON() {
|
|
42
|
+
return {
|
|
43
|
+
targetId: this.targetId,
|
|
44
|
+
changes: this.changes,
|
|
45
|
+
userId: this.userId,
|
|
46
|
+
id: this.id,
|
|
47
|
+
actionType: this.actionType,
|
|
48
|
+
options: this.options,
|
|
49
|
+
reason: this.reason,
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
exports.AuditLogEntry = AuditLogEntry;
|
|
54
|
+
//# sourceMappingURL=AuditLogEntry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuditLogEntry.js","sourceRoot":"","sources":["../../src/structures/AuditLogEntry.ts"],"names":[],"mappings":";;;AASA,MAAa,aAAa;IAChB,MAAM,CAAU;IACjB,EAAE,CAAS;IACX,QAAQ,CAAgB;IACxB,OAAO,CAA6B;IACpC,MAAM,CAAgB;IACtB,UAAU,CAAiB;IAC3B,OAAO,CAAiC;IACxC,MAAM,CAAU;IAEvB,YAAY,IAAsB,EAAE,MAAc;QAChD,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC;QAClB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC;QAC/B,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC;QAC3B,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,WAAW,CAAC;QAEnC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACpB,CAAC;IAES,MAAM,CAAC,IAAsB;QACrC,IAAI,IAAI,CAAC,OAAO,KAAK,SAAS;YAAE,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;QAC5D,IAAI,IAAI,CAAC,OAAO,KAAK,SAAS;YAC5B,IAAI,CAAC,OAAO,GAAG;gBACb,aAAa,EAAE,IAAI,CAAC,OAAO,CAAC,cAAc;gBAC1C,sBAAsB,EAAE,IAAI,CAAC,OAAO,CAAC,yBAAyB;gBAC9D,6BAA6B,EAC3B,IAAI,CAAC,OAAO,CAAC,iCAAiC;gBAChD,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,UAAU;gBAClC,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,KAAK;gBACzB,gBAAgB,EAAE,IAAI,CAAC,OAAO,CAAC,kBAAkB;gBACjD,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,EAAE;gBACnB,cAAc,EAAE,IAAI,CAAC,OAAO,CAAC,eAAe;gBAC5C,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,UAAU;gBAClC,QAAQ,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS;gBAChC,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI;aACxB,CAAC;QACJ,IAAI,IAAI,CAAC,MAAM,KAAK,SAAS;YAAE,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;IAC3D,CAAC;IAEM,MAAM;QACX,OAAO;YACL,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,EAAE,EAAE,IAAI,CAAC,EAAE;YACX,UAAU,EAAE,IAAI,CAAC,UAAU;YAC3B,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,MAAM,EAAE,IAAI,CAAC,MAAM;SACpB,CAAC;IACJ,CAAC;CACF;AAnDD,sCAmDC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { Client } from "../class";
|
|
2
|
+
import type { JSONAutoModerationAction, JSONAutoModerationRule, RawAutoModerationRule } from "../types";
|
|
3
|
+
export declare class AutoModerationRule {
|
|
4
|
+
private client;
|
|
5
|
+
id: string;
|
|
6
|
+
guildId: string;
|
|
7
|
+
name: string;
|
|
8
|
+
creatorId: string;
|
|
9
|
+
eventType: number;
|
|
10
|
+
triggerType: number;
|
|
11
|
+
triggerMetadata: object;
|
|
12
|
+
actions: Array<JSONAutoModerationAction>;
|
|
13
|
+
enabled: boolean;
|
|
14
|
+
exemptRoles: Array<string>;
|
|
15
|
+
exemptChannels: Array<string>;
|
|
16
|
+
constructor(data: RawAutoModerationRule, client: Client);
|
|
17
|
+
modify(options: {
|
|
18
|
+
name?: string;
|
|
19
|
+
eventType?: number;
|
|
20
|
+
triggerType?: number;
|
|
21
|
+
triggerMetadata?: object;
|
|
22
|
+
actions?: Array<JSONAutoModerationAction>;
|
|
23
|
+
enabled?: boolean;
|
|
24
|
+
exemptRoles?: Array<string>;
|
|
25
|
+
exemptChannels?: Array<string>;
|
|
26
|
+
}, reason?: string): Promise<AutoModerationRule>;
|
|
27
|
+
delete(reason?: string): Promise<void>;
|
|
28
|
+
toJSON(): JSONAutoModerationRule;
|
|
29
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AutoModerationRule = void 0;
|
|
4
|
+
const rest_1 = require("../rest");
|
|
5
|
+
class AutoModerationRule {
|
|
6
|
+
client;
|
|
7
|
+
id;
|
|
8
|
+
guildId;
|
|
9
|
+
name;
|
|
10
|
+
creatorId;
|
|
11
|
+
eventType;
|
|
12
|
+
triggerType;
|
|
13
|
+
triggerMetadata;
|
|
14
|
+
actions;
|
|
15
|
+
enabled;
|
|
16
|
+
exemptRoles;
|
|
17
|
+
exemptChannels;
|
|
18
|
+
constructor(data, client) {
|
|
19
|
+
this.client = client;
|
|
20
|
+
this.id = data.id;
|
|
21
|
+
this.guildId = data.guild_id;
|
|
22
|
+
this.name = data.name;
|
|
23
|
+
this.creatorId = data.creator_id;
|
|
24
|
+
this.eventType = data.event_type;
|
|
25
|
+
this.triggerType = data.trigger_type;
|
|
26
|
+
this.triggerMetadata = data.trigger_metadata;
|
|
27
|
+
this.actions = data.actions.map((action) => ({
|
|
28
|
+
type: action.type,
|
|
29
|
+
metadata: {
|
|
30
|
+
channelId: action.metadata?.channel_id,
|
|
31
|
+
durationSeconds: action.metadata?.duration_seconds,
|
|
32
|
+
customMessage: action.metadata?.custom_message,
|
|
33
|
+
},
|
|
34
|
+
}));
|
|
35
|
+
this.enabled = data.enabled;
|
|
36
|
+
this.exemptRoles = data.exempt_roles;
|
|
37
|
+
this.exemptChannels = data.exempt_channels;
|
|
38
|
+
}
|
|
39
|
+
/* https://discord.com/developers/docs/resources/auto-moderation#modify-auto-moderation-rule */
|
|
40
|
+
async modify(options, reason) {
|
|
41
|
+
return new AutoModerationRule(await this.client.rest.request("PATCH", rest_1.Endpoints.guildAutoModerationRule(this.guildId, this.id), {
|
|
42
|
+
json: {
|
|
43
|
+
name: options?.name,
|
|
44
|
+
event_type: options?.eventType,
|
|
45
|
+
trigger_type: options?.triggerType,
|
|
46
|
+
trigger_metadata: options?.triggerMetadata,
|
|
47
|
+
actions: options?.actions?.map((action) => ({
|
|
48
|
+
type: action.type,
|
|
49
|
+
metadata: {
|
|
50
|
+
channelId: action.metadata?.channelId,
|
|
51
|
+
durationSeconds: action.metadata?.durationSeconds,
|
|
52
|
+
customMessage: action.metadata?.customMessage,
|
|
53
|
+
},
|
|
54
|
+
})),
|
|
55
|
+
enabled: options?.enabled,
|
|
56
|
+
exempt_roles: options?.exemptRoles,
|
|
57
|
+
exempt_channels: options?.exemptChannels,
|
|
58
|
+
},
|
|
59
|
+
reason,
|
|
60
|
+
}), this.client);
|
|
61
|
+
}
|
|
62
|
+
/* https://discord.com/developers/docs/resources/auto-moderation#delete-auto-moderation-rule */
|
|
63
|
+
async delete(reason) {
|
|
64
|
+
await this.client.rest.request("DELETE", rest_1.Endpoints.guildAutoModerationRule(this.guildId, this.id), {
|
|
65
|
+
reason,
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
toJSON() {
|
|
69
|
+
return {
|
|
70
|
+
id: this.id,
|
|
71
|
+
guildId: this.guildId,
|
|
72
|
+
name: this.name,
|
|
73
|
+
creatorId: this.creatorId,
|
|
74
|
+
eventType: this.eventType,
|
|
75
|
+
triggerType: this.triggerType,
|
|
76
|
+
triggerMetadata: this.triggerMetadata,
|
|
77
|
+
actions: this.actions,
|
|
78
|
+
enabled: this.enabled,
|
|
79
|
+
exemptRoles: this.exemptRoles,
|
|
80
|
+
exemptChannels: this.exemptChannels,
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
exports.AutoModerationRule = AutoModerationRule;
|
|
85
|
+
//# sourceMappingURL=AutoModerationRule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AutoModerationRule.js","sourceRoot":"","sources":["../../src/structures/AutoModerationRule.ts"],"names":[],"mappings":";;;AACA,kCAAoC;AAOpC,MAAa,kBAAkB;IACrB,MAAM,CAAU;IACjB,EAAE,CAAS;IACX,OAAO,CAAS;IAChB,IAAI,CAAS;IACb,SAAS,CAAS;IAClB,SAAS,CAAS;IAClB,WAAW,CAAS;IACpB,eAAe,CAAS;IACxB,OAAO,CAAkC;IACzC,OAAO,CAAU;IACjB,WAAW,CAAgB;IAC3B,cAAc,CAAgB;IAErC,YAAY,IAA2B,EAAE,MAAc;QACrD,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC;QAClB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC7B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QACtB,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,UAAU,CAAC;QACjC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,UAAU,CAAC;QACjC,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,YAAY,CAAC;QACrC,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,gBAAgB,CAAC;QAC7C,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM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AE,OAAO,EAAE,WAAW;gBAClC,eAAe,EAAE,OAAO,EAAE,cAAc;aACzC;YACD,MAAM;SACP,CACF,EACD,IAAI,CAAC,MAAM,CACZ,CAAC;IACJ,CAAC;IAED,+FAA+F;IACxF,KAAK,CAAC,MAAM,CAAC,MAAe;QACjC,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAC5B,QAAQ,EACR,gBAAS,CAAC,uBAAuB,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,EAAE,CAAC,EACxD;YACE,MAAM;SACP,CACF,CAAC;IACJ,CAAC;IAEM,MAAM;QACX,OAAO;YACL,EAAE,EAAE,IAAI,CAAC,EAAE;YACX,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,eAAe,EAAE,IAAI,CAAC,eAAe;YACrC,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,cAAc,EAAE,IAAI,CAAC,cAAc;SACpC,CAAC;IACJ,CAAC;CACF;AAzGD,gDAyGC"}
|
|
@@ -0,0 +1,296 @@
|
|
|
1
|
+
import { Invite, Message, User, Webhook } from ".";
|
|
2
|
+
import type { Client } from "../class";
|
|
3
|
+
import { File } from "../rest";
|
|
4
|
+
import type { JSONAllowedMentions, JSONAttachment, JSONChannel, JSONDefaultReaction, JSONEmbed, JSONEmoji, JSONFollowedChannel, JSONForumTag, JSONMessageReference, JSONOverwrite, JSONSelectOption, JSONThreadMember, JSONThreadMetadata, RawChannel } from "../types";
|
|
5
|
+
import { ChannelTypes, ComponentTypes, InviteTargetTypes, MessageFlags } from "../utils";
|
|
6
|
+
export declare class Channel {
|
|
7
|
+
private client;
|
|
8
|
+
id: string;
|
|
9
|
+
type: ChannelTypes;
|
|
10
|
+
guildId?: string;
|
|
11
|
+
position?: number;
|
|
12
|
+
permissionOverwrites?: Array<JSONOverwrite>;
|
|
13
|
+
name?: string | null;
|
|
14
|
+
topic?: string | null;
|
|
15
|
+
nsfw?: boolean;
|
|
16
|
+
lastMessageId?: string | null;
|
|
17
|
+
bitrate?: number;
|
|
18
|
+
userLimit?: number;
|
|
19
|
+
rateLimitPerUser?: number;
|
|
20
|
+
recipients?: Array<User>;
|
|
21
|
+
icon?: string | null;
|
|
22
|
+
ownerId?: string;
|
|
23
|
+
applicationId?: string;
|
|
24
|
+
managed?: boolean;
|
|
25
|
+
parentId?: string | null;
|
|
26
|
+
lastPinTimestamp?: number | null;
|
|
27
|
+
rtcRegion?: string | null;
|
|
28
|
+
videoQualityMode?: number;
|
|
29
|
+
messageCount?: number;
|
|
30
|
+
memberCount?: number;
|
|
31
|
+
threadMetadata?: JSONThreadMetadata;
|
|
32
|
+
member?: JSONThreadMember;
|
|
33
|
+
defaultAutoArchiveDuration?: number;
|
|
34
|
+
permissions?: string;
|
|
35
|
+
flags?: number;
|
|
36
|
+
totalMessageSent?: number;
|
|
37
|
+
availableTags?: Array<JSONForumTag>;
|
|
38
|
+
appliedTags?: Array<string>;
|
|
39
|
+
defaultReactionEmoji?: JSONDefaultReaction | null;
|
|
40
|
+
defaultThreadRateLimitPerUser?: number;
|
|
41
|
+
defaultSortOrder?: number | null;
|
|
42
|
+
defaultForumLayout?: number;
|
|
43
|
+
constructor(data: RawChannel, client: Client);
|
|
44
|
+
protected update(data: RawChannel): void;
|
|
45
|
+
modify(options: {
|
|
46
|
+
name?: string | null;
|
|
47
|
+
type?: ChannelTypes;
|
|
48
|
+
position?: number;
|
|
49
|
+
topic?: string | null;
|
|
50
|
+
nsfw?: boolean;
|
|
51
|
+
rateLimitPerUser?: number;
|
|
52
|
+
icon?: string | null;
|
|
53
|
+
bitrate?: number;
|
|
54
|
+
userLimit?: number;
|
|
55
|
+
permissionOverwrites?: Array<JSONOverwrite>;
|
|
56
|
+
parentId?: string | null;
|
|
57
|
+
rtcRegion?: string | null;
|
|
58
|
+
videoQualityMode?: number;
|
|
59
|
+
defaultAutoArchiveDuration?: number;
|
|
60
|
+
flags?: number;
|
|
61
|
+
availableTags?: Array<JSONForumTag>;
|
|
62
|
+
defaultReactionEmoji?: JSONDefaultReaction | null;
|
|
63
|
+
defaultThreadRateLimitPerUser?: number;
|
|
64
|
+
defaultSortOrder?: number | null;
|
|
65
|
+
defaultForumLayout?: number;
|
|
66
|
+
}, reason?: string): Promise<Channel>;
|
|
67
|
+
delete(reason?: string): Promise<JSONChannel>;
|
|
68
|
+
getMessages(options: {
|
|
69
|
+
around?: string;
|
|
70
|
+
before?: string;
|
|
71
|
+
after?: string;
|
|
72
|
+
limit?: number;
|
|
73
|
+
}): Promise<Array<Message>>;
|
|
74
|
+
getMessage(): Promise<Message>;
|
|
75
|
+
createMessage(options: {
|
|
76
|
+
content?: string;
|
|
77
|
+
nonce?: string | number;
|
|
78
|
+
tts?: boolean;
|
|
79
|
+
embeds?: Array<JSONEmbed>;
|
|
80
|
+
allowedMentions?: JSONAllowedMentions;
|
|
81
|
+
messageReference?: JSONMessageReference;
|
|
82
|
+
components?: Array<{
|
|
83
|
+
type: ComponentTypes.ActionRow;
|
|
84
|
+
components: Array<{
|
|
85
|
+
type: ComponentTypes.Button;
|
|
86
|
+
style: number;
|
|
87
|
+
label?: string;
|
|
88
|
+
emoji?: JSONEmoji;
|
|
89
|
+
customId?: string;
|
|
90
|
+
url?: string;
|
|
91
|
+
disabled?: boolean;
|
|
92
|
+
} | {
|
|
93
|
+
type: ComponentTypes.SelectMenu | ComponentTypes.ChannelSelect | ComponentTypes.MentionableSelect | ComponentTypes.RoleSelect | ComponentTypes.UserSelect;
|
|
94
|
+
customId: string;
|
|
95
|
+
options?: Array<JSONSelectOption>;
|
|
96
|
+
channelTypes?: Array<ChannelTypes>;
|
|
97
|
+
placeholder?: string;
|
|
98
|
+
minValues?: number;
|
|
99
|
+
maxValues?: number;
|
|
100
|
+
disabled?: boolean;
|
|
101
|
+
} | {
|
|
102
|
+
type: ComponentTypes.TextInput;
|
|
103
|
+
customId: string;
|
|
104
|
+
style: number;
|
|
105
|
+
label: string;
|
|
106
|
+
minLength?: number;
|
|
107
|
+
maxLength?: number;
|
|
108
|
+
required?: boolean;
|
|
109
|
+
value?: string;
|
|
110
|
+
placeholder?: string;
|
|
111
|
+
}>;
|
|
112
|
+
}>;
|
|
113
|
+
stickersIds?: Array<string>;
|
|
114
|
+
files?: Array<File>;
|
|
115
|
+
attachments?: Array<JSONAttachment>;
|
|
116
|
+
flags?: MessageFlags;
|
|
117
|
+
}): Promise<Message>;
|
|
118
|
+
crosspostMessage(messageId: string): Promise<Message>;
|
|
119
|
+
createReaction(messageId: string, emoji: string): Promise<void>;
|
|
120
|
+
deleteOwnReaction(messageId: string, emoji: string): Promise<void>;
|
|
121
|
+
deleteUserReaction(messageId: string, emoji: string, userId: string): Promise<void>;
|
|
122
|
+
getReactions(messageId: string, emoji: string, options?: {
|
|
123
|
+
after?: string;
|
|
124
|
+
limit?: number;
|
|
125
|
+
}): Promise<Array<User>>;
|
|
126
|
+
deleteAllReactions(messageId: string): Promise<void>;
|
|
127
|
+
deleteAllReactionsForEmoji(messageId: string, emoji: string): Promise<void>;
|
|
128
|
+
editMessage(messageId: string, options: {
|
|
129
|
+
content?: string | null;
|
|
130
|
+
embeds?: Array<JSONEmbed> | null;
|
|
131
|
+
flags?: MessageFlags | null;
|
|
132
|
+
allowedMentions?: JSONAllowedMentions | null;
|
|
133
|
+
components?: Array<{
|
|
134
|
+
type: ComponentTypes.ActionRow;
|
|
135
|
+
components: Array<{
|
|
136
|
+
type: ComponentTypes.Button;
|
|
137
|
+
style: number;
|
|
138
|
+
label?: string;
|
|
139
|
+
emoji?: JSONEmoji;
|
|
140
|
+
customId?: string;
|
|
141
|
+
url?: string;
|
|
142
|
+
disabled?: boolean;
|
|
143
|
+
} | {
|
|
144
|
+
type: ComponentTypes.SelectMenu | ComponentTypes.ChannelSelect | ComponentTypes.MentionableSelect | ComponentTypes.RoleSelect | ComponentTypes.UserSelect;
|
|
145
|
+
customId: string;
|
|
146
|
+
options?: Array<JSONSelectOption>;
|
|
147
|
+
channelTypes?: Array<ChannelTypes>;
|
|
148
|
+
placeholder?: string;
|
|
149
|
+
minValues?: number;
|
|
150
|
+
maxValues?: number;
|
|
151
|
+
disabled?: boolean;
|
|
152
|
+
} | {
|
|
153
|
+
type: ComponentTypes.TextInput;
|
|
154
|
+
customId: string;
|
|
155
|
+
style: number;
|
|
156
|
+
label: string;
|
|
157
|
+
minLength?: number;
|
|
158
|
+
maxLength?: number;
|
|
159
|
+
required?: boolean;
|
|
160
|
+
value?: string;
|
|
161
|
+
placeholder?: string;
|
|
162
|
+
}>;
|
|
163
|
+
}> | null;
|
|
164
|
+
files?: Array<File> | null;
|
|
165
|
+
attachments?: Array<JSONAttachment> | null;
|
|
166
|
+
}): Promise<Message>;
|
|
167
|
+
deleteMessage(messageId: string, reason?: string): Promise<void>;
|
|
168
|
+
bulkDeleteMessages(messagesIds: Array<string>): Promise<void>;
|
|
169
|
+
editChannelPermissions(overwriteId: string, options: {
|
|
170
|
+
allow?: string | null;
|
|
171
|
+
deny?: string | null;
|
|
172
|
+
type: number;
|
|
173
|
+
}, reason?: string): Promise<void>;
|
|
174
|
+
getChannelInvites(): Promise<Array<Invite>>;
|
|
175
|
+
createChannelInvite(options: {
|
|
176
|
+
maxAge?: number;
|
|
177
|
+
maxUses?: number;
|
|
178
|
+
temporary?: boolean;
|
|
179
|
+
unique?: boolean;
|
|
180
|
+
targetType?: InviteTargetTypes;
|
|
181
|
+
targetUserId?: string;
|
|
182
|
+
targetApplicationId?: string;
|
|
183
|
+
}, reason?: string): Promise<Invite>;
|
|
184
|
+
deleteChannelPermission(overwriteId: string, reason?: string): Promise<void>;
|
|
185
|
+
followAnnouncementChannel(options: {
|
|
186
|
+
webhookChannelId: string;
|
|
187
|
+
}): Promise<JSONFollowedChannel>;
|
|
188
|
+
triggerTypingIndicator(): Promise<void>;
|
|
189
|
+
getPinnedMessages(): Promise<Array<Message>>;
|
|
190
|
+
pinMessage(messageId: string, reason?: string): Promise<void>;
|
|
191
|
+
unpinMessage(messageId: string, reason?: string): Promise<void>;
|
|
192
|
+
groupDMAddRecipient(userId: string, options: {
|
|
193
|
+
accessToken: string;
|
|
194
|
+
nick: string;
|
|
195
|
+
}): Promise<void>;
|
|
196
|
+
groupDMRemoveRecipient(userId: string): Promise<void>;
|
|
197
|
+
startThreadFromMessage(messageId: string, options: {
|
|
198
|
+
name: string;
|
|
199
|
+
autoArchiveDuration?: number;
|
|
200
|
+
rateLimitPerUser?: number | null;
|
|
201
|
+
}, reason?: string): Promise<Channel>;
|
|
202
|
+
startThreadWithoutMessage(options: {
|
|
203
|
+
name: string;
|
|
204
|
+
autoArchiveDuration: number;
|
|
205
|
+
type?: ChannelTypes;
|
|
206
|
+
invitable?: boolean;
|
|
207
|
+
rateLimitPerUser?: number | null;
|
|
208
|
+
}, reason?: string): Promise<Channel>;
|
|
209
|
+
startThreadInForumChannel(options: {
|
|
210
|
+
name: string;
|
|
211
|
+
autoArchiveDuration?: number;
|
|
212
|
+
rateLimitPerUser?: number | null;
|
|
213
|
+
message: {
|
|
214
|
+
content?: string | null;
|
|
215
|
+
embeds?: Array<JSONEmbed> | null;
|
|
216
|
+
allowedMentions?: JSONAllowedMentions | null;
|
|
217
|
+
components?: Array<{
|
|
218
|
+
type: ComponentTypes.ActionRow;
|
|
219
|
+
components: Array<{
|
|
220
|
+
type: ComponentTypes.Button;
|
|
221
|
+
style: number;
|
|
222
|
+
label?: string;
|
|
223
|
+
emoji?: JSONEmoji;
|
|
224
|
+
customId?: string;
|
|
225
|
+
url?: string;
|
|
226
|
+
disabled?: boolean;
|
|
227
|
+
} | {
|
|
228
|
+
type: ComponentTypes.SelectMenu | ComponentTypes.ChannelSelect | ComponentTypes.MentionableSelect | ComponentTypes.RoleSelect | ComponentTypes.UserSelect;
|
|
229
|
+
customId: string;
|
|
230
|
+
options?: Array<JSONSelectOption>;
|
|
231
|
+
channelTypes?: Array<ChannelTypes>;
|
|
232
|
+
placeholder?: string;
|
|
233
|
+
minValues?: number;
|
|
234
|
+
maxValues?: number;
|
|
235
|
+
disabled?: boolean;
|
|
236
|
+
} | {
|
|
237
|
+
type: ComponentTypes.TextInput;
|
|
238
|
+
customId: string;
|
|
239
|
+
style: number;
|
|
240
|
+
label: string;
|
|
241
|
+
minLength?: number;
|
|
242
|
+
maxLength?: number;
|
|
243
|
+
required?: boolean;
|
|
244
|
+
value?: string;
|
|
245
|
+
placeholder?: string;
|
|
246
|
+
}>;
|
|
247
|
+
}> | null;
|
|
248
|
+
files?: Array<File> | null;
|
|
249
|
+
attachments?: Array<JSONAttachment> | null;
|
|
250
|
+
flags?: MessageFlags | null;
|
|
251
|
+
};
|
|
252
|
+
appliedTags?: Array<string>;
|
|
253
|
+
}, reason?: string): Promise<Channel>;
|
|
254
|
+
joinThread(): Promise<void>;
|
|
255
|
+
addThreadMember(userId: string): Promise<void>;
|
|
256
|
+
leaveThread(): Promise<void>;
|
|
257
|
+
removeThreadMember(userId: string): Promise<void>;
|
|
258
|
+
getThreadMember(userId: string, options?: {
|
|
259
|
+
withMembers?: boolean;
|
|
260
|
+
}): Promise<JSONThreadMember>;
|
|
261
|
+
listThreadMembers(options?: {
|
|
262
|
+
withMembers?: boolean;
|
|
263
|
+
after?: string;
|
|
264
|
+
limit?: number;
|
|
265
|
+
}): Promise<Array<JSONThreadMember>>;
|
|
266
|
+
listPublicArchivedThreads(options?: {
|
|
267
|
+
before?: number;
|
|
268
|
+
limit?: number;
|
|
269
|
+
}): Promise<{
|
|
270
|
+
threads: Array<Channel>;
|
|
271
|
+
members: Array<JSONThreadMember>;
|
|
272
|
+
hasMore: boolean;
|
|
273
|
+
}>;
|
|
274
|
+
listPrivateArchivedThreads(options?: {
|
|
275
|
+
before?: number;
|
|
276
|
+
limit?: number;
|
|
277
|
+
}): Promise<{
|
|
278
|
+
threads: Array<Channel>;
|
|
279
|
+
members: Array<JSONThreadMember>;
|
|
280
|
+
hasMore: boolean;
|
|
281
|
+
}>;
|
|
282
|
+
listJoinedPrivateArchivedThreads(options?: {
|
|
283
|
+
before?: number;
|
|
284
|
+
limit?: number;
|
|
285
|
+
}): Promise<{
|
|
286
|
+
threads: Array<Channel>;
|
|
287
|
+
members: Array<JSONThreadMember>;
|
|
288
|
+
hasMore: boolean;
|
|
289
|
+
}>;
|
|
290
|
+
createWebhook(options: {
|
|
291
|
+
name: string;
|
|
292
|
+
avatar?: string | null;
|
|
293
|
+
}, reason?: string): Promise<Webhook>;
|
|
294
|
+
getWebhooks(): Promise<Array<Webhook>>;
|
|
295
|
+
toJSON(): JSONChannel;
|
|
296
|
+
}
|