Idk What Im Doin
This commit is contained in:
parent
425f21a1f2
commit
193299d89e
7 changed files with 164 additions and 123 deletions
8
.idea/.gitignore
vendored
Normal file
8
.idea/.gitignore
vendored
Normal file
|
@ -0,0 +1,8 @@
|
|||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# Editor-based HTTP Client requests
|
||||
/httpRequests/
|
||||
# Datasource local storage ignored files
|
||||
/dataSources/
|
||||
/dataSources.local.xml
|
8
.idea/Discord_API_Bot.iml
Normal file
8
.idea/Discord_API_Bot.iml
Normal file
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="WEB_MODULE" version="4">
|
||||
<component name="NewModuleRootManager">
|
||||
<content url="file://$MODULE_DIR$" />
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
12
.idea/discord.xml
Normal file
12
.idea/discord.xml
Normal file
|
@ -0,0 +1,12 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="DiscordProjectSettings">
|
||||
<option name="show" value="ASK" />
|
||||
<option name="description" value="" />
|
||||
<option name="theme" value="material" />
|
||||
<option name="button1Title" value="" />
|
||||
<option name="button1Url" value="" />
|
||||
<option name="button2Title" value="" />
|
||||
<option name="button2Url" value="" />
|
||||
</component>
|
||||
</project>
|
8
.idea/modules.xml
Normal file
8
.idea/modules.xml
Normal file
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/Discord_API_Bot.iml" filepath="$PROJECT_DIR$/.idea/Discord_API_Bot.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
19
.idea/php.xml
Normal file
19
.idea/php.xml
Normal file
|
@ -0,0 +1,19 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="MessDetectorOptionsConfiguration">
|
||||
<option name="transferred" value="true" />
|
||||
</component>
|
||||
<component name="PHPCSFixerOptionsConfiguration">
|
||||
<option name="transferred" value="true" />
|
||||
</component>
|
||||
<component name="PHPCodeSnifferOptionsConfiguration">
|
||||
<option name="highlightLevel" value="WARNING" />
|
||||
<option name="transferred" value="true" />
|
||||
</component>
|
||||
<component name="PhpStanOptionsConfiguration">
|
||||
<option name="transferred" value="true" />
|
||||
</component>
|
||||
<component name="PsalmOptionsConfiguration">
|
||||
<option name="transferred" value="true" />
|
||||
</component>
|
||||
</project>
|
6
.idea/vcs.xml
Normal file
6
.idea/vcs.xml
Normal file
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
|
@ -1,132 +1,112 @@
|
|||
const a8_0x474e1e = function () {
|
||||
let _0x4c0a0e = true;
|
||||
return function (_0x5d79a8, _0x1f27c1) {
|
||||
const _0x3f8b2f = _0x4c0a0e ? function () {
|
||||
if (_0x1f27c1) {
|
||||
const _0x2b4a77 = _0x1f27c1.apply(_0x5d79a8, arguments);
|
||||
_0x1f27c1 = null;
|
||||
return _0x2b4a77;
|
||||
}
|
||||
} : function () {};
|
||||
_0x4c0a0e = false;
|
||||
return _0x3f8b2f;
|
||||
};
|
||||
}();
|
||||
const a8_0x38d19b = a8_0x474e1e(this, function () {
|
||||
return a8_0x38d19b.toString().search("(((.+)+)+)+$").toString().constructor(a8_0x38d19b).search("(((.+)+)+)+$");
|
||||
});
|
||||
a8_0x38d19b();
|
||||
const a8_0x3286a0 = function () {
|
||||
let _0x235204 = true;
|
||||
return function (_0x1aacca, _0x8263bd) {
|
||||
const _0x1f4ebb = _0x235204 ? function () {
|
||||
if (_0x8263bd) {
|
||||
const _0x587b1f = _0x8263bd.apply(_0x1aacca, arguments);
|
||||
_0x8263bd = null;
|
||||
return _0x587b1f;
|
||||
}
|
||||
} : function () {};
|
||||
_0x235204 = false;
|
||||
return _0x1f4ebb;
|
||||
};
|
||||
}();
|
||||
(function () {
|
||||
a8_0x3286a0(this, function () {
|
||||
const _0x324afa = new RegExp("function *\\( *\\)");
|
||||
const _0x5e3476 = new RegExp("\\+\\+ *(?:[a-zA-Z_$][0-9a-zA-Z_$]*)", 'i');
|
||||
const _0x1f4ede = a8_0x17bfc5("init");
|
||||
if (!_0x324afa.test(_0x1f4ede + "chain") || !_0x5e3476.test(_0x1f4ede + "input")) {
|
||||
_0x1f4ede('0');
|
||||
} else {
|
||||
a8_0x17bfc5();
|
||||
}
|
||||
})();
|
||||
})();
|
||||
const {
|
||||
ticket_settings
|
||||
} = require('../config');
|
||||
const {
|
||||
queryMulti
|
||||
} = require("../helpers/helper");
|
||||
const { ticket_settings } = require('../config');
|
||||
const { queryMulti } = require("../helpers/helper");
|
||||
const {
|
||||
SlashCommandBuilder,
|
||||
PermissionFlagsBits,
|
||||
EmbedBuilder
|
||||
} = require("discord.js");
|
||||
const a8_0x4ed738 = {
|
||||
"name": "Short",
|
||||
"value": "Short"
|
||||
};
|
||||
const a8_0xad3c43 = {
|
||||
"name": "Paragraph",
|
||||
"value": "Paragraph"
|
||||
};
|
||||
const a8_0x410cbe = {
|
||||
"name": "Yes",
|
||||
"value": "Yes"
|
||||
};
|
||||
const a8_0x3e2f57 = {
|
||||
name: 'No',
|
||||
"value": 'No'
|
||||
};
|
||||
|
||||
const answerTypeChoices = [
|
||||
{
|
||||
name: "Short",
|
||||
value: "Short"
|
||||
},
|
||||
{
|
||||
name: "Paragraph",
|
||||
value: "Paragraph"
|
||||
}
|
||||
];
|
||||
|
||||
const answerRequiredChoices = [
|
||||
{
|
||||
name: "Yes",
|
||||
value: "Yes"
|
||||
},
|
||||
{
|
||||
name: "No",
|
||||
value: "No"
|
||||
}
|
||||
];
|
||||
|
||||
module.exports = {
|
||||
'data': new SlashCommandBuilder().setName("create-question").setDescription("Create new question form ticket form").addStringOption(_0xd18c4d => _0xd18c4d.setName("option").setRequired(true).setAutocomplete(true).setDescription("Select the ticket option.")).addStringOption(_0xc292be => _0xc292be.setMaxLength(0x2d).setRequired(true).setName('question').setDescription("Enter a question.")).addStringOption(_0x25b049 => _0x25b049.setRequired(true).setName("place-holder").setDescription("Enter a place holder for answer area.")).addStringOption(_0x5d88ac => _0x5d88ac.setRequired(true).setName("answer-type").addChoices(a8_0x4ed738, a8_0xad3c43).setDescription("Select type of the answer.")).addStringOption(_0x3b630d => _0x3b630d.setRequired(true).setName("answer-required").addChoices(a8_0x410cbe, a8_0x3e2f57).setDescription("Select whether the answer is required or not.")).setDefaultMemberPermissions(PermissionFlagsBits.Administrator),
|
||||
async 'run'(_0x493d1f, _0x498f14) {
|
||||
let {
|
||||
options: _0x303722
|
||||
} = _0x498f14;
|
||||
const _0x966cc8 = {
|
||||
"ephemeral": true
|
||||
data: new SlashCommandBuilder()
|
||||
.setName("create-question")
|
||||
.setDescription("Create new question form ticket form")
|
||||
.addStringOption(option =>
|
||||
option
|
||||
.setName("option")
|
||||
.setRequired(true)
|
||||
.setAutocomplete(true)
|
||||
.setDescription("Select the ticket option.")
|
||||
)
|
||||
.addStringOption(option =>
|
||||
option
|
||||
.setMaxLength(45)
|
||||
.setRequired(true)
|
||||
.setName('question')
|
||||
.setDescription("Enter a question.")
|
||||
)
|
||||
.addStringOption(option =>
|
||||
option
|
||||
.setRequired(true)
|
||||
.setName("place-holder")
|
||||
.setDescription("Enter a place holder for answer area.")
|
||||
)
|
||||
.addStringOption(option =>
|
||||
option
|
||||
.setRequired(true)
|
||||
.setName("answer-type")
|
||||
.addChoices(...answerTypeChoices)
|
||||
.setDescription("Select type of the answer.")
|
||||
)
|
||||
.addStringOption(option =>
|
||||
option
|
||||
.setRequired(true)
|
||||
.setName("answer-required")
|
||||
.addChoices(...answerRequiredChoices)
|
||||
.setDescription("Select whether the answer is required or not.")
|
||||
)
|
||||
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator),
|
||||
|
||||
async run(client, interaction) {
|
||||
const { options } = interaction;
|
||||
const ephemeral = true;
|
||||
|
||||
await interaction.deferReply({ ephemeral });
|
||||
|
||||
const ticketOption = options.getString("option");
|
||||
const question = options.getString('question');
|
||||
const placeHolder = options.getString("place-holder");
|
||||
const answerType = options.getString("answer-type");
|
||||
const answerRequired = options.getString("answer-required") === "Yes";
|
||||
|
||||
const authorName = {
|
||||
name: interaction.guild.name
|
||||
};
|
||||
await _0x498f14.deferReply(_0x966cc8);
|
||||
let _0xef5166 = _0x303722.getString("option");
|
||||
let _0x231340 = _0x303722.getString('question');
|
||||
let _0x337111 = _0x303722.getString("place-holder");
|
||||
let _0x46dc09 = _0x303722.getString("answer-type");
|
||||
let _0x4272a7 = !!(_0x303722.getString("answer-required") == "Yes");
|
||||
const _0x2889c5 = {
|
||||
'name': _0x498f14.guild.name
|
||||
};
|
||||
let _0x4532b4 = new EmbedBuilder().setColor(ticket_settings.embed_color).setAuthor(_0x2889c5).setThumbnail(ticket_settings.ticket_thumbnail).setDescription("You can't have more than 5 questions at the ticket form!");
|
||||
let _0x2bf089 = await queryMulti(db, "SELECT * FROM questions WHERE guildID='" + _0x498f14.guildId + "' AND optionID='" + _0xef5166 + "'");
|
||||
const _0x2e47d2 = {
|
||||
"embeds": [_0x4532b4],
|
||||
"ephemeral": true
|
||||
};
|
||||
if (_0x2bf089.length > 0x5) {
|
||||
return _0x498f14.editReply(_0x2e47d2);
|
||||
|
||||
let embed = new EmbedBuilder()
|
||||
.setColor(ticket_settings.embed_color)
|
||||
.setAuthor(authorName)
|
||||
.setThumbnail(ticket_settings.ticket_thumbnail)
|
||||
.setDescription("You can't have more than 5 questions at the ticket form!");
|
||||
|
||||
const existingQuestions = await queryMulti(
|
||||
db,
|
||||
"SELECT * FROM questions WHERE guildID=? AND optionID=?",
|
||||
[interaction.guildId, ticketOption]
|
||||
);
|
||||
|
||||
if (existingQuestions.length > 5) {
|
||||
return interaction.editReply({ embeds: [embed], ephemeral });
|
||||
}
|
||||
db.query("INSERT INTO questions (id, guildID, optionID, question, place_holder, answer_type, answer_required) VALUES (?, ?, ?, ?, ?, ?, ?)", [_0x498f14.id, _0x498f14.guildId, _0xef5166, _0x231340, _0x337111, _0x46dc09, _0x4272a7]);
|
||||
_0x4532b4.setDescription("You successfully added new question to ticket form!");
|
||||
const _0x36a251 = {
|
||||
"embeds": [_0x4532b4],
|
||||
"ephemeral": true
|
||||
};
|
||||
return _0x498f14.editReply(_0x36a251);
|
||||
|
||||
await db.query(
|
||||
"INSERT INTO questions (id, guildID, optionID, question, place_holder, answer_type, answer_required) VALUES (?, ?, ?, ?, ?, ?, ?)",
|
||||
[interaction.id, interaction.guildId, ticketOption, question, placeHolder, answerType, answerRequired]
|
||||
);
|
||||
|
||||
embed.setDescription("You successfully added new question to ticket form!");
|
||||
|
||||
return interaction.editReply({ embeds: [embed], ephemeral });
|
||||
}
|
||||
};
|
||||
function a8_0x17bfc5(_0x305cb3) {
|
||||
function _0x220f08(_0x54a7b0) {
|
||||
if (typeof _0x54a7b0 === 'string') {
|
||||
return function (_0x31a1c0) {}.constructor("while (true) {}").apply("counter");
|
||||
} else {
|
||||
if (('' + _0x54a7b0 / _0x54a7b0).length !== 0x1 || _0x54a7b0 % 0x14 === 0x0) {
|
||||
(function () {
|
||||
return true;
|
||||
}).constructor("debugger").call('action');
|
||||
} else {
|
||||
(function () {
|
||||
return false;
|
||||
}).constructor("debugger").apply("stateObject");
|
||||
}
|
||||
}
|
||||
_0x220f08(++_0x54a7b0);
|
||||
}
|
||||
try {
|
||||
if (_0x305cb3) {
|
||||
return _0x220f08;
|
||||
} else {
|
||||
_0x220f08(0x0);
|
||||
}
|
||||
} catch (_0x4b05c7) {}
|
||||
}
|
Loading…
Reference in a new issue