Merge branch 'dev' into 'main'

Updated interfacecs

See merge request illegitimate/illegitimate-bot!181
This commit is contained in:
2024-01-18 14:37:48 +00:00
72 changed files with 51 additions and 117 deletions

View File

@@ -9,7 +9,6 @@ import { ContextMenu } from "interfaces"
export = {
name: "congratsmessage",
description: "Congratulate a user.",
type: "contextmenu",
dev: false,
data: new ContextMenuCommandBuilder()

View File

@@ -8,7 +8,6 @@ import { ContextMenu } from "interfaces"
export = {
name: "resetnick",
description: "Reset your nickname.",
type: "contextmenu",
dev: false,
data: new ContextMenuCommandBuilder()

View File

@@ -13,7 +13,6 @@ import roleManage from "utils/functions/rolesmanage"
export = {
name: "Update User",
description: "Updates a user's roles",
type: "contextmenu",
dev: false,
data: new ContextMenuCommandBuilder()

View File

@@ -12,7 +12,6 @@ import logToChannel from "utils/functions/logtochannel"
export = {
name: "ban",
description: "Ban a user",
type: "slash",
dev: false,
public: false,

View File

@@ -23,7 +23,6 @@ import { Command } from "interfaces"
export = {
name: "check",
description: "Check a player's stats.",
type: "slash",
dev: false,
public: true,

View File

@@ -12,7 +12,6 @@ import logToChannel from "utils/functions/logtochannel"
export = {
name: "clear",
description: "Clears messages",
type: "slash",
dev: false,
public: false,

View File

@@ -7,7 +7,6 @@ import { Command } from "interfaces"
export = {
name: "config",
description: "Configure the bot",
type: "slash",
dev: true,
public: false,

View File

@@ -12,7 +12,6 @@ import unban from "./counting/unban"
export = {
name: "counting",
description: "counting subcommands",
type: "slash",
dev: false,
public: true,
subcommands: true,

View File

@@ -8,7 +8,6 @@ import { Command } from "interfaces"
export = {
name: "dev-info",
description: "Test command for the bot.",
type: "slash",
dev: true,
public: false,

View File

@@ -4,7 +4,6 @@ import { Command } from "interfaces"
export = {
name: "devel",
description: "Admin command.",
type: "slash",
dev: false,
public: false,

View File

@@ -14,7 +14,6 @@ import { getIGN } from "utils/Hypixel"
export = {
name: "forceunverify",
description: "Force unverify a user",
type: "slash",
dev: false,
public: false,

View File

@@ -13,7 +13,6 @@ import roleManage from "utils/functions/rolesmanage"
export = {
name: "forceupdate",
description: "Force update the user",
type: "slash",
dev: false,
public: false,

View File

@@ -15,7 +15,6 @@ import logToChannel from "utils/functions/logtochannel"
export = {
name: "forceverify",
description: "Force verify a user.",
type: "slash",
dev: false,
public: false,

View File

@@ -8,7 +8,6 @@ import guildTop from "./guild/top"
export = {
name: "guild",
description: "Subcommands for guilds",
type: "slash",
dev: false,
public: true,
subcommands: true,

View File

@@ -5,7 +5,6 @@ import { Command } from "interfaces"
export = {
name: "help",
description: "Help command",
type: "slash",
dev: false,
public: true,

View File

@@ -5,7 +5,6 @@ import { Command } from "interfaces"
export = {
name: "instructions",
description: "Instructions for verification",
type: "slash",
dev: false,
public: false,

View File

@@ -12,7 +12,6 @@ import logToChannel from "utils/functions/logtochannel"
export = {
name: "kick",
description: "Kick a member from the server.",
type: "slash",
dev: false,
public: false,

View File

@@ -5,7 +5,6 @@ import { Command } from "interfaces"
export = {
name: "ping",
description: "Get the bot's ping.",
type: "slash",
dev: false,
public: true,

View File

@@ -6,24 +6,23 @@ import env from "utils/Env"
export = {
name: "pp",
description: "Shows pp size",
type: "slash",
public: true,
dev: true,
data: new SlashCommandBuilder()
.setName("pp")
.setDescription("Shows pp size")
.addUserOption(
option =>
option
.setName("user")
.setDescription("User to show pp size")
.setRequired(false)
.addUserOption(option =>
option
.setName("user")
.setDescription("User to show pp size")
.setRequired(false),
)
.setDMPermission(false),
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"))
let size: number
@@ -34,11 +33,13 @@ export = {
}
await interaction.reply({
embeds: [{
title: `${user.username}'s pp size`,
description: `8${"=".repeat(size)}D`,
color: embedColor
}]
embeds: [
{
title: `${user.username}'s pp size`,
description: `8${"=".repeat(size)}D`,
color: embedColor,
},
],
})
}
} as Command
},
} as Command

View File

@@ -11,7 +11,6 @@ import logToChannel from "utils/functions/logtochannel"
export = {
name: "remove",
description: "Remove a person on the waiting list.",
type: "slash",
false: true,
public: false,

View File

@@ -14,7 +14,6 @@ import { Command } from "interfaces"
export = {
name: "reqs",
description: "Displays the requirements for the guild.",
type: "slash",
dev: false,
public: true,

View File

@@ -10,7 +10,6 @@ import { Command } from "interfaces"
export = {
name: "send",
description: "Send a message to a channel.",
type: "slash",
dev: false,
public: false,

View File

@@ -11,7 +11,6 @@ import logToChannel from "utils/functions/logtochannel"
export = {
name: "setnick",
description: "Set your nickname",
type: "slash",
dev: false,
public: false,

View File

@@ -13,7 +13,6 @@ import { Command } from "interfaces"
export = {
name: "setup",
description: "Used for setup of the bot.",
type: "slash",
dev: true,
public: false,
subcommands: true,
@@ -156,10 +155,8 @@ export = {
if (subcommand === "sendwaitinglistmessage") {
title = "Waiting List"
;(description =
"The people below were accepted into the guild\n" +
"Try to invite them in order."),
(customId = "waitinglistupdate")
description = "The people on the waiting list"
customId = "waitinglistupdate"
label = "Update"
emoji = "🔄"
}

View File

@@ -13,7 +13,6 @@ import logToChannel from "utils/functions/logtochannel"
export = {
name: "slowmode",
description: "Set the slowmode of a channel.",
type: "slash",
dev: false,
public: false,

View File

@@ -7,7 +7,6 @@ import { SnipeCache } from "typings"
export = {
name: "snipe",
description: "Snipes the last deleted message of a user",
type: "slash",
public: true,
dev: true,

View File

@@ -8,7 +8,6 @@ import updateDiscordRoles from "./staff/updatediscordroles"
export = {
name: "staff",
description: "Subcommands for staff",
type: "slash",
dev: false,
public: false,
subcommands: true,

View File

@@ -13,7 +13,6 @@ import logToChannel from "utils/functions/logtochannel"
export = {
name: "timeout",
description: "Times out a memeber",
type: "slash",
dev: false,
public: false,
@@ -129,7 +128,7 @@ export = {
userMention(target.id) +
" for " +
reason),
(timeouttime = null)
(timeouttime = null)
} else {
title = "Timeout Updated"
;(description =
@@ -139,7 +138,7 @@ export = {
prettyTime +
" for " +
reason),
(timeouttime = time)
(timeouttime = time)
}
} else {
title = "Member Timed Out"
@@ -150,7 +149,7 @@ export = {
prettyTime +
" for " +
reason),
(timeouttime = time)
(timeouttime = time)
}
await target.timeout(timeouttime, reason)

View File

@@ -11,7 +11,6 @@ import logToChannel from "utils/functions/logtochannel"
export = {
name: "unban",
description: "Unban a user from the server",
type: "slash",
dev: false,
public: false,

View File

@@ -8,7 +8,6 @@ import { Command } from "interfaces"
export = {
name: "update",
description: "Update your guild rank.",
type: "slash",
dev: false,
public: true,

View File

@@ -6,7 +6,6 @@ import { Command } from "interfaces"
export = {
name: "uuid",
description: "Get a player's UUID",
type: "slash",
dev: false,
public: true,

View File

@@ -11,7 +11,6 @@ import { GuildData } from "interfaces"
export = {
name: "verify",
description: "Verify yourself as a member of the server.",
type: "slash",
dev: false,
public: true,

View File

@@ -7,7 +7,6 @@ import { getIGN, getHeadURL } from "utils/Hypixel"
export = {
name: "whoami",
description: "Get your user info",
type: "slash",
public: true,
dev: false,

View File

@@ -11,7 +11,6 @@ import { Command } from "interfaces"
export = {
name: "whois",
description: "Get's the ign of a user.",
type: "slash",
dev: false,
public: false,

View File

@@ -3,13 +3,10 @@ import { Autocomplete } from "interfaces"
export = {
name: "unban",
description: "Unban a user from the server",
type: "autocomplete",
async execute(interaction) {
const focusedOption = interaction.options.getFocused(true)
if (focusedOption.name !== "user") {
return
}
if (focusedOption.name !== "user") return
if (focusedOption.value === "") {
await interaction.respond([

View File

@@ -22,7 +22,6 @@ import { Button } from "interfaces"
export = {
name: "checkstats",
description: "Check your stats.",
type: "button",
async execute(interaction) {
await interaction.deferReply()

View File

@@ -21,7 +21,6 @@ import { getGuild } from "utils/Hypixel"
export = {
name: "guildapplicationaccept",
description: "Accept a guild application.",
type: "button",
async execute(interaction) {
await interaction.deferReply()

View File

@@ -9,7 +9,6 @@ import { Button } from "interfaces"
export = {
name: "guildapplicationdeny",
description: "Deny a guild application.",
type: "button",
async execute(interaction) {
const modal = new ModalBuilder()

View File

@@ -19,7 +19,6 @@ import { Button } from "interfaces"
export = {
name: "guildapply",
description: "Guild application button.",
type: "button",
async execute(interaction) {
const user = interaction.member as GuildMember

View File

@@ -32,7 +32,6 @@ const guildRoles = [
module.exports = {
name: "guildinactivitylog",
description: "Configure the bot.",
type: "button",
async execute(interaction) {
const guild = interaction.guild!

View File

@@ -3,7 +3,6 @@ import { Button } from "interfaces"
export = {
name: "inactiveapplicationaccept",
description: "Accept an inactivity application.",
type: "button",
async execute(interaction) {
await interaction.reply({

View File

@@ -3,7 +3,6 @@ import { Button } from "interfaces"
export = {
name: "inactiveapplicationdeny",
description: "Denies an inactivity application.",
type: "button",
async execute(interaction) {
await interaction.reply({

View File

@@ -6,7 +6,6 @@ import { Button } from "interfaces"
export = {
name: "staffapplicationaccept",
description: "Accept a staff application.",
type: "button",
async execute(interaction) {
await interaction.deferReply()

View File

@@ -9,7 +9,6 @@ import { Button } from "interfaces"
export = {
name: "staffapplicationdeny",
description: "Deny a guild application.",
type: "button",
async execute(interaction) {
const modal = new ModalBuilder()

View File

@@ -20,7 +20,6 @@ import env from "utils/Env"
export = {
name: "staffapply",
description: "Apply for the staff team.",
type: "button",
async execute(interaction) {
const user = interaction.member as GuildMember

View File

@@ -9,7 +9,6 @@ import { Button } from "interfaces"
export = {
name: "verify",
description: "Configure the bot.",
type: "button",
async execute(interaction) {
const modal = new ModalBuilder()

View File

@@ -6,7 +6,6 @@ import { Button } from "interfaces"
export = {
name: "waitinglistupdate",
description: "Update the waiting list.",
type: "button",
async execute(interaction) {
await interaction.deferReply({ ephemeral: true })

View File

@@ -13,7 +13,6 @@ import { Modal } from "interfaces"
export = {
name: "denyreasonbox",
description: "Deny reason box.",
type: "modal",
async execute(interaction) {
await interaction.deferReply()

View File

@@ -11,7 +11,6 @@ import { Modal } from "interfaces"
export = {
name: "staffdenyreasonbox",
description: "Deny reason box.",
type: "modal",
async execute(interaction) {
await interaction.deferReply()

View File

@@ -19,7 +19,6 @@ import { GuildMember } from "discord.js"
export = {
name: "verifybox",
description: "Verify box.",
type: "modal",
async execute(interaction) {
await interaction.deferReply({ ephemeral: true })

View File

@@ -6,7 +6,6 @@ import logToChannel from "utils/functions/logtochannel"
export = {
name: "logNewJoins",
description: "Logs new joins",
type: "event",
event: "guildMemberAdd",
execute(member: GuildMember) {

View File

@@ -5,7 +5,6 @@ import { Event } from "interfaces"
export = {
name: "logBtnsCmds",
description: "Logs all button and command interactions",
type: "event",
event: "interactionCreate",
execute(interaction: ChatInputCommandInteraction | ButtonInteraction) {

View File

@@ -5,7 +5,6 @@ import env from "utils/Env"
export = {
name: "eval",
description: "Evaluate a JavaScript expression",
type: "event",
event: "messageCreate",
disabled: true,
@@ -20,16 +19,20 @@ export = {
const output = eval(code)
const outputString = String(output)
await message.channel.send({
embeds: [{
description: `\`\`\`js\n${outputString}\`\`\``
}]
embeds: [
{
description: `\`\`\`js\n${outputString}\`\`\``,
},
],
})
} catch (error) {
await message.channel.send({
embeds: [{
description: `\`\`\`js\n${error}\`\`\``
}]
embeds: [
{
description: `\`\`\`js\n${error}\`\`\``,
},
],
})
}
}
} as Event
},
} as Event

View File

@@ -4,7 +4,6 @@ import { Message } from "discord.js"
export = {
name: "ur mom",
description: "ur moms someone",
type: "event",
event: "messageCreate",
async execute(message: Message) {

View File

@@ -7,7 +7,6 @@ import { SnipeCache } from "typings"
export = {
name: "snipecache",
description: "Logs messages for the snipe command",
type: "event",
event: "messageDelete",
disabled: true,

View File

@@ -5,7 +5,6 @@ import color from "utils/functions/colors"
export = {
name: "conolelog",
description: "console log",
type: "event",
event: "ready",
execute(client: Client) {

View File

@@ -5,7 +5,6 @@ import { color } from "config/options.json"
export = {
name: "sendonlinemessage",
description: "send an online message",
type: "event",
event: "ready",
execute() {

View File

@@ -5,7 +5,6 @@ import { ExtendedClient as Client } from "utils/Client"
export = {
name: "status",
description: "Sets the status of the bot",
type: "event",
event: "ready",
execute(client: Client) {

View File

@@ -6,7 +6,6 @@ import logToChannel from "utils/functions/logtochannel"
export = {
name: "vcJoinLeave",
description: "Logs when a user joins or leaves a voice channel.",
type: "event",
event: "voiceStateUpdate",
execute(oldState: VoiceState, newState: VoiceState) {

View File

@@ -4,6 +4,5 @@ import { AutocompleteInteraction } from "discord.js"
export default interface Autocomplete {
name: string
description: string
type: "autocomplete"
execute: (interacion: AutocompleteInteraction) => Promise<void>
}

View File

@@ -4,6 +4,5 @@ import { ButtonInteraction } from "discord.js"
export default interface Button {
name: string
description: string
type: "button"
execute: (interaction: ButtonInteraction) => Promise<void>
}

View File

@@ -5,11 +5,11 @@ import { ExtendedClient as Client } from "utils/Client"
export default interface Command {
name: string
description: string
type: "slash"
dev?: boolean
public: boolean
data: SlashCommandBuilder
disabled?: boolean
subcommands?: boolean
data: SlashCommandBuilder
execute: (
interaction: ChatInputCommandInteraction,
client: Client,

View File

@@ -7,7 +7,6 @@ import {
export default interface ContextMenu {
name: string
description: string
type: "contextmenu"
dev?: boolean
data: ContextMenuCommandBuilder
execute: (interaction: ContextMenuCommandInteraction) => Promise<void>

View File

@@ -4,7 +4,6 @@ import { ClientEvents } from "discord.js"
export default interface Event {
name: string
description: string
type: "event"
event: keyof ClientEvents
disabled?: boolean
execute(...args: any[]): void

View File

@@ -4,6 +4,5 @@ import { ModalSubmitInteraction } from "discord.js"
export default interface Modal {
name: string
description: string
type: "modal"
execute: (interaction: ModalSubmitInteraction) => Promise<void>
}

View File

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

View File

@@ -17,7 +17,7 @@ export default function loadButtonEvents(client: Client, ft: FileType) {
const filePath = path.join(btnPath, file)
const btn: Button = require(filePath)
if ("name" in btn && "execute" in btn && btn.type === "button") {
if ("name" in btn && "execute" in btn) {
client.buttons.set(btn.name, btn)
} else {
console.log(

View File

@@ -17,7 +17,7 @@ export default function loadSlashCommandsEvents(client: Client, ft: FileType) {
const filePath = path.join(cmdPath, file)
const cmd: Command = require(filePath)
if ("data" in cmd && "execute" in cmd && cmd.type === "slash") {
if ("data" in cmd && "execute" in cmd) {
client.commands.set(cmd.data.name, cmd)
} else {
console.log(

View File

@@ -24,7 +24,7 @@ export default function loadContextMenuEvents(client: Client, ft: FileType) {
const filePath = path.join(contextMenuPath, file)
const cmd: ContextMenu = require(filePath)
if ("data" in cmd && "execute" in cmd && cmd.type === "contextmenu") {
if ("data" in cmd && "execute" in cmd) {
client.contextmenus.set(cmd.data.name, cmd)
} else {
console.log(

View File

@@ -19,7 +19,7 @@ export default function loadModalEvents(client: Client, ft: FileType) {
const filePath = path.join(modalPath, file)
const modal: Modal = require(filePath)
if ("name" in modal && "execute" in modal && modal.type === "modal") {
if ("name" in modal && "execute" in modal) {
client.modals.set(modal.name, modal)
} else {
console.log(

View File

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

View File

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