-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathdisableComponents.js
More file actions
23 lines (23 loc) · 942 Bytes
/
disableComponents.js
File metadata and controls
23 lines (23 loc) · 942 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const discord_js_1 = require("discord.js");
const structures_1 = require("../../structures");
exports.default = new structures_1.NativeFunction({
name: "$disableComponents",
version: "2.2.0",
description: "Disables all components on the current message",
aliases: ["$disableAllComponents"],
unwrap: false,
execute(ctx) {
const components = ctx.container.components;
ctx.container.actionRow?.components.forEach((x) => x.setDisabled(true));
for (let comp of components) {
if (!(comp instanceof discord_js_1.ActionRowBuilder))
continue;
const actionRow = new discord_js_1.ActionRowBuilder();
comp?.components.forEach((x) => actionRow.addComponents(x.setDisabled(true)));
}
return this.success();
},
});
//# sourceMappingURL=disableComponents.js.map