Skip to content

Commit

Permalink
βœ” Verified | XversE v2.0.1 πŸš€
Browse files Browse the repository at this point in the history
πŸš€ Merge pull request #8 from X-Nova1337/XversE_v2.0.1
-----------------------------------------------------------------
- - πŸš€ Added Mention-Prefix in XversE <3...
-----------------------------------------------------------------
- Update messageCreate.js
- Update package.json
- Update config.js
- Update .replit
-----------------------------------------------------------------
  • Loading branch information
Jarvis1337 authored Sep 2, 2024
2 parents 4924a84 + 7456632 commit 9a95ca3
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 48 deletions.
4 changes: 2 additions & 2 deletions .replit
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
97 changes: 53 additions & 44 deletions events/messageCreate.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
});
});

function escapeRegex(newprefix) {
return newprefix.replace(/[.*+?^${}()|[\]\\]/g, `\\$&`);
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion settings/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 9a95ca3

Please sign in to comment.