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`, {
description: `8${"=".repeat(size)}D`, title: `${user.username}'s pp size`,
color: embedColor description: `8${"=".repeat(size)}D`,
}] color: embedColor,
},
],
}) })
} },
} as Command } as Command

View File

@@ -128,7 +128,7 @@ export = {
userMention(target.id) + userMention(target.id) +
" for " + " for " +
reason), reason),
(timeouttime = null) (timeouttime = null)
} else { } else {
title = "Timeout Updated" title = "Timeout Updated"
;(description = ;(description =
@@ -138,7 +138,7 @@ export = {
prettyTime + prettyTime +
" for " + " for " +
reason), reason),
(timeouttime = time) (timeouttime = time)
} }
} else { } else {
title = "Member Timed Out" title = "Member Timed Out"
@@ -149,7 +149,7 @@ export = {
prettyTime + prettyTime +
" for " + " for " +
reason), reason),
(timeouttime = time) (timeouttime = time)
} }
await target.timeout(timeouttime, reason) await target.timeout(timeouttime, reason)

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(

View File

@@ -10,14 +10,14 @@ function getExpForLevel(level: number): number {
} }
switch (respectedLevel) { switch (respectedLevel) {
case 1: case 1:
return 500 return 500
case 2: case 2:
return 1000 return 1000
case 3: case 3:
return 2000 return 2000
case 4: case 4:
return 3500 return 3500
} }
return 5000 return 5000
} }

View File

@@ -12,10 +12,10 @@ function getLevel(exp: number): number {
return exp <= 1 return exp <= 1
? 1 ? 1
: Math.floor( : Math.floor(
1 + 1 +
REVERSE_PQ_PREFIX + REVERSE_PQ_PREFIX +
Math.sqrt(REVERSE_CONST + GROWTH_DIVIDES_2 * exp), Math.sqrt(REVERSE_CONST + GROWTH_DIVIDES_2 * exp),
) )
} }
function hypixelLevel(exp: number): number { function hypixelLevel(exp: number): number {