Updated interfacecs

This commit is contained in:
2024-01-18 15:34:55 +01:00
parent 4cfe877feb
commit 847a8663d8
71 changed files with 207 additions and 79 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,7 +6,6 @@ import env from "utils/Env"
export = {
name: "pp",
description: "Shows pp size",
type: "slash",
public: true,
dev: true,

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,

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,

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

@@ -27,8 +27,7 @@ export default function loadAutocompleteEvents(client: Client, ft: FileType) {
if (
"name" in autocomplete &&
"execute" in autocomplete &&
autocomplete.type === "autocomplete"
"execute" in autocomplete
) {
client.autocomplete.set(autocomplete.name, autocomplete)
} else {

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(

197
đ Normal file
View File

@@ -0,0 +1,197 @@
import {
SlashCommandBuilder,
PermissionFlagsBits,
ButtonBuilder,
ActionRowBuilder,
ButtonStyle,
ChannelType,
TextChannel,
} from "discord.js"
import { color, devMessage } from "config/options.json"
import { Command } from "interfaces"
export = {
name: "setup",
description: "Used for setup of the bot.",
type: "slash",
dev: true,
public: false,
subcommands: true,
data: new SlashCommandBuilder()
.setName("setup")
.setDescription("Configure the bot.")
.addSubcommand(subcommand =>
subcommand
.setName("sendguildapplication")
.setDescription("Send the application message to a channel.")
.addChannelOption(option =>
option
.setName("channel")
.setDescription(
"The channel to send the application to.",
)
.addChannelTypes(
ChannelType.GuildText,
ChannelType.GuildAnnouncement,
)
.setRequired(true),
),
)
.addSubcommand(subcommand =>
subcommand
.setName("sendstaffapplication")
.setDescription("Send the application message to a channel.")
.addChannelOption(option =>
option
.setName("channel")
.setDescription(
"The channel to send the application to.",
)
.addChannelTypes(
ChannelType.GuildText,
ChannelType.GuildAnnouncement,
)
.setRequired(true),
),
)
.addSubcommand(subcommand =>
subcommand
.setName("sendverfiymessage")
.setDescription("Send the verfiy message to a channel.")
.addChannelOption(option =>
option
.setName("channel")
.setDescription(
"The channel to send the verfiy message to.",
)
.addChannelTypes(
ChannelType.GuildText,
ChannelType.GuildAnnouncement,
)
.setRequired(true),
),
)
.addSubcommand(subcommand =>
subcommand
.setName("sendwaitinglistmessage")
.setDescription("Send the waiting list message to a channel.")
.addChannelOption(option =>
option
.setName("channel")
.setDescription(
"The channel to send the waiting list message to.",
)
.addChannelTypes(
ChannelType.GuildText,
ChannelType.GuildAnnouncement,
)
.setRequired(true),
),
)
.addSubcommand(subcommand =>
subcommand
.setName("sendinactivityapplication")
.setDescription("Send the application message to a channel.")
.addChannelOption(option =>
option
.setName("channel")
.setDescription(
"The channel to send the application to.",
)
.addChannelTypes(
ChannelType.GuildText,
ChannelType.GuildAnnouncement,
)
.setRequired(true),
),
)
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
.setDMPermission(false),
async execute(interaction) {
const subcommand = interaction.options.getSubcommand()
const channel = interaction.options.getChannel("channel") as TextChannel
const embedColor = Number(color.replace("#", "0x"))
let title: string = ""
let description: string = ""
let customId: string = ""
let label: string = ""
let emoji: string = ""
if (subcommand === "sendguildapplication") {
title = "Guild Application"
description =
"You can apply for the guild by clicking the button below."
customId = "guildapply"
label = "Apply"
emoji = "✅"
}
if (subcommand === "sendstaffapplication") {
title = "Staff Application"
description =
"You can apply for the staff team by clicking the button below."
customId = "staffapply"
label = "Apply"
emoji = "✅"
}
if (subcommand === "sendinactivityapplication") {
title = "Inactivity Log"
description =
"You can send an inactivity log by clicking the button below."
customId = "guildinactivitylog"
label = "Submit"
emoji = "✅"
}
if (subcommand === "sendverfiymessage") {
title = "Verification"
description = "You can verify by clicking the button below."
customId = "verify"
label = "Verify"
emoji = "✅"
}
if (subcommand === "sendwaitinglistmessage") {
title = "Waiting List"
description = "The people on the waiting list"
customId = "waitinglistupdate"
label = "Update"
emoji = "🔄"
}
await channel.send({
embeds: [
{
title: title,
description: description,
color: embedColor,
thumbnail: {
url: interaction.guild!.iconURL() || "",
},
footer: {
text: interaction.guild!.name + " | " + devMessage,
icon_url: interaction.guild!.iconURL() || undefined,
},
},
],
components: [
new ActionRowBuilder<ButtonBuilder>().addComponents(
new ButtonBuilder()
.setCustomId(customId)
.setLabel(label)
.setStyle(ButtonStyle.Primary)
.setEmoji({ name: emoji }),
),
],
})
await interaction.reply({
content: "Message sent",
ephemeral: true,
})
},
} as Command