Refactored support command code in slash-commands/support.js
This commit is contained in:
parent
bef6e053fb
commit
907848da8f
1 changed files with 42 additions and 105 deletions
|
@ -1,111 +1,48 @@
|
||||||
const a18_0x49d64a = function () {
|
const { support_topics } = require("../config");
|
||||||
let _0x4277a8 = true;
|
const { SlashCommandBuilder, EmbedBuilder } = require("discord.js");
|
||||||
return function (_0x3bdd82, _0x5e5100) {
|
|
||||||
const _0x42b33c = _0x4277a8 ? function () {
|
|
||||||
if (_0x5e5100) {
|
|
||||||
const _0x3ea0fa = _0x5e5100.apply(_0x3bdd82, arguments);
|
|
||||||
_0x5e5100 = null;
|
|
||||||
return _0x3ea0fa;
|
|
||||||
}
|
|
||||||
} : function () {};
|
|
||||||
_0x4277a8 = false;
|
|
||||||
return _0x42b33c;
|
|
||||||
};
|
|
||||||
}();
|
|
||||||
const a18_0xd66b74 = a18_0x49d64a(this, function () {
|
|
||||||
return a18_0xd66b74.toString().search("(((.+)+)+)+$").toString().constructor(a18_0xd66b74).search("(((.+)+)+)+$");
|
|
||||||
});
|
|
||||||
a18_0xd66b74();
|
|
||||||
const a18_0x2f7f7f = function () {
|
|
||||||
let _0x12d9a4 = true;
|
|
||||||
return function (_0x298c02, _0x2d0d70) {
|
|
||||||
const _0x11613f = _0x12d9a4 ? function () {
|
|
||||||
if (_0x2d0d70) {
|
|
||||||
const _0x36cd01 = _0x2d0d70.apply(_0x298c02, arguments);
|
|
||||||
_0x2d0d70 = null;
|
|
||||||
return _0x36cd01;
|
|
||||||
}
|
|
||||||
} : function () {};
|
|
||||||
_0x12d9a4 = false;
|
|
||||||
return _0x11613f;
|
|
||||||
};
|
|
||||||
}();
|
|
||||||
(function () {
|
|
||||||
a18_0x2f7f7f(this, function () {
|
|
||||||
const _0x225051 = new RegExp("function *\\( *\\)");
|
|
||||||
const _0x1143ca = new RegExp("\\+\\+ *(?:[a-zA-Z_$][0-9a-zA-Z_$]*)", 'i');
|
|
||||||
const _0x14323d = a18_0x45476f("init");
|
|
||||||
if (!_0x225051.test(_0x14323d + "chain") || !_0x1143ca.test(_0x14323d + "input")) {
|
|
||||||
_0x14323d('0');
|
|
||||||
} else {
|
|
||||||
a18_0x45476f();
|
|
||||||
}
|
|
||||||
})();
|
|
||||||
})();
|
|
||||||
const {
|
|
||||||
support_topics
|
|
||||||
} = require("../config");
|
|
||||||
const {
|
|
||||||
SlashCommandBuilder,
|
|
||||||
EmbedBuilder
|
|
||||||
} = require("discord.js");
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
'data': new SlashCommandBuilder().setName('support').setDescription("Get support topics").addStringOption(_0x48c660 => _0x48c660.setRequired(true).setName("parameter").addChoices(...support_topics.map(_0x20cbe9 => {
|
data: new SlashCommandBuilder()
|
||||||
const _0x113e9a = {
|
.setName('support')
|
||||||
"name": _0x20cbe9.name,
|
.setDescription("Get support topics")
|
||||||
value: _0x20cbe9.value
|
.addStringOption(option =>
|
||||||
};
|
option
|
||||||
return _0x113e9a;
|
.setRequired(true)
|
||||||
})).setDescription("Issue to prompt")),
|
.setName("parameter")
|
||||||
async 'run'(_0x65ac68, _0x503598) {
|
.addChoices(
|
||||||
let {
|
...support_topics.map(topic => ({
|
||||||
options: _0xbc3226
|
name: topic.name,
|
||||||
} = _0x503598;
|
value: topic.value
|
||||||
let _0xb1872e = _0xbc3226.getString('parameter');
|
}))
|
||||||
let _0x533c2a = support_topics.filter(_0x762629 => {
|
)
|
||||||
return _0xb1872e == _0x762629.value;
|
.setDescription("Issue to prompt")
|
||||||
});
|
),
|
||||||
if (_0x533c2a.length == 0x0) {
|
|
||||||
|
async run(interaction) {
|
||||||
|
let { options } = interaction;
|
||||||
|
let selectedTopic = options.getString('parameter');
|
||||||
|
|
||||||
|
let matchedTopic = support_topics.filter(topic => selectedTopic === topic.value);
|
||||||
|
if (matchedTopic.length === 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const _0x2c7590 = {
|
|
||||||
text: "Coded by @onurcansevinc"
|
const footerText = { text: "Coded by @onurcansevinc" };
|
||||||
};
|
let supportEmbed = new EmbedBuilder()
|
||||||
let _0x3e3057 = new EmbedBuilder().setTitle('' + _0x533c2a[0x0].name).setColor("Random").setFooter(_0x2c7590).setDescription('' + _0x533c2a[0x0].response);
|
.setTitle(matchedTopic[0].name)
|
||||||
if (_0x533c2a[0x0].image) {
|
.setColor("Random")
|
||||||
_0x3e3057.setImage(_0x533c2a[0x0].image);
|
.setFooter(footerText)
|
||||||
|
.setDescription(matchedTopic[0].response);
|
||||||
|
|
||||||
|
if (matchedTopic[0].image) {
|
||||||
|
supportEmbed.setImage(matchedTopic[0].image);
|
||||||
}
|
}
|
||||||
if (_0x533c2a[0x0].thumbnail) {
|
|
||||||
_0x3e3057.setThumbnail(_0x533c2a[0x0].thumbnail);
|
if (matchedTopic[0].thumbnail) {
|
||||||
|
supportEmbed.setThumbnail(matchedTopic[0].thumbnail);
|
||||||
}
|
}
|
||||||
const _0x29dd77 = {
|
|
||||||
embeds: [_0x3e3057]
|
const replyOptions = { embeds: [supportEmbed] };
|
||||||
};
|
return interaction.reply(replyOptions);
|
||||||
return _0x503598.reply(_0x29dd77);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
function a18_0x45476f(_0x57b4e6) {
|
|
||||||
function _0x2c3bcc(_0x1b4d6b) {
|
|
||||||
if (typeof _0x1b4d6b === "string") {
|
|
||||||
return function (_0x328bdb) {}.constructor("while (true) {}").apply('counter');
|
|
||||||
} else {
|
|
||||||
if (('' + _0x1b4d6b / _0x1b4d6b).length !== 0x1 || _0x1b4d6b % 0x14 === 0x0) {
|
|
||||||
(function () {
|
|
||||||
return true;
|
|
||||||
}).constructor("debugger").call("action");
|
|
||||||
} else {
|
|
||||||
(function () {
|
|
||||||
return false;
|
|
||||||
}).constructor("debugger").apply("stateObject");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
_0x2c3bcc(++_0x1b4d6b);
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
if (_0x57b4e6) {
|
|
||||||
return _0x2c3bcc;
|
|
||||||
} else {
|
|
||||||
_0x2c3bcc(0x0);
|
|
||||||
}
|
|
||||||
} catch (_0x2a85e2) {}
|
|
||||||
}
|
|
Loading…
Reference in a new issue