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,189 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Webhook = void 0;
|
|
4
|
+
const _1 = require(".");
|
|
5
|
+
const rest_1 = require("../rest");
|
|
6
|
+
const utils_1 = require("../utils");
|
|
7
|
+
class Webhook {
|
|
8
|
+
client;
|
|
9
|
+
id;
|
|
10
|
+
type;
|
|
11
|
+
guildId;
|
|
12
|
+
channelId;
|
|
13
|
+
user;
|
|
14
|
+
name;
|
|
15
|
+
avatar;
|
|
16
|
+
token;
|
|
17
|
+
applicationId;
|
|
18
|
+
sourceGuild;
|
|
19
|
+
sourceChannel;
|
|
20
|
+
url;
|
|
21
|
+
constructor(data, client) {
|
|
22
|
+
this.client = client;
|
|
23
|
+
this.id = data.id;
|
|
24
|
+
this.type = data.type;
|
|
25
|
+
this.channelId = data.channel_id;
|
|
26
|
+
this.name = data.name;
|
|
27
|
+
this.avatar = data.avatar;
|
|
28
|
+
this.applicationId = data.application_id;
|
|
29
|
+
this.update(data);
|
|
30
|
+
}
|
|
31
|
+
update(data) {
|
|
32
|
+
if (data.guild_id !== undefined)
|
|
33
|
+
this.guildId = data.guild_id;
|
|
34
|
+
if (data.user !== undefined)
|
|
35
|
+
this.user = new _1.User(data.user, this.client);
|
|
36
|
+
if (data.token !== undefined)
|
|
37
|
+
this.token = data.token;
|
|
38
|
+
if (data.source_guild !== undefined)
|
|
39
|
+
this.sourceGuild = new _1.Guild(data.source_guild, this.client);
|
|
40
|
+
if (data.source_channel !== undefined)
|
|
41
|
+
this.sourceChannel = new _1.Channel(data.source_channel, this.client);
|
|
42
|
+
if (data.url !== undefined)
|
|
43
|
+
this.url = data.url;
|
|
44
|
+
}
|
|
45
|
+
/* https://discord.com/developers/docs/resources/webhook#modify-webhook */
|
|
46
|
+
async modifyWebhook(options, reason) {
|
|
47
|
+
return new Webhook(await this.client.rest.request("PATCH", rest_1.Endpoints.webhook(this.id), {
|
|
48
|
+
json: {
|
|
49
|
+
name: options?.name,
|
|
50
|
+
avatar: options?.avatar,
|
|
51
|
+
channel_id: options?.channelId,
|
|
52
|
+
},
|
|
53
|
+
reason,
|
|
54
|
+
}), this.client);
|
|
55
|
+
}
|
|
56
|
+
/* https://discord.com/developers/docs/resources/webhook#modify-webhook-with-token */
|
|
57
|
+
async modifyWithToken(token, options, reason) {
|
|
58
|
+
return new Webhook(await this.client.rest.request("PATCH", rest_1.Endpoints.webhook(this.id, token), {
|
|
59
|
+
json: {
|
|
60
|
+
name: options?.name,
|
|
61
|
+
avatar: options?.avatar,
|
|
62
|
+
},
|
|
63
|
+
reason,
|
|
64
|
+
}), this.client);
|
|
65
|
+
}
|
|
66
|
+
/* https://discord.com/developers/docs/resources/webhook#delete-webhook */
|
|
67
|
+
async delete(reason) {
|
|
68
|
+
this.client.rest.request("DELETE", rest_1.Endpoints.webhook(this.id), {
|
|
69
|
+
reason,
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
/* https://discord.com/developers/docs/resources/webhook#delete-webhook-with-token */
|
|
73
|
+
async deleteWithToken(token, reason) {
|
|
74
|
+
this.client.rest.request("DELETE", rest_1.Endpoints.webhook(this.id, token), {
|
|
75
|
+
reason,
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
/* https://discord.com/developers/docs/resources/webhook#execute-webhook */
|
|
79
|
+
async execute(token, options) {
|
|
80
|
+
return new _1.Message(await this.client.rest.request("POST", rest_1.Endpoints.webhook(this.id, token), {
|
|
81
|
+
query: {
|
|
82
|
+
wait: options?.wait,
|
|
83
|
+
thread_id: options?.threadId,
|
|
84
|
+
username: options?.username,
|
|
85
|
+
avatarURL: options?.avatarURL,
|
|
86
|
+
},
|
|
87
|
+
json: {
|
|
88
|
+
content: options?.content,
|
|
89
|
+
tts: options?.tts,
|
|
90
|
+
embeds: options?.embeds,
|
|
91
|
+
allowed_mentions: {
|
|
92
|
+
parse: options?.allowedMentions?.parse,
|
|
93
|
+
roles: options?.allowedMentions?.roles,
|
|
94
|
+
users: options?.allowedMentions?.users,
|
|
95
|
+
replied_user: options?.allowedMentions?.repliedUser,
|
|
96
|
+
},
|
|
97
|
+
components: options?.components !== undefined
|
|
98
|
+
? options.components !== null
|
|
99
|
+
? (0, utils_1.rawMessageComponent)(options.components)
|
|
100
|
+
: null
|
|
101
|
+
: undefined,
|
|
102
|
+
attachments: options?.attachments,
|
|
103
|
+
flags: options?.flags,
|
|
104
|
+
thread_name: options?.threadName,
|
|
105
|
+
},
|
|
106
|
+
files: options?.files,
|
|
107
|
+
}), this.client);
|
|
108
|
+
}
|
|
109
|
+
/* https://discord.com/developers/docs/resources/webhook#execute-slackcompatible-webhook */
|
|
110
|
+
async executeSlackCompatible(token, options) {
|
|
111
|
+
return new _1.Message(await this.client.rest.request("POST", rest_1.Endpoints.webhook(this.id, token), {
|
|
112
|
+
query: {
|
|
113
|
+
thread_id: options?.threadId,
|
|
114
|
+
wait: options?.wait,
|
|
115
|
+
},
|
|
116
|
+
}), this.client);
|
|
117
|
+
}
|
|
118
|
+
/* https://discord.com/developers/docs/resources/webhook#execute-githubcompatible-webhook */
|
|
119
|
+
async executeGitHubCompatible(token, options) {
|
|
120
|
+
return new _1.Message(await this.client.rest.request("POST", rest_1.Endpoints.webhook(this.id, token), {
|
|
121
|
+
query: {
|
|
122
|
+
thread_id: options?.threadId,
|
|
123
|
+
wait: options?.wait,
|
|
124
|
+
},
|
|
125
|
+
}), this.client);
|
|
126
|
+
}
|
|
127
|
+
/* https://discord.com/developers/docs/resources/webhook#get-webhook-message */
|
|
128
|
+
async getMessage(token, messageId, options) {
|
|
129
|
+
return new _1.Message(await this.client.rest.request("GET", rest_1.Endpoints.webhookMessage(this.id, token, messageId), {
|
|
130
|
+
query: {
|
|
131
|
+
thread_id: options?.threadId,
|
|
132
|
+
},
|
|
133
|
+
}), this.client);
|
|
134
|
+
}
|
|
135
|
+
/* https://discord.com/developers/docs/resources/webhook#edit-webhook-message */
|
|
136
|
+
async editMessage(messageId, options) {
|
|
137
|
+
if (!this.token)
|
|
138
|
+
throw new Error("[disgroove] Webhook token not found");
|
|
139
|
+
return new _1.Message(await this.client.rest.request("POST", rest_1.Endpoints.webhookMessage(this.id, this.token, messageId), {
|
|
140
|
+
query: {
|
|
141
|
+
thread_id: options?.threadId,
|
|
142
|
+
},
|
|
143
|
+
json: {
|
|
144
|
+
content: options?.content,
|
|
145
|
+
embeds: options?.embeds,
|
|
146
|
+
allowed_mentions: {
|
|
147
|
+
parse: options?.allowedMentions?.parse,
|
|
148
|
+
roles: options?.allowedMentions?.roles,
|
|
149
|
+
users: options?.allowedMentions?.users,
|
|
150
|
+
replied_user: options?.allowedMentions?.repliedUser,
|
|
151
|
+
},
|
|
152
|
+
components: options?.components !== undefined
|
|
153
|
+
? options.components !== null
|
|
154
|
+
? (0, utils_1.rawMessageComponent)(options.components)
|
|
155
|
+
: null
|
|
156
|
+
: undefined,
|
|
157
|
+
attachments: options?.attachments,
|
|
158
|
+
flags: options?.flags,
|
|
159
|
+
},
|
|
160
|
+
files: options?.files,
|
|
161
|
+
}), this.client);
|
|
162
|
+
}
|
|
163
|
+
/* https://discord.com/developers/docs/resources/webhook#delete-webhook-message */
|
|
164
|
+
async deleteMessage(token, messageId, options) {
|
|
165
|
+
this.client.rest.request("DELETE", rest_1.Endpoints.webhookMessage(this.id, token, messageId), {
|
|
166
|
+
query: {
|
|
167
|
+
thread_id: options?.threadId,
|
|
168
|
+
},
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
toJSON() {
|
|
172
|
+
return {
|
|
173
|
+
id: this.id,
|
|
174
|
+
type: this.type,
|
|
175
|
+
guildId: this.guildId,
|
|
176
|
+
channelId: this.channelId,
|
|
177
|
+
user: this.user,
|
|
178
|
+
name: this.name,
|
|
179
|
+
avatar: this.avatar,
|
|
180
|
+
token: this.token,
|
|
181
|
+
applicationId: this.applicationId,
|
|
182
|
+
sourceGuild: this.sourceGuild,
|
|
183
|
+
sourceChannel: this.sourceChannel,
|
|
184
|
+
url: this.url,
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
exports.Webhook = Webhook;
|
|
189
|
+
//# sourceMappingURL=Webhook.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Webhook.js","sourceRoot":"","sources":["../../src/structures/Webhook.ts"],"names":[],"mappings":";;;AAAA,wBAAkD;AAElD,kCAA0C;AAU1C,oCAMkB;AAElB,MAAa,OAAO;IACV,MAAM,CAAU;IACjB,EAAE,CAAS;IACX,IAAI,CAAe;IACnB,OAAO,CAAiB;IACxB,SAAS,CAAgB;IACzB,IAAI,CAAQ;IACZ,IAAI,CAAgB;IACpB,MAAM,CAAgB;IACtB,KAAK,CAAU;IACf,aAAa,CAAgB;IAC7B,WAAW,CAAS;IACpB,aAAa,CAAW;IACxB,GAAG,CAAU;IAEpB,YAAY,IAAgB,EAAE,MAAc;QAC1C,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC;QAClB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QACtB,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,UAAU,CAAC;QACjC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QACtB,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QAC1B,IAAI,CAAC,aAAa,G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IAAI,CAAC,aAAa;YACjC,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,aAAa,EAAE,IAAI,CAAC,aAAa;YACjC,GAAG,EAAE,IAAI,CAAC,GAAG;SACd,CAAC;IACJ,CAAC;CACF;AAlYD,0BAkYC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export * from "./Application";
|
|
2
|
+
export * from "./ApplicationCommand";
|
|
3
|
+
export * from "./AuditLogEntry";
|
|
4
|
+
export * from "./AutoModerationRule";
|
|
5
|
+
export * from "./Channel";
|
|
6
|
+
export * from "./Guild";
|
|
7
|
+
export * from "./GuildMember";
|
|
8
|
+
export * from "./GuildScheduledEvent";
|
|
9
|
+
export * from "./GuildTemplate";
|
|
10
|
+
export * from "./Integration";
|
|
11
|
+
export * from "./Interaction";
|
|
12
|
+
export * from "./Invite";
|
|
13
|
+
export * from "./Message";
|
|
14
|
+
export * from "./Role";
|
|
15
|
+
export * from "./StageInstance";
|
|
16
|
+
export * from "./User";
|
|
17
|
+
export * from "./Webhook";
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./Application"), exports);
|
|
18
|
+
__exportStar(require("./ApplicationCommand"), exports);
|
|
19
|
+
__exportStar(require("./AuditLogEntry"), exports);
|
|
20
|
+
__exportStar(require("./AutoModerationRule"), exports);
|
|
21
|
+
__exportStar(require("./Channel"), exports);
|
|
22
|
+
__exportStar(require("./Guild"), exports);
|
|
23
|
+
__exportStar(require("./GuildMember"), exports);
|
|
24
|
+
__exportStar(require("./GuildScheduledEvent"), exports);
|
|
25
|
+
__exportStar(require("./GuildTemplate"), exports);
|
|
26
|
+
__exportStar(require("./Integration"), exports);
|
|
27
|
+
__exportStar(require("./Interaction"), exports);
|
|
28
|
+
__exportStar(require("./Invite"), exports);
|
|
29
|
+
__exportStar(require("./Message"), exports);
|
|
30
|
+
__exportStar(require("./Role"), exports);
|
|
31
|
+
__exportStar(require("./StageInstance"), exports);
|
|
32
|
+
__exportStar(require("./User"), exports);
|
|
33
|
+
__exportStar(require("./Webhook"), exports);
|
|
34
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/structures/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B;AAC9B,uDAAqC;AACrC,kDAAgC;AAChC,uDAAqC;AACrC,4CAA0B;AAC1B,0CAAwB;AACxB,gDAA8B;AAC9B,wDAAsC;AACtC,kDAAgC;AAChC,gDAA8B;AAC9B,gDAA8B;AAC9B,2CAAyB;AACzB,4CAA0B;AAC1B,yCAAuB;AACvB,kDAAgC;AAChC,yCAAuB;AACvB,4CAA0B"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import type { ApplicationCommandTypes, ApplicationCommandOptionType, ChannelTypes, Locale, ApplicationCommandPermissionType } from "../utils/constants";
|
|
2
|
+
export interface RawApplicationCommand {
|
|
3
|
+
id: string;
|
|
4
|
+
type?: ApplicationCommandTypes;
|
|
5
|
+
application_id: string;
|
|
6
|
+
guild_id?: string;
|
|
7
|
+
name: string;
|
|
8
|
+
name_localizations?: Partial<Record<Locale, string>> | null;
|
|
9
|
+
description: string;
|
|
10
|
+
description_localizations?: Partial<Record<Locale, string>> | null;
|
|
11
|
+
options?: Array<RawApplicationCommandOption>;
|
|
12
|
+
default_member_permissions: string | null;
|
|
13
|
+
dm_permission?: boolean;
|
|
14
|
+
default_permission?: boolean | null;
|
|
15
|
+
nsfw?: boolean;
|
|
16
|
+
version: string;
|
|
17
|
+
}
|
|
18
|
+
export interface RawApplicationCommandOption {
|
|
19
|
+
type: ApplicationCommandOptionType;
|
|
20
|
+
name: string;
|
|
21
|
+
name_localizations?: Partial<Record<Locale, string>> | null;
|
|
22
|
+
description: string;
|
|
23
|
+
description_localizations?: Partial<Record<Locale, string>> | null;
|
|
24
|
+
required?: boolean;
|
|
25
|
+
choices?: Array<RawApplicationCommandOptionChoice>;
|
|
26
|
+
options?: Array<RawApplicationCommandOption>;
|
|
27
|
+
channel_types?: Array<ChannelTypes>;
|
|
28
|
+
min_value?: number;
|
|
29
|
+
max_value?: number;
|
|
30
|
+
min_length?: number;
|
|
31
|
+
max_length?: number;
|
|
32
|
+
autocomplete?: boolean;
|
|
33
|
+
}
|
|
34
|
+
export interface RawApplicationCommandOptionChoice {
|
|
35
|
+
name: string;
|
|
36
|
+
name_localizations?: Partial<Record<Locale, string>> | null;
|
|
37
|
+
value: string;
|
|
38
|
+
}
|
|
39
|
+
export interface RawGuildApplicationCommandPermissions {
|
|
40
|
+
id: string;
|
|
41
|
+
application_id: string;
|
|
42
|
+
guild_id: string;
|
|
43
|
+
permissions: Array<RawApplicationCommandPermission>;
|
|
44
|
+
}
|
|
45
|
+
export interface RawApplicationCommandPermission {
|
|
46
|
+
id: string;
|
|
47
|
+
type: ApplicationCommandPermissionType;
|
|
48
|
+
permission: boolean;
|
|
49
|
+
}
|
|
50
|
+
export interface JSONApplicationCommand {
|
|
51
|
+
id: string;
|
|
52
|
+
type?: ApplicationCommandTypes;
|
|
53
|
+
applicationId: string;
|
|
54
|
+
guildId?: string;
|
|
55
|
+
name: string;
|
|
56
|
+
nameLocalizations?: Partial<Record<Locale, string>> | null;
|
|
57
|
+
description: string;
|
|
58
|
+
descriptionLocalizations?: Partial<Record<Locale, string>> | null;
|
|
59
|
+
options?: Array<JSONApplicationCommandOption>;
|
|
60
|
+
defaultMemberPermissions: string | null;
|
|
61
|
+
dmPermission?: boolean;
|
|
62
|
+
defaultPermission?: boolean | null;
|
|
63
|
+
nsfw?: boolean;
|
|
64
|
+
version: string;
|
|
65
|
+
}
|
|
66
|
+
export interface JSONApplicationCommandOption {
|
|
67
|
+
type: ApplicationCommandOptionType;
|
|
68
|
+
name: string;
|
|
69
|
+
nameLocalizations?: Partial<Record<Locale, string>> | null;
|
|
70
|
+
description: string;
|
|
71
|
+
descriptionLocalizations?: Partial<Record<Locale, string>> | null;
|
|
72
|
+
required?: boolean;
|
|
73
|
+
choices?: Array<JSONApplicationCommandOptionChoice>;
|
|
74
|
+
options?: Array<JSONApplicationCommandOption>;
|
|
75
|
+
channelTypes?: Array<ChannelTypes>;
|
|
76
|
+
minValue?: number;
|
|
77
|
+
maxValue?: number;
|
|
78
|
+
minLength?: number;
|
|
79
|
+
maxLength?: number;
|
|
80
|
+
autocomplete?: boolean;
|
|
81
|
+
}
|
|
82
|
+
export interface JSONApplicationCommandOptionChoice {
|
|
83
|
+
name: string;
|
|
84
|
+
nameLocalizations?: Partial<Record<Locale, string>> | null;
|
|
85
|
+
value: string;
|
|
86
|
+
}
|
|
87
|
+
export interface JSONGuildApplicationCommandPermissions {
|
|
88
|
+
id: string;
|
|
89
|
+
applicationId: string;
|
|
90
|
+
guildId: string;
|
|
91
|
+
permissions: Array<JSONApplicationCommandPermission>;
|
|
92
|
+
}
|
|
93
|
+
export interface JSONApplicationCommandPermission {
|
|
94
|
+
id: string;
|
|
95
|
+
type: ApplicationCommandPermissionType;
|
|
96
|
+
permission: boolean;
|
|
97
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"application-command.js","sourceRoot":"","sources":["../../src/types/application-command.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ApplicationRoleConnectionMetadataType, Locale } from "../utils/constants";
|
|
2
|
+
export interface RawApplicationRoleConnectionMetadata {
|
|
3
|
+
type: ApplicationRoleConnectionMetadataType;
|
|
4
|
+
key: string;
|
|
5
|
+
name: string;
|
|
6
|
+
name_localizations?: Partial<Record<Locale, string>> | null;
|
|
7
|
+
description: string;
|
|
8
|
+
description_localizations?: Partial<Record<Locale, string>> | null;
|
|
9
|
+
}
|
|
10
|
+
export interface JSONApplicationRoleConnectionMetadata {
|
|
11
|
+
type: ApplicationRoleConnectionMetadataType;
|
|
12
|
+
key: string;
|
|
13
|
+
name: string;
|
|
14
|
+
nameLocalizations?: Partial<Record<Locale, string>> | null;
|
|
15
|
+
description: string;
|
|
16
|
+
descriptionLocalizations?: Partial<Record<Locale, string>> | null;
|
|
17
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"application-role-connection-metadata.js","sourceRoot":"","sources":["../../src/types/application-role-connection-metadata.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { RawUser } from ".";
|
|
2
|
+
import type { User } from "../structures";
|
|
3
|
+
import type { OAuth2Scopes } from "../utils/constants";
|
|
4
|
+
export interface RawApplication {
|
|
5
|
+
id: string;
|
|
6
|
+
name: string;
|
|
7
|
+
icon: string | null;
|
|
8
|
+
description: string;
|
|
9
|
+
rpc_origins?: Array<string>;
|
|
10
|
+
bot_public: boolean;
|
|
11
|
+
bot_require_code_grant: boolean;
|
|
12
|
+
terms_of_service_url?: string;
|
|
13
|
+
privacy_policy_url?: string;
|
|
14
|
+
owner?: RawUser;
|
|
15
|
+
verify_key: string;
|
|
16
|
+
guild_id?: string;
|
|
17
|
+
primary_sku_id?: string;
|
|
18
|
+
slug?: string;
|
|
19
|
+
cover_image?: string;
|
|
20
|
+
flags?: number;
|
|
21
|
+
tags?: Array<string>;
|
|
22
|
+
install_params?: RawInstallParams;
|
|
23
|
+
custom_install_url?: string;
|
|
24
|
+
role_connections_verification_url?: string;
|
|
25
|
+
}
|
|
26
|
+
export interface RawInstallParams {
|
|
27
|
+
scopes: Array<OAuth2Scopes>;
|
|
28
|
+
permissions: string;
|
|
29
|
+
}
|
|
30
|
+
export interface JSONApplication {
|
|
31
|
+
id: string;
|
|
32
|
+
name: string;
|
|
33
|
+
icon: string | null;
|
|
34
|
+
description: string;
|
|
35
|
+
rpcOrigins?: Array<string>;
|
|
36
|
+
botPublic: boolean;
|
|
37
|
+
botRequireCodeGrant: boolean;
|
|
38
|
+
termsOfServiceURL?: string;
|
|
39
|
+
privacyPolicyURL?: string;
|
|
40
|
+
owner?: User;
|
|
41
|
+
verifyKey: string;
|
|
42
|
+
guildId?: string;
|
|
43
|
+
primarySkuId?: string;
|
|
44
|
+
slug?: string;
|
|
45
|
+
coverImage?: string;
|
|
46
|
+
flags?: number;
|
|
47
|
+
tags?: Array<string>;
|
|
48
|
+
installParams?: JSONInstallParams;
|
|
49
|
+
customInstallURL?: string;
|
|
50
|
+
roleConnectionsVerificationURL?: string;
|
|
51
|
+
}
|
|
52
|
+
export interface JSONInstallParams {
|
|
53
|
+
scopes: Array<OAuth2Scopes>;
|
|
54
|
+
permissions: string;
|
|
55
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"application.js","sourceRoot":"","sources":["../../src/types/application.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import type { RawApplicationCommand, RawGuildScheduledEvent, RawAutoModerationRule, RawIntegration, RawChannel, RawUser, RawWebhook } from ".";
|
|
2
|
+
import type { ApplicationCommand, AuditLogEntry, AutoModerationRule, Channel, GuildScheduledEvent, Integration, User, Webhook } from "../structures";
|
|
3
|
+
import type { AuditLogEvents } from "../utils/constants";
|
|
4
|
+
export interface RawAuditLog {
|
|
5
|
+
application_commands: Array<RawApplicationCommand>;
|
|
6
|
+
audit_log_entries: Array<RawAuditLogEntry>;
|
|
7
|
+
auto_moderation_rules: Array<RawAutoModerationRule>;
|
|
8
|
+
guild_scheduled_events: Array<RawGuildScheduledEvent>;
|
|
9
|
+
integrations: Array<RawIntegration>;
|
|
10
|
+
threads: Array<RawChannel>;
|
|
11
|
+
users: Array<RawUser>;
|
|
12
|
+
webhooks: Array<RawWebhook>;
|
|
13
|
+
}
|
|
14
|
+
export interface RawAuditLogEntry {
|
|
15
|
+
target_id: string | null;
|
|
16
|
+
changes?: Array<RawAuditLogChange>;
|
|
17
|
+
user_id: string | null;
|
|
18
|
+
id: string;
|
|
19
|
+
action_type: AuditLogEvents;
|
|
20
|
+
options?: RawOptionalAuditLogEntryInfo;
|
|
21
|
+
reason?: string;
|
|
22
|
+
}
|
|
23
|
+
export interface RawOptionalAuditLogEntryInfo {
|
|
24
|
+
application_id: string;
|
|
25
|
+
auto_moderation_rule_name: string;
|
|
26
|
+
auto_moderation_rule_trigger_type: string;
|
|
27
|
+
channel_id: string;
|
|
28
|
+
count: string;
|
|
29
|
+
delete_member_days: string;
|
|
30
|
+
id: string;
|
|
31
|
+
members_removed: string;
|
|
32
|
+
message_id: string;
|
|
33
|
+
role_name: string;
|
|
34
|
+
type: string;
|
|
35
|
+
}
|
|
36
|
+
export interface RawAuditLogChange {
|
|
37
|
+
new_value?: any;
|
|
38
|
+
old_value?: any;
|
|
39
|
+
key: string;
|
|
40
|
+
}
|
|
41
|
+
export interface JSONAuditLog {
|
|
42
|
+
applicationCommands: Array<ApplicationCommand>;
|
|
43
|
+
auditLogEntries: Array<AuditLogEntry>;
|
|
44
|
+
autoModerationRules: Array<AutoModerationRule>;
|
|
45
|
+
guildScheduledEvents: Array<GuildScheduledEvent>;
|
|
46
|
+
integrations: Array<Integration>;
|
|
47
|
+
threads: Array<Channel>;
|
|
48
|
+
users: Array<User>;
|
|
49
|
+
webhooks: Array<Webhook>;
|
|
50
|
+
}
|
|
51
|
+
export interface JSONAuditLogEntry {
|
|
52
|
+
targetId: string | null;
|
|
53
|
+
changes?: Array<JSONAuditLogChange>;
|
|
54
|
+
userId: string | null;
|
|
55
|
+
id: string;
|
|
56
|
+
actionType: AuditLogEvents;
|
|
57
|
+
options?: JSONOptionalAuditLogEntryInfo;
|
|
58
|
+
reason?: string;
|
|
59
|
+
}
|
|
60
|
+
export interface JSONOptionalAuditLogEntryInfo {
|
|
61
|
+
applicationId: string;
|
|
62
|
+
autoModerationRuleName: string;
|
|
63
|
+
autoModerationRuleTriggerType: string;
|
|
64
|
+
channelId: string;
|
|
65
|
+
count: string;
|
|
66
|
+
deleteMemberDays: string;
|
|
67
|
+
id: string;
|
|
68
|
+
membersRemoved: string;
|
|
69
|
+
messageId: string;
|
|
70
|
+
roleName: string;
|
|
71
|
+
type: string;
|
|
72
|
+
}
|
|
73
|
+
export interface JSONAuditLogChange {
|
|
74
|
+
newValue?: any;
|
|
75
|
+
oldValue?: any;
|
|
76
|
+
key: string;
|
|
77
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"audit-log.js","sourceRoot":"","sources":["../../src/types/audit-log.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { KeywordPresetTypes, ActionTypes } from "../utils/constants";
|
|
2
|
+
export interface RawAutoModerationRule {
|
|
3
|
+
id: string;
|
|
4
|
+
guild_id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
creator_id: string;
|
|
7
|
+
event_type: number;
|
|
8
|
+
trigger_type: number;
|
|
9
|
+
trigger_metadata: object;
|
|
10
|
+
actions: Array<RawAutoModerationAction>;
|
|
11
|
+
enabled: boolean;
|
|
12
|
+
exempt_roles: Array<string>;
|
|
13
|
+
exempt_channels: Array<string>;
|
|
14
|
+
}
|
|
15
|
+
export interface RawTriggerMetadata {
|
|
16
|
+
keyword_filter: Array<string>;
|
|
17
|
+
regex_patterns: Array<string>;
|
|
18
|
+
presets: KeywordPresetTypes;
|
|
19
|
+
allow_list: Array<string>;
|
|
20
|
+
mention_total_limit: number;
|
|
21
|
+
mention_raid_protection: boolean;
|
|
22
|
+
}
|
|
23
|
+
export interface RawAutoModerationAction {
|
|
24
|
+
type: ActionTypes;
|
|
25
|
+
metadata: RawActionMetadata;
|
|
26
|
+
}
|
|
27
|
+
export interface RawActionMetadata {
|
|
28
|
+
channel_id: string;
|
|
29
|
+
duration_seconds: number;
|
|
30
|
+
custom_message?: string;
|
|
31
|
+
}
|
|
32
|
+
export interface JSONAutoModerationRule {
|
|
33
|
+
id: string;
|
|
34
|
+
guildId: string;
|
|
35
|
+
name: string;
|
|
36
|
+
creatorId: string;
|
|
37
|
+
eventType: number;
|
|
38
|
+
triggerType: number;
|
|
39
|
+
triggerMetadata: object;
|
|
40
|
+
actions: Array<JSONAutoModerationAction>;
|
|
41
|
+
enabled: boolean;
|
|
42
|
+
exemptRoles: Array<string>;
|
|
43
|
+
exemptChannels: Array<string>;
|
|
44
|
+
}
|
|
45
|
+
export interface JSONTriggerMetadata {
|
|
46
|
+
keywordFilter: Array<string>;
|
|
47
|
+
regexPatterns: Array<string>;
|
|
48
|
+
presets: KeywordPresetTypes;
|
|
49
|
+
allowList: Array<string>;
|
|
50
|
+
mentionTotalLimit: number;
|
|
51
|
+
mentionRaidProtection: boolean;
|
|
52
|
+
}
|
|
53
|
+
export interface JSONAutoModerationAction {
|
|
54
|
+
type: ActionTypes;
|
|
55
|
+
metadata: JSONActionMetadata;
|
|
56
|
+
}
|
|
57
|
+
export interface JSONActionMetadata {
|
|
58
|
+
channelId: string;
|
|
59
|
+
durationSeconds: number;
|
|
60
|
+
customMessage?: string;
|
|
61
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auto-moderation.js","sourceRoot":"","sources":["../../src/types/auto-moderation.ts"],"names":[],"mappings":""}
|