Files
discordeno/template/nodejs/Plugins/Moderation/commands/ban.js
meister03 405e4a7533 Discordeno.js guide (#2313)
* Update Template and Add Discordeno.js notes in favour of depreciating Discord Structures

* Add package.json

* deno fmt

Co-authored-by: meister03 <meisterpi@gmail.com>
Co-authored-by: LTS20050703 <87189679+lts20050703@users.noreply.github.com>
Co-authored-by: LTS20050703 <lts20050703@gmail.com>
2022-08-23 10:31:14 -04:00

41 lines
1.4 KiB
JavaScript

const BaseCommand = require("../../../Structures/BaseCommand.js");
const Discord = require("discordeno.js");
class bancommand extends BaseCommand {
static name = "ban";
static description = "Ban a user from the server";
static usage = "";
static category = "Moderation";
static slash = { name: "ban", category: "mod" };
constructor(data) {
super(data);
}
async execute() {
//Show Case Modal
// Because no permission system has not been added
if (!this.client.config.owners.includes(String(this.user.id))) return;
const textinput = new Discord.Component()
.setType("TEXT_INPUT")
.setStyle("SHORT")
.setCustomId("t1")
.setLabel("User ID")
.setPlaceholder("User ID")
.setRequired(true)
.setMaxLength(20)
.setMinLength(1)
.setValue(this.args[0])
.toJSON();
const textinput2 = new Discord.Component().setType("TEXT_INPUT").setStyle("PARAGRAPH").setCustomId("t2")
.setLabel("Reason").setPlaceholder("Reason for Ban").setRequired(false)
.setMaxLength(300).toJSON();
const actionrow = new Discord.Component().setType(1).setComponents(textinput).toJSON();
const actionrow2 = new Discord.Component().setType(1).setComponents(textinput2).toJSON();
this.interaction.popupModal({ customId: "ban_modal", title: "Ban User", components: [actionrow, actionrow2] });
}
}
module.exports = bancommand;