Merge branch 'dev' into 'main'
Dev See merge request illegitimate/illegitimate-bot!130
This commit is contained in:
@@ -10,20 +10,7 @@ module.exports = {
|
||||
type: "slash",
|
||||
dev: false,
|
||||
public: true,
|
||||
subcommands: [
|
||||
{
|
||||
name: "member",
|
||||
description: "Get info about a guild memeber",
|
||||
},
|
||||
{
|
||||
name: "info",
|
||||
description: "Get info about a guild.",
|
||||
},
|
||||
{
|
||||
name: "top",
|
||||
description: "Get the top guild members based on gexp",
|
||||
}
|
||||
],
|
||||
subcommands: true,
|
||||
|
||||
data: new SlashCommandBuilder()
|
||||
.setName("guild")
|
||||
@@ -89,8 +76,6 @@ module.exports = {
|
||||
|
||||
async execute(interaction) {
|
||||
|
||||
await interaction.deferReply()
|
||||
|
||||
const subcommand = interaction.options.getSubcommand()
|
||||
const embedColor = Number(color.replace("#", "0x"))
|
||||
|
||||
@@ -112,7 +97,7 @@ module.exports = {
|
||||
const footerText = interaction.guild ? interaction.guild.name : interaction.user.username
|
||||
const footerIcon = interaction.guild ? interaction.guild.iconURL({ dynamic: true }) : interaction.user.avatarURL({ dynamic: true })
|
||||
|
||||
await interaction.editReply({
|
||||
await interaction.reply({
|
||||
embeds: [{
|
||||
description: "This command is currently under development",
|
||||
color: embedColor,
|
||||
|
||||
@@ -4,6 +4,7 @@ const { color, devMessage } = require("../../../config/options.json")
|
||||
/** @param { import('discord.js').ChatInputCommandInteraction } interaction */
|
||||
|
||||
async function guildInfo(interaction) {
|
||||
await interaction.deferReply()
|
||||
|
||||
const query = interaction.options.getString("query")
|
||||
const type = interaction.options.getString("type") || "ign"
|
||||
|
||||
@@ -4,6 +4,8 @@ const { color, devMessage } = require("../../../config/options.json")
|
||||
/** @param { import('discord.js').ChatInputCommandInteraction } interaction */
|
||||
|
||||
async function guildMember(interaction) {
|
||||
await interaction.deferReply()
|
||||
|
||||
const ign = interaction.options.getString("ign")
|
||||
const embedColor = Number(color.replace("#", "0x"))
|
||||
|
||||
|
||||
@@ -6,6 +6,8 @@ const { redis } = require("../../utils/redis.js")
|
||||
/** @param { import('discord.js').ChatInputCommandInteraction } interaction */
|
||||
|
||||
async function guildTop(interaction) {
|
||||
await interaction.deferReply()
|
||||
|
||||
const query = interaction.options.getString("query")
|
||||
const type = interaction.options.getString("type") || "ign"
|
||||
let amount = interaction.options.getNumber("amount") || 10
|
||||
|
||||
@@ -27,17 +27,15 @@ module.exports = {
|
||||
if (command.public && !command.subcommands) {
|
||||
commands.push(command)
|
||||
} else if (command.public && command.subcommands) {
|
||||
const commandName = command.name
|
||||
const commandName = command.data.name
|
||||
|
||||
const subcommands = command.subcommands.map((subcommand) => {
|
||||
const subcommands = command.data.options.map((subcommand) => {
|
||||
return {
|
||||
name: commandName + " " + subcommand.name,
|
||||
description: subcommand.description
|
||||
}
|
||||
})
|
||||
|
||||
console.log(subcommands)
|
||||
|
||||
for (const subcommand of subcommands) {
|
||||
commands.push(subcommand)
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ module.exports = {
|
||||
type: "slash",
|
||||
dev: true,
|
||||
public: false,
|
||||
subcommands: true,
|
||||
|
||||
data: new SlashCommandBuilder()
|
||||
.setName("setup")
|
||||
|
||||
@@ -9,6 +9,7 @@ module.exports = {
|
||||
type: "slash",
|
||||
dev: false,
|
||||
public: false,
|
||||
subcommands: true,
|
||||
|
||||
data: new SlashCommandBuilder()
|
||||
.setName("staff")
|
||||
@@ -35,8 +36,6 @@ module.exports = {
|
||||
|
||||
async execute(interaction) {
|
||||
|
||||
await interaction.deferReply()
|
||||
|
||||
const subcommand = interaction.options.getSubcommand()
|
||||
const embedColor = Number(color.replace("#", "0x"))
|
||||
|
||||
@@ -53,7 +52,7 @@ module.exports = {
|
||||
const footerText = interaction.guild ? interaction.guild.name : interaction.user.username
|
||||
const footerIcon = interaction.guild ? interaction.guild.iconURL({ dynamic: true }) : interaction.user.avatarURL({ dynamic: true })
|
||||
|
||||
await interaction.editReply({
|
||||
await interaction.reply({
|
||||
embeds: [{
|
||||
description: "This command is currently under development",
|
||||
color: embedColor,
|
||||
|
||||
@@ -5,6 +5,7 @@ const { hypixelLevel, bedwarsLevel, skywarsLevel, getUUID, getPlayer, getGuild,
|
||||
/** @param { import('discord.js').ChatInputCommandInteraction } interaction */
|
||||
|
||||
async function beast(interaction) {
|
||||
await interaction.deferReply()
|
||||
|
||||
const ign = interaction.options.getString("ign")
|
||||
const embedColor = Number(color.replace("#", "0x"))
|
||||
|
||||
@@ -5,13 +5,25 @@ const path = require("path")
|
||||
/** @param { import("discord.js").ChatInputCommandInteraction } interaction */
|
||||
|
||||
async function help(interaction) {
|
||||
|
||||
const commands = []
|
||||
const commandFiles = fs.readdirSync(path.join(__dirname, "..")).filter(file => file.endsWith(".js"))
|
||||
for (const file of commandFiles) {
|
||||
const command = require(`../../commands/${file}`)
|
||||
if (!command.public) {
|
||||
if (!command.public && !command.subcommands) {
|
||||
commands.push(command)
|
||||
} else if (!command.public && command.subcommands) {
|
||||
const commandName = command.data.name
|
||||
|
||||
const subcommands = command.data.options.map((subcommand) => {
|
||||
return {
|
||||
name: commandName + " " + subcommand.name,
|
||||
description: subcommand.description
|
||||
}
|
||||
})
|
||||
|
||||
for (const subcommand of subcommands) {
|
||||
commands.push(subcommand)
|
||||
}
|
||||
}
|
||||
}
|
||||
const commandList = commands.map((command) => {
|
||||
@@ -25,7 +37,7 @@ async function help(interaction) {
|
||||
const footerText = interaction.guild ? interaction.guild.name : interaction.user.username
|
||||
const footerIcon = interaction.guild ? interaction.guild.iconURL({ dynamic: true }) : interaction.user.avatarURL({ dynamic: true })
|
||||
|
||||
await interaction.editReply({
|
||||
await interaction.reply({
|
||||
embeds: [{
|
||||
title: "Commands",
|
||||
description: "List of commands",
|
||||
@@ -38,7 +50,8 @@ async function help(interaction) {
|
||||
icon_url: footerIcon,
|
||||
text: footerText + " | " + devMessage
|
||||
}
|
||||
}]
|
||||
}],
|
||||
ephemeral: true
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
@@ -18,7 +18,8 @@ module.exports = {
|
||||
.addStringOption((option) =>
|
||||
option
|
||||
.setName("ign")
|
||||
.setDescription("Your in-game name."))
|
||||
.setDescription("Your in-game name.")
|
||||
.setRequired(true))
|
||||
.setDMPermission(false),
|
||||
|
||||
/** @param { import('discord.js').ChatInputCommandInteraction } interaction */
|
||||
|
||||
Reference in New Issue
Block a user