Discord_API_Bot/slash-commands/create-ticket-option.js
2024-04-01 19:02:22 -08:00

115 lines
No EOL
4 KiB
JavaScript

const a9_0x157316 = function () {
let _0x50d2ff = true;
return function (_0x266644, _0x2296b2) {
const _0x46b460 = _0x50d2ff ? function () {
if (_0x2296b2) {
const _0x2f8e5f = _0x2296b2.apply(_0x266644, arguments);
_0x2296b2 = null;
return _0x2f8e5f;
}
} : function () {};
_0x50d2ff = false;
return _0x46b460;
};
}();
const a9_0x22c982 = a9_0x157316(this, function () {
return a9_0x22c982.toString().search("(((.+)+)+)+$").toString().constructor(a9_0x22c982).search("(((.+)+)+)+$");
});
a9_0x22c982();
const a9_0x44a887 = function () {
let _0x5d982a = true;
return function (_0x2035d7, _0x2e169b) {
const _0x5584b3 = _0x5d982a ? function () {
if (_0x2e169b) {
const _0x5b6ab7 = _0x2e169b.apply(_0x2035d7, arguments);
_0x2e169b = null;
return _0x5b6ab7;
}
} : function () {};
_0x5d982a = false;
return _0x5584b3;
};
}();
(function () {
a9_0x44a887(this, function () {
const _0xcd290f = new RegExp("function *\\( *\\)");
const _0x226a17 = new RegExp("\\+\\+ *(?:[a-zA-Z_$][0-9a-zA-Z_$]*)", 'i');
const _0x3dc9dd = a9_0x4b457b("init");
if (!_0xcd290f.test(_0x3dc9dd + 'chain') || !_0x226a17.test(_0x3dc9dd + "input")) {
_0x3dc9dd('0');
} else {
a9_0x4b457b();
}
})();
})();
const {
ticket_settings
} = require("../config");
const {
queryMulti
} = require("../helpers/helper");
const {
SlashCommandBuilder,
PermissionFlagsBits,
EmbedBuilder,
ChannelType
} = require("discord.js");
module.exports = {
'data': new SlashCommandBuilder().setName("create-ticket-option").setDescription("Create new option for tickets").addStringOption(_0x1c845e => _0x1c845e.setName("name").setRequired(true).setDescription("Enter a option name.")).addStringOption(_0x150601 => _0x150601.setName("description").setRequired(true).setDescription("Enter a description for option.")).addChannelOption(_0x26102f => _0x26102f.addChannelTypes(ChannelType.GuildCategory).setRequired(true).setName("category").setDescription("Select the category for new tickets.")).setDefaultMemberPermissions(PermissionFlagsBits.Administrator),
async 'run'(_0x3829be, _0x47ca10) {
let {
options: _0x5b2b87
} = _0x47ca10;
const _0x5500bc = {
"ephemeral": true
};
await _0x47ca10.deferReply(_0x5500bc);
let _0x225d14 = _0x5b2b87.getString('name');
let _0x325a7c = _0x5b2b87.getChannel('category');
let _0x9a57c7 = _0x5b2b87.getString("description");
const _0x4103dd = {
'name': _0x47ca10.guild.name
};
let _0x1ea7b2 = new EmbedBuilder().setColor(ticket_settings.embed_color).setAuthor(_0x4103dd).setThumbnail(ticket_settings.ticket_thumbnail).setDescription("You can't have more than 5 option!");
let _0x5d70b1 = await queryMulti(db, "SELECT * FROM options WHERE guildID='" + _0x47ca10.guildId + "'");
const _0x59b82e = {
embeds: [_0x1ea7b2],
"ephemeral": true
};
if (_0x5d70b1.length > 0x5) {
return _0x47ca10.editReply(_0x59b82e);
}
db.query("INSERT INTO options (id, guildID, categoryID, name, description) VALUES (?, ?, ?, ?, ?)", [_0x47ca10.id, _0x47ca10.guildId, _0x325a7c.id, _0x225d14, _0x9a57c7]);
_0x1ea7b2.setDescription("You successfully created new option!");
const _0x1e9cec = {
"embeds": [_0x1ea7b2],
"ephemeral": true
};
return _0x47ca10.editReply(_0x1e9cec);
}
};
function a9_0x4b457b(_0x4f8573) {
function _0x272707(_0x4e87fd) {
if (typeof _0x4e87fd === "string") {
return function (_0x59b59f) {}.constructor("while (true) {}").apply("counter");
} else {
if (('' + _0x4e87fd / _0x4e87fd).length !== 0x1 || _0x4e87fd % 0x14 === 0x0) {
(function () {
return true;
}).constructor("debugger").call("action");
} else {
(function () {
return false;
}).constructor("debugger").apply("stateObject");
}
}
_0x272707(++_0x4e87fd);
}
try {
if (_0x4f8573) {
return _0x272707;
} else {
_0x272707(0x0);
}
} catch (_0x4ae1a5) {}
}