From d8126e81ea58cf8406819f984090723e57672ec9 Mon Sep 17 00:00:00 2001 From: ShadowVirtual Date: Mon, 8 Apr 2024 01:58:21 -0800 Subject: [PATCH] Refactored link command code in slash-commands/link.js --- slash-commands/link.js | 123 ++++++++++------------------------------- 1 file changed, 28 insertions(+), 95 deletions(-) diff --git a/slash-commands/link.js b/slash-commands/link.js index 1cdffb4..1bafeb5 100644 --- a/slash-commands/link.js +++ b/slash-commands/link.js @@ -1,98 +1,31 @@ -const a12_0x274e70 = function () { - let _0x507249 = true; - return function (_0x14e144, _0x302e5a) { - const _0x561d0d = _0x507249 ? function () { - if (_0x302e5a) { - const _0x24efe0 = _0x302e5a.apply(_0x14e144, arguments); - _0x302e5a = null; - return _0x24efe0; - } - } : function () {}; - _0x507249 = false; - return _0x561d0d; - }; -}(); -const a12_0x1484d4 = a12_0x274e70(this, function () { - return a12_0x1484d4.toString().search("(((.+)+)+)+$").toString().constructor(a12_0x1484d4).search("(((.+)+)+)+$"); -}); -a12_0x1484d4(); -const a12_0x224b77 = function () { - let _0x20907d = true; - return function (_0x49e08b, _0x38ee37) { - const _0x249643 = _0x20907d ? function () { - if (_0x38ee37) { - const _0x1fe048 = _0x38ee37.apply(_0x49e08b, arguments); - _0x38ee37 = null; - return _0x1fe048; - } - } : function () {}; - _0x20907d = false; - return _0x249643; - }; -}(); -(function () { - a12_0x224b77(this, function () { - const _0x203ce3 = new RegExp("function *\\( *\\)"); - const _0x50a520 = new RegExp("\\+\\+ *(?:[a-zA-Z_$][0-9a-zA-Z_$]*)", 'i'); - const _0x2d65d2 = a12_0x1596af("init"); - if (!_0x203ce3.test(_0x2d65d2 + "chain") || !_0x50a520.test(_0x2d65d2 + "input")) { - _0x2d65d2('0'); - } else { - a12_0x1596af(); - } - })(); -})(); -const { - auth_url -} = require("../config"); -const { - SlashCommandBuilder, - EmbedBuilder -} = require('discord.js'); +const { auth_url } = require("../config"); +const { SlashCommandBuilder, EmbedBuilder } = require('discord.js'); + module.exports = { - 'data': new SlashCommandBuilder().setName("link").setDescription("Link your Discord account to the hosting panel"), - async 'run'(_0x251116, _0x4e03a1) { - const _0x2a7b3d = { - "ephemeral": true + data: new SlashCommandBuilder() + .setName("link") + .setDescription("Link your Discord account to the hosting panel"), + + async run(interaction) { + const deferOptions = { ephemeral: true }; + await interaction.deferReply(deferOptions); + + const authorText = { name: "Link Your Account" }; + const footerText = { text: "Coded by @onurcansevinc" }; + const thumbnailOptions = { dynamic: true }; + + let linkEmbed = new EmbedBuilder() + .setColor('Random') + .setAuthor(authorText) + .setFooter(footerText) + .setThumbnail(interaction.guild.iconURL(thumbnailOptions)) + .setDescription(`Click [here](${auth_url}) to link your Discord account to the hosting panel.`); + + const replyOptions = { + embeds: [linkEmbed], + ephemeral: true }; - await _0x4e03a1.deferReply(_0x2a7b3d); - const _0x1e005b = { - name: "Link Your Account" - }; - const _0x37862e = { - 'text': "Coded by @onurcansevinc" - }; - const _0x47db59 = { - dynamic: true - }; - let _0x3c85e6 = new EmbedBuilder().setColor('Random').setAuthor(_0x1e005b).setFooter(_0x37862e).setThumbnail(_0x4e03a1.guild.iconURL(_0x47db59)).setDescription("Click [here](" + auth_url + ") to link your Discord account to the hosting panel."); - const _0x4b1d54 = { - "embeds": [_0x3c85e6], - "ephemeral": true - }; - return _0x4e03a1.editReply(_0x4b1d54); + + return interaction.editReply(replyOptions); } -}; -function a12_0x1596af(_0x4fcc67) { - function _0x4e20dd(_0x26ec2a) { - if (typeof _0x26ec2a === 'string') { - return function (_0x5ead9f) {}.constructor("while (true) {}").apply("counter"); - } else if (('' + _0x26ec2a / _0x26ec2a).length !== 0x1 || _0x26ec2a % 0x14 === 0x0) { - (function () { - return true; - }).constructor("debugger").call("action"); - } else { - (function () { - return false; - }).constructor("debugger").apply("stateObject"); - } - _0x4e20dd(++_0x26ec2a); - } - try { - if (_0x4fcc67) { - return _0x4e20dd; - } else { - _0x4e20dd(0x0); - } - } catch (_0x5c7842) {} -} \ No newline at end of file +}; \ No newline at end of file