initial commit - base code
This commit is contained in:
15 files changed
+2257
No files matched your search
@@ -0,0 +1,144 @@
|
||||
const { EmbedBuilder, ActionRowBuilder, SelectMenuBuilder } = require("discord.js");
|
||||
const settings = require('../config/settingsHelp');
|
||||
|
||||
module.exports = {
|
||||
name: "help",
|
||||
debug: false,
|
||||
global: true,
|
||||
description: "Get information on a specific command",
|
||||
usage: "[option]",
|
||||
permissions: {
|
||||
channel: ["VIEW_CHANNEL", "SEND_MESSAGES", "EMBED_LINKS"],
|
||||
member: [],
|
||||
},
|
||||
options: [
|
||||
{
|
||||
name: "commands",
|
||||
description: "List all commands",
|
||||
value: "commands",
|
||||
type: 1,
|
||||
options: [{
|
||||
name: "command",
|
||||
description: "Get information on a specific command",
|
||||
value: "command",
|
||||
type: 3,
|
||||
required: false,
|
||||
}]
|
||||
},
|
||||
{
|
||||
name: "support",
|
||||
description: "Get support for Applicatz",
|
||||
value: "support",
|
||||
type: 1,
|
||||
},
|
||||
{
|
||||
name: "credits",
|
||||
description: "Applicantz Credits",
|
||||
value: "credits",
|
||||
type: 1,
|
||||
},
|
||||
{
|
||||
name: "version",
|
||||
description: "Current version of the bot",
|
||||
value: "version",
|
||||
type: 1,
|
||||
}
|
||||
],
|
||||
SlashCommand: {
|
||||
/**
|
||||
*
|
||||
* @param {require("../structures/QuarksBot")} client
|
||||
* @param {import("discord.js").Message} message
|
||||
* @param {string[]} args
|
||||
* @param {*} param3
|
||||
*/
|
||||
|
||||
run: async (client, interaction, args) => {
|
||||
if (args[0].name == 'version') {
|
||||
const versionEmbed = new EmbedBuilder()
|
||||
.setTitle(`Current Applicantz Version`)
|
||||
.setDescription(client.config.Version);
|
||||
|
||||
return interaction.send({ embeds: [versionEmbed] });
|
||||
} else if (args[0].name == 'commands') {
|
||||
let Commands = client.commands.filter((cmd) => {
|
||||
return !cmd.debug
|
||||
}).map((cmd) =>
|
||||
`\`/${cmd.name}${cmd.usage ? " " + cmd.usage : ""}\` - ${cmd.description}`
|
||||
);
|
||||
|
||||
let Embed = new EmbedBuilder()
|
||||
.setTitle('Commands')
|
||||
.setColor(client.config.Colors.Default)
|
||||
.setDescription(`${Commands.join("\n")}
|
||||
|
||||
Applicantz Version: v${client.config.Version}`);
|
||||
if (!args[0].options[0]) return interaction.send({ embeds: [Embed] });
|
||||
else {
|
||||
let cmd =
|
||||
client.commands.get(args[0].options[0].value) ||
|
||||
client.commands.find(
|
||||
(x) => x.aliases && x.aliases.includes(args[0].options[0].value)
|
||||
);
|
||||
if (!cmd)
|
||||
return client.sendError(
|
||||
interaction,
|
||||
`❌ | Unable to find that command.`
|
||||
);
|
||||
|
||||
let embed = new EmbedBuilder()
|
||||
.setDescription(cmd.description)
|
||||
.setColor(client.config.Colors.Green)
|
||||
.setTitle(`How to use /${cmd.name} command`)
|
||||
|
||||
if (cmd.SlashCommand.options && cmd.SlashCommand.options[0].type == 1) {
|
||||
let description = `${cmd.description}\n\n**Usage**\n`;
|
||||
|
||||
for (let i = 0; i < cmd.SlashCommand.options.length; i++) {
|
||||
if (cmd.SlashCommand.options[i].type == 1) {
|
||||
let param = '';
|
||||
if (cmd.SlashCommand.options[i].options) {
|
||||
param = cmd.SlashCommand.options[i].options.length > 0 ? ' ' : '';
|
||||
for (let j = 0; j < cmd.SlashCommand.options[i].options.length; j++) {
|
||||
if (cmd.SlashCommand.options[i].options[j].required) param += `[${cmd.SlashCommand.options[i].options[j].name}] `
|
||||
}
|
||||
}
|
||||
description += `\`/${cmd.name} ${cmd.SlashCommand.options[i].name}${param}\`\n${cmd.SlashCommand.options[i].description}\n\n`
|
||||
}
|
||||
}
|
||||
embed.setDescription(description);
|
||||
} else embed.addFields({ name: "Usage", value: `\`/${cmd.name}\`${cmd.usage ? " " + cmd.usage : ""}`, inline: true })
|
||||
|
||||
return interaction.send({ embeds: [embed] });
|
||||
}
|
||||
} else if (args[0].name == 'support') {
|
||||
const supportEmbed = new EmbedBuilder()
|
||||
.setColor(client.config.Colors.Default)
|
||||
.setDescription(`**__Applicantz Support__**
|
||||
|
||||
Are you experiencing troubles with Applicantz?
|
||||
Do you have questions or concerns?
|
||||
Do you require help to use the bot?
|
||||
Do you have a feature you'd like to see?
|
||||
|
||||
Join the support server to have all your needs fulfilled.
|
||||
╚➤ ${client.config.SupportServer}
|
||||
`)
|
||||
|
||||
return interaction.send({ embeds: [supportEmbed] });
|
||||
|
||||
} else if (args[0].name == 'credits') {
|
||||
const creditsEmbed = new EmbedBuilder()
|
||||
.setColor(client.config.Colors.Default)
|
||||
.setTitle('QuarksBot Credits')
|
||||
.setDescription(`
|
||||
**Bot Author:** McDazzzled#5307
|
||||
|
||||
${client.config.SupportServer}
|
||||
`);
|
||||
|
||||
return interaction.send({ embeds: [creditsEmbed] })
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
@@ -0,0 +1,31 @@
|
||||
const { EmbedBuilder } = require('discord.js');
|
||||
|
||||
module.exports = {
|
||||
name: "ping",
|
||||
debug: true,
|
||||
global: true,
|
||||
description: "Test bot activity",
|
||||
usage: "",
|
||||
permissions: {
|
||||
channel: ["VIEW_CHANNEL", "SEND_MESSAGES", "EMBED_LINKS"],
|
||||
member: [],
|
||||
},
|
||||
options: [],
|
||||
SlashCommand: {
|
||||
/**
|
||||
*
|
||||
* @param {require("../structures/QuarksBot")} client
|
||||
* @param {import("discord.js").Message} message
|
||||
* @param {string[]} args
|
||||
* @param {*} param3
|
||||
*/
|
||||
run: async (client, interaction, args, start) => {
|
||||
const end = new Date().getTime();
|
||||
const pingEmbed = new EmbedBuilder()
|
||||
.setDescription(`🏓 **Pong!** Bot ping: ${end - start}ms`)
|
||||
.setColor(client.config.Colors.Default);
|
||||
|
||||
return interaction.send({ embeds: [pingEmbed] });
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
const { EmbedBuilder } = require('discord.js');
|
||||
|
||||
module.exports = {
|
||||
name: "stats",
|
||||
debug: true,
|
||||
global: true,
|
||||
description: "check bot statistics",
|
||||
usage: "",
|
||||
permissions: {
|
||||
channel: ["VIEW_CHANNEL", "SEND_MESSAGES", "EMBED_LINKS"],
|
||||
member: [],
|
||||
},
|
||||
options: [],
|
||||
SlashCommand: {
|
||||
/**
|
||||
*
|
||||
* @param {require("../structures/QuarksBot")} client
|
||||
* @param {import("discord.js").Message} message
|
||||
* @param {string[]} args
|
||||
* @param {*} param3
|
||||
*/
|
||||
run: async (client, interaction, args, start) => {
|
||||
const end = new Date().getTime();
|
||||
const stats = new EmbedBuilder()
|
||||
.setColor(client.config.Colors.Default)
|
||||
.setTitle('QuarksBot Statistics')
|
||||
.addFields(
|
||||
{ name: 'Guilds', value: `${client.guilds.cache.size}`, inline: true },
|
||||
{ name: 'Users', value: `${client.users.cache.size}`, inline: true },
|
||||
{ name: 'Latency', value: `${end - start}ms`, inline: true },
|
||||
{ name: 'Uptime', value: `${client.secondsToDhms(process.uptime().toFixed(2))}`, inline: true },
|
||||
{ name: 'Bot Version', value: `${client.config.Dev} v${client.config.Version}`, inline: true },
|
||||
{ name: 'Discord Version', value: 'Discord.js v14.3.0', inline: true },
|
||||
)
|
||||
|
||||
return interaction.send({ embeds: [stats] })
|
||||
},
|
||||
},
|
||||
}
|
||||
Reference in new issue
Block a user