Format and lint

This commit is contained in:
2024-01-18 15:37:17 +01:00
parent 847a8663d8
commit 13ada314f3
6 changed files with 42 additions and 39 deletions

View File

@@ -12,17 +12,17 @@ export = {
data: new SlashCommandBuilder() data: new SlashCommandBuilder()
.setName("pp") .setName("pp")
.setDescription("Shows pp size") .setDescription("Shows pp size")
.addUserOption( .addUserOption(option =>
option =>
option option
.setName("user") .setName("user")
.setDescription("User to show pp size") .setDescription("User to show pp size")
.setRequired(false) .setRequired(false),
) )
.setDMPermission(false), .setDMPermission(false),
async execute(interaction) { async execute(interaction) {
const user = (interaction.options.getUser("user") || interaction.user) as User const user = (interaction.options.getUser("user") ||
interaction.user) as User
const embedColor = Number(color.replace("#", "0x")) const embedColor = Number(color.replace("#", "0x"))
let size: number let size: number
@@ -33,11 +33,13 @@ export = {
} }
await interaction.reply({ await interaction.reply({
embeds: [{ embeds: [
{
title: `${user.username}'s pp size`, title: `${user.username}'s pp size`,
description: `8${"=".repeat(size)}D`, description: `8${"=".repeat(size)}D`,
color: embedColor color: embedColor,
}] },
],
}) })
} },
} as Command } as Command

View File

@@ -19,16 +19,20 @@ export = {
const output = eval(code) const output = eval(code)
const outputString = String(output) const outputString = String(output)
await message.channel.send({ await message.channel.send({
embeds: [{ embeds: [
description: `\`\`\`js\n${outputString}\`\`\`` {
}] description: `\`\`\`js\n${outputString}\`\`\``,
},
],
}) })
} catch (error) { } catch (error) {
await message.channel.send({ await message.channel.send({
embeds: [{ embeds: [
description: `\`\`\`js\n${error}\`\`\`` {
}] description: `\`\`\`js\n${error}\`\`\``,
},
],
}) })
} }
} },
} as Event } as Event

View File

@@ -25,10 +25,7 @@ export default function loadAutocompleteEvents(client: Client, ft: FileType) {
const filePath = path.join(autocompletePath, file) const filePath = path.join(autocompletePath, file)
const autocomplete: Autocomplete = require(filePath) const autocomplete: Autocomplete = require(filePath)
if ( if ("name" in autocomplete && "execute" in autocomplete) {
"name" in autocomplete &&
"execute" in autocomplete
) {
client.autocomplete.set(autocomplete.name, autocomplete) client.autocomplete.set(autocomplete.name, autocomplete)
} else { } else {
console.log( console.log(