Replaced clang format with prettuier (sadly)
This commit is contained in:
@@ -2,18 +2,21 @@ import { ChatInputCommandInteraction } from "discord.js"
|
||||
import { color, devMessage } from "../../../config/options.json"
|
||||
import { ExtendedClient as Client } from "../../utils/Client"
|
||||
|
||||
export async function help(interaction: ChatInputCommandInteraction, client: Client): Promise<void> {
|
||||
export async function help(
|
||||
interaction: ChatInputCommandInteraction,
|
||||
client: Client,
|
||||
): Promise<void> {
|
||||
await interaction.deferReply({ ephemeral: true })
|
||||
|
||||
type CommandList = {
|
||||
name: string,
|
||||
name: string
|
||||
value: string
|
||||
}
|
||||
const commandList: CommandList[] = []
|
||||
const commandRawList = client.commands.map((command) => {
|
||||
const commandRawList = client.commands.map(command => {
|
||||
return {
|
||||
name: command.name,
|
||||
command: command
|
||||
command: command,
|
||||
}
|
||||
})
|
||||
|
||||
@@ -23,43 +26,48 @@ export async function help(interaction: ChatInputCommandInteraction, client: Cli
|
||||
if (!command.command.subcommands && !command.command.public) {
|
||||
commandList.push({
|
||||
name: "**/" + commandName + "**",
|
||||
value: "`" + command.command.description + "`"
|
||||
value: "`" + command.command.description + "`",
|
||||
})
|
||||
} else if (command.command.subcommands && !command.command.public) {
|
||||
|
||||
const subcommands = command.command.data.options.map((subcommand) => {
|
||||
const subcommands = command.command.data.options.map(subcommand => {
|
||||
return {
|
||||
name: commandName + " " + subcommand.toJSON().name,
|
||||
description: subcommand.toJSON().description
|
||||
description: subcommand.toJSON().description,
|
||||
}
|
||||
})
|
||||
|
||||
for (const subcommand of subcommands) {
|
||||
commandList.push({
|
||||
name: "**/" + subcommand.name + "**",
|
||||
value: "`" + subcommand.description + "`"
|
||||
value: "`" + subcommand.description + "`",
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const embedColor = Number(color.replace("#", "0x"))
|
||||
const footerText = interaction.guild ? interaction.guild.name : interaction.user.username
|
||||
const footerIcon = interaction.guild ? interaction.guild.iconURL({ forceStatic: false }) : interaction.user.avatarURL({ forceStatic: false })
|
||||
const footerText = interaction.guild
|
||||
? interaction.guild.name
|
||||
: interaction.user.username
|
||||
const footerIcon = interaction.guild
|
||||
? interaction.guild.iconURL({ forceStatic: false })
|
||||
: interaction.user.avatarURL({ forceStatic: false })
|
||||
|
||||
await interaction.editReply({
|
||||
embeds: [{
|
||||
title: "Commands",
|
||||
description: "List of commands",
|
||||
fields: commandList,
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: interaction.guild!.iconURL({ forceStatic: false })!
|
||||
embeds: [
|
||||
{
|
||||
title: "Commands",
|
||||
description: "List of commands",
|
||||
fields: commandList,
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: interaction.guild!.iconURL({ forceStatic: false })!,
|
||||
},
|
||||
footer: {
|
||||
icon_url: footerIcon!,
|
||||
text: footerText + " | " + devMessage,
|
||||
},
|
||||
},
|
||||
footer: {
|
||||
icon_url: footerIcon!,
|
||||
text: footerText + " | " + devMessage
|
||||
}
|
||||
}],
|
||||
],
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user