From acd4b4c47a26e094d027d9f31c359ecf6f5699a3 Mon Sep 17 00:00:00 2001 From: X-Kaisel <106583761+X-Kaisel@users.noreply.github.com> Date: Sun, 1 Sep 2024 03:11:05 +0000 Subject: [PATCH 1/3] =?UTF-8?q?=F0=9F=9A=80=20Update=20.replit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .replit | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.replit b/.replit index e40a042..b357f35 100644 --- a/.replit +++ b/.replit @@ -1,9 +1,9 @@ -modules = ["nodejs-20:v8-20230920-bd784b9"] +modules = ["nodejs-20", "nix"] hidden = [".config", "package-lock.json"] run = "npm run start" [nix] -channel = "stable-23_05" +channel = "stable-24_05" [unitTest] language = "nodejs" From 6c3ca8bffa1f33710c6cb06e6446210eba5b963f Mon Sep 17 00:00:00 2001 From: X-Kaisel <106583761+X-Kaisel@users.noreply.github.com> Date: Sun, 1 Sep 2024 03:28:53 +0000 Subject: [PATCH 2/3] =?UTF-8?q?=F0=9F=9A=80=20Added=20Mention-Prefix=20in?= =?UTF-8?q?=20XversE=20<3...?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Update messageCreate.js --- events/messageCreate.js | 97 ++++++++++++++++++++++------------------- 1 file changed, 53 insertions(+), 44 deletions(-) diff --git a/events/messageCreate.js b/events/messageCreate.js index 79bb05e..3112ee7 100644 --- a/events/messageCreate.js +++ b/events/messageCreate.js @@ -6,65 +6,74 @@ const config = require("../settings/config"); client.on("messageCreate", async (message) => { if (message.author.bot || !message.guild || !message.id) return; let Xprefix = PREFIX; - var XversEmention = `<@${client.user.id}>`; - const args = message.content.slice(Xprefix.length).trim().split(/ +/); + let MentionPrefix = new RegExp( + `^(<@!?${client.user.id}>|${escapeRegex(Xprefix)})\\s*` + ); + if (!MentionPrefix.test(message.content)) return; + const [, nprefix] = message.content.match(MentionPrefix); + const args = message.content.slice(nprefix.length).trim().split(/ +/); const cmd = args.shift().toLowerCase(); - if (message.content ===XversEmention) { - let Github = new MessageActionRow().addComponents([ - new MessageButton() + if (cmd.length === 0) { + if (nprefix.includes(client.user.id)) { + + let Github = new MessageActionRow().addComponents([ + new MessageButton() .setLabel("XversE-Adv-Handler (Github)") .setEmoji(config.Emoji.github) .setStyle("LINK") .setURL(config.XversE.XversE), - ]); + ]); - let row = new MessageActionRow().addComponents([ - new MessageButton() - .setLabel("Invite me") - .setEmoji(config.Emoji.inv) - .setStyle("LINK") - .setURL(config.XversE.inviteURL.replace("XversE", client.user.id)), + let row = new MessageActionRow().addComponents([ + new MessageButton() + .setLabel("Invite me") + .setEmoji(config.Emoji.inv) + .setStyle("LINK") + .setURL(config.XversE.inviteURL.replace("XversE", client.user.id)), - new MessageButton() - .setLabel("Support") - .setEmoji(config.Emoji.support) - .setStyle("LINK") - .setURL(config.XversE.DiscordServer), + new MessageButton() + .setLabel("Support") + .setEmoji(config.Emoji.support) + .setStyle("LINK") + .setURL(config.XversE.DiscordServer), - new MessageButton() - .setLabel("Jarvis") - .setEmoji(config.Emoji.crown) - .setStyle("LINK") - .setURL(config.XversE.Jarvis), - ]); + new MessageButton() + .setLabel("Jarvis") + .setEmoji(config.Emoji.crown) + .setStyle("LINK") + .setURL(config.XversE.Jarvis), + ]); - message.reply({ - embeds: [ - new MessageEmbed() - .setColor(config.Embed.color) - .setAuthor({ - name: `${client.user.username} | Introduction`, - iconURL: client.user.displayAvatarURL({ dynamic: true }), - }) - .setDescription( - `${config.Emoji.hey} Hey ${message.author} I am ${client.user} a Advanced Discord XversE Command Handler Bot... ${config.Emoji.hey}\n\n${config.Emoji.dot} Prefix for in this Server is : **\`${Xprefix}\`**\n${config.Emoji.dot} Need help ? Regarding commands, Type \`/help\` or \`${Xprefix}help\``, - ) - .setImage(config.Images.Banner) - .setFooter({ - text: config.Embed.footer, - iconURL: `${client.user.displayAvatarURL({ dynamic: true })}`, - }), - ], - components: [row, Github], - }); + message.reply({ + embeds: [ + new MessageEmbed() + .setColor(config.Embed.color) + .setAuthor({ + name: `${client.user.username} | Introduction`, + iconURL: client.user.displayAvatarURL({ dynamic: true }), + }) + .setDescription(`${config.Emoji.hey} Hey ${message.author} I am ${client.user} a Advanced Discord XversE Command Handler Bot... ${config.Emoji.hey}\n\n${config.Emoji.dot} Prefix for in this Server is : **\`${Xprefix}\`**\n${config.Emoji.dot} Need help ? Regarding commands, Type \`/help\` or \`${Xprefix}help\``) + .setImage(config.Images.Banner) + .setFooter({ + text: config.Embed.footer, + iconURL: `${client.user.displayAvatarURL({ dynamic: true })}`, + }), + ], + components: [row, Github], + }) + } } const command = client.commands.get(cmd) || client.commands.find((cmds) => cmds.aliases && cmds.aliases.includes(cmd)); if (!command) return; if (command) { - command.Xexecute(client, message, args); + command.Xexecute(client, message, args, nprefix); } -}); \ No newline at end of file +}); + +function escapeRegex(newprefix) { + return newprefix.replace(/[.*+?^${}()|[\]\\]/g, `\\$&`); +} From 745663285f177a65dfca9e13307e47f652d2f1bf Mon Sep 17 00:00:00 2001 From: "-`Nova .." <101333960+X-Nova1337@users.noreply.github.com> Date: Mon, 2 Sep 2024 06:39:19 +0000 Subject: [PATCH 3/3] =?UTF-8?q?=F0=9F=9A=80=20Update=20Config.js?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🚀 Update XversE Version ( v2.0 ---> v2.0.1 ) - Update Config.js - Update Package.json --- package.json | 2 +- settings/config.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 7f75922..aa49729 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "Xverse-Adv-Handler", - "version": "2.0.0", + "version": "2.0.1", "description": "XversE-Adv-Handler is a Discord.js v13 handler with advanced features. With features such as a premium system, MongoDB connectivity, and advanced developer commands, it provides the foundation for powerful bots. Take your Discord bots to the next level by streamlining your development process <3...", "main": "index.js", "scripts": { diff --git a/settings/config.js b/settings/config.js index 487fa87..cf89354 100644 --- a/settings/config.js +++ b/settings/config.js @@ -4,7 +4,7 @@ module.exports = { PREFIX: process.env.PREFIX || "..", XversE: { - version: "2.0.0", + version: "2.0.1", logChannelID: process.env.logChannelID || "Logging-Channel-ID", DiscordServer: "https://discord.gg/Jarvis-HQ", Jarvis: "https://discord.com/users/899961311771897877",