Moved to using an object for execute args
This commit is contained in:
@@ -11,7 +11,7 @@ export = {
|
|||||||
.setType(ApplicationCommandType.Message)
|
.setType(ApplicationCommandType.Message)
|
||||||
.setDefaultMemberPermissions(PermissionFlagsBits.ManageMessages),
|
.setDefaultMemberPermissions(PermissionFlagsBits.ManageMessages),
|
||||||
|
|
||||||
async execute(interaction) {
|
async execute({ interaction }) {
|
||||||
const { targetId } = interaction
|
const { targetId } = interaction
|
||||||
const message = await interaction.channel!.messages.fetch(targetId)
|
const message = await interaction.channel!.messages.fetch(targetId)
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ export = {
|
|||||||
.setType(ApplicationCommandType.User)
|
.setType(ApplicationCommandType.User)
|
||||||
.setDefaultMemberPermissions(PermissionFlagsBits.ManageNicknames),
|
.setDefaultMemberPermissions(PermissionFlagsBits.ManageNicknames),
|
||||||
|
|
||||||
async execute(interaction) {
|
async execute({ interaction }) {
|
||||||
const { targetId } = interaction
|
const { targetId } = interaction
|
||||||
const target = await interaction.guild!.members.fetch(targetId)
|
const target = await interaction.guild!.members.fetch(targetId)
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ export = {
|
|||||||
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
||||||
.setDMPermission(false),
|
.setDMPermission(false),
|
||||||
|
|
||||||
async execute(interaction) {
|
async execute({ interaction }) {
|
||||||
await interaction.deferReply({ ephemeral: true })
|
await interaction.deferReply({ ephemeral: true })
|
||||||
|
|
||||||
const targetId = interaction.targetId
|
const targetId = interaction.targetId
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ export = {
|
|||||||
)
|
)
|
||||||
.setDMPermission(false),
|
.setDMPermission(false),
|
||||||
|
|
||||||
async execute(interaction) {
|
async execute({ interaction }) {
|
||||||
await interaction.deferReply()
|
await interaction.deferReply()
|
||||||
const query = interaction.options.getString("query")!
|
const query = interaction.options.getString("query")!
|
||||||
|
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ export = {
|
|||||||
.setDefaultMemberPermissions(PermissionFlagsBits.BanMembers)
|
.setDefaultMemberPermissions(PermissionFlagsBits.BanMembers)
|
||||||
.setDMPermission(false),
|
.setDMPermission(false),
|
||||||
|
|
||||||
async execute(interaction) {
|
async execute({ interaction }) {
|
||||||
await interaction.deferReply()
|
await interaction.deferReply()
|
||||||
|
|
||||||
const member = interaction.options.getMember("user") as GuildMember | null
|
const member = interaction.options.getMember("user") as GuildMember | null
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ export = {
|
|||||||
.setDescription("Get information about the bot")
|
.setDescription("Get information about the bot")
|
||||||
.setDMPermission(false),
|
.setDMPermission(false),
|
||||||
|
|
||||||
async execute(interaction, client) {
|
async execute({ interaction, client }) {
|
||||||
const { default: prettyMs } = await import("pretty-ms")
|
const { default: prettyMs } = await import("pretty-ms")
|
||||||
const castedDeps = dependencies as { [key: string]: string }
|
const castedDeps = dependencies as { [key: string]: string }
|
||||||
const castedDevDeps = devDependencies as { [key: string]: string }
|
const castedDevDeps = devDependencies as { [key: string]: string }
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ export = {
|
|||||||
)
|
)
|
||||||
.setDMPermission(false),
|
.setDMPermission(false),
|
||||||
|
|
||||||
async execute(interaction) {
|
async execute({ interaction }) {
|
||||||
await interaction.deferReply({})
|
await interaction.deferReply({})
|
||||||
|
|
||||||
const ign = interaction.options.getString("ign")!
|
const ign = interaction.options.getString("ign")!
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ export = {
|
|||||||
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
||||||
.setDMPermission(false),
|
.setDMPermission(false),
|
||||||
|
|
||||||
async execute(interaction) {
|
async execute({ interaction }) {
|
||||||
await interaction.deferReply({ ephemeral: true })
|
await interaction.deferReply({ ephemeral: true })
|
||||||
|
|
||||||
const amount = interaction.options.getInteger("amount")!
|
const amount = interaction.options.getInteger("amount")!
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ export = {
|
|||||||
.setDMPermission(false)
|
.setDMPermission(false)
|
||||||
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator),
|
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator),
|
||||||
|
|
||||||
async execute(interaction) {
|
async execute({ interaction }) {
|
||||||
await interaction.deferReply()
|
await interaction.deferReply()
|
||||||
|
|
||||||
const setting = interaction.options.getString("setting")
|
const setting = interaction.options.getString("setting")
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ export = {
|
|||||||
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
||||||
.setDMPermission(false),
|
.setDMPermission(false),
|
||||||
|
|
||||||
async execute(interaction) {
|
async execute({ interaction }) {
|
||||||
const subcommand = interaction.options.getSubcommand()
|
const subcommand = interaction.options.getSubcommand()
|
||||||
|
|
||||||
if (subcommand === "ban") {
|
if (subcommand === "ban") {
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ export = {
|
|||||||
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
||||||
.setDMPermission(false),
|
.setDMPermission(false),
|
||||||
|
|
||||||
async execute(interaction) {
|
async execute({ interaction }) {
|
||||||
await interaction.deferReply()
|
await interaction.deferReply()
|
||||||
|
|
||||||
const ign = interaction.options.getString("ign")!
|
const ign = interaction.options.getString("ign")!
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ export = {
|
|||||||
.setDMPermission(false)
|
.setDMPermission(false)
|
||||||
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator),
|
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator),
|
||||||
|
|
||||||
async execute(interaction) {
|
async execute({ interaction }) {
|
||||||
const member = interaction.options.getMember("user") as GuildMember
|
const member = interaction.options.getMember("user") as GuildMember
|
||||||
const verifiedUser = await verify.findOne({ userID: member.user.id })
|
const verifiedUser = await verify.findOne({ userID: member.user.id })
|
||||||
const mod = interaction.user
|
const mod = interaction.user
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ export = {
|
|||||||
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
||||||
.setDMPermission(false),
|
.setDMPermission(false),
|
||||||
|
|
||||||
async execute(interaction) {
|
async execute({ interaction }) {
|
||||||
await interaction.deferReply()
|
await interaction.deferReply()
|
||||||
|
|
||||||
const user = interaction.options.getMember("user") as GuildMember
|
const user = interaction.options.getMember("user") as GuildMember
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ export = {
|
|||||||
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
||||||
.setDMPermission(false),
|
.setDMPermission(false),
|
||||||
|
|
||||||
async execute(interaction) {
|
async execute({ interaction }) {
|
||||||
await interaction.deferReply()
|
await interaction.deferReply()
|
||||||
|
|
||||||
const user = interaction.options.getMember("user") as GuildMember
|
const user = interaction.options.getMember("user") as GuildMember
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ export = {
|
|||||||
)
|
)
|
||||||
.setDMPermission(false),
|
.setDMPermission(false),
|
||||||
|
|
||||||
async execute(interaction) {
|
async execute({ interaction }) {
|
||||||
const subcommand = interaction.options.getSubcommand()
|
const subcommand = interaction.options.getSubcommand()
|
||||||
|
|
||||||
if (subcommand === "member") {
|
if (subcommand === "member") {
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ export = {
|
|||||||
.setDescription("List's all commands usable by a member")
|
.setDescription("List's all commands usable by a member")
|
||||||
.setDMPermission(false),
|
.setDMPermission(false),
|
||||||
|
|
||||||
async execute(interaction, client) {
|
async execute({ interaction, client }) {
|
||||||
await interaction.deferReply({ ephemeral: true })
|
await interaction.deferReply({ ephemeral: true })
|
||||||
|
|
||||||
type CommandList = {
|
type CommandList = {
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ export = {
|
|||||||
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
||||||
.setDMPermission(false),
|
.setDMPermission(false),
|
||||||
|
|
||||||
async execute(interaction) {
|
async execute({ interaction }) {
|
||||||
await interaction.reply({
|
await interaction.reply({
|
||||||
embeds: [{
|
embeds: [{
|
||||||
title: "Verification",
|
title: "Verification",
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ export = {
|
|||||||
.setDefaultMemberPermissions(PermissionFlagsBits.KickMembers)
|
.setDefaultMemberPermissions(PermissionFlagsBits.KickMembers)
|
||||||
.setDMPermission(false),
|
.setDMPermission(false),
|
||||||
|
|
||||||
async execute(interaction) {
|
async execute({ interaction }) {
|
||||||
await interaction.deferReply()
|
await interaction.deferReply()
|
||||||
|
|
||||||
const member = interaction.options.getMember("member") as GuildMember
|
const member = interaction.options.getMember("member") as GuildMember
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ export = {
|
|||||||
.setDMPermission(false)
|
.setDMPermission(false)
|
||||||
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator),
|
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator),
|
||||||
|
|
||||||
async execute(interaction) {
|
async execute({ interaction }) {
|
||||||
const subcommand = interaction.options.getSubcommand()
|
const subcommand = interaction.options.getSubcommand()
|
||||||
|
|
||||||
if (subcommand === "play") {
|
if (subcommand === "play") {
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ export = {
|
|||||||
.setDescription("Get's the bot's ping.")
|
.setDescription("Get's the bot's ping.")
|
||||||
.setDMPermission(false),
|
.setDMPermission(false),
|
||||||
|
|
||||||
async execute(interaction, client) {
|
async execute({ interaction, client }) {
|
||||||
await interaction.deferReply()
|
await interaction.deferReply()
|
||||||
await interaction.editReply({
|
await interaction.editReply({
|
||||||
embeds: [{
|
embeds: [{
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ export = {
|
|||||||
)
|
)
|
||||||
.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
|
||||||
let size: number
|
let size: number
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ export = {
|
|||||||
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
||||||
.setDMPermission(false),
|
.setDMPermission(false),
|
||||||
|
|
||||||
async execute(interaction) {
|
async execute({ interaction }) {
|
||||||
await interaction.deferReply()
|
await interaction.deferReply()
|
||||||
|
|
||||||
const member = interaction.options.getMember("user") as GuildMember
|
const member = interaction.options.getMember("user") as GuildMember
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ export = {
|
|||||||
.setDescription("Displays the requirements for the guild.")
|
.setDescription("Displays the requirements for the guild.")
|
||||||
.setDMPermission(false),
|
.setDMPermission(false),
|
||||||
|
|
||||||
async execute(interaction) {
|
async execute({ interaction }) {
|
||||||
await interaction.reply({
|
await interaction.reply({
|
||||||
embeds: [{
|
embeds: [{
|
||||||
title: "Requirements",
|
title: "Requirements",
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ export = {
|
|||||||
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
||||||
.setDMPermission(false),
|
.setDMPermission(false),
|
||||||
|
|
||||||
async execute(interaction) {
|
async execute({ interaction }) {
|
||||||
await interaction.deferReply({ ephemeral: true })
|
await interaction.deferReply({ ephemeral: true })
|
||||||
|
|
||||||
const message = interaction.options.getString("message")!
|
const message = interaction.options.getString("message")!
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ export = {
|
|||||||
.setDefaultMemberPermissions(PermissionFlagsBits.ManageNicknames)
|
.setDefaultMemberPermissions(PermissionFlagsBits.ManageNicknames)
|
||||||
.setDMPermission(false),
|
.setDMPermission(false),
|
||||||
|
|
||||||
async execute(interaction) {
|
async execute({ interaction }) {
|
||||||
const member = interaction.options.getMember("user") as GuildMember
|
const member = interaction.options.getMember("user") as GuildMember
|
||||||
const nickname = interaction.options.getString("nickname")
|
const nickname = interaction.options.getString("nickname")
|
||||||
|
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ export = {
|
|||||||
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
||||||
.setDMPermission(false),
|
.setDMPermission(false),
|
||||||
|
|
||||||
async execute(interaction) {
|
async execute({ interaction }) {
|
||||||
const subcommand = interaction.options.getSubcommand()
|
const subcommand = interaction.options.getSubcommand()
|
||||||
const channel = interaction.options.getChannel("channel") as TextChannel
|
const channel = interaction.options.getChannel("channel") as TextChannel
|
||||||
let title = ""
|
let title = ""
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ export = {
|
|||||||
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
||||||
.setDMPermission(false),
|
.setDMPermission(false),
|
||||||
|
|
||||||
async execute(interaction) {
|
async execute({ interaction }) {
|
||||||
await interaction.deferReply({ ephemeral: true })
|
await interaction.deferReply({ ephemeral: true })
|
||||||
|
|
||||||
const seconds = interaction.options.getInteger("seconds") ?? 5
|
const seconds = interaction.options.getInteger("seconds") ?? 5
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ export = {
|
|||||||
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
||||||
.setDMPermission(false),
|
.setDMPermission(false),
|
||||||
|
|
||||||
async execute(interaction, client) {
|
async execute({ interaction, client }) {
|
||||||
const subcommand = interaction.options.getSubcommand()
|
const subcommand = interaction.options.getSubcommand()
|
||||||
|
|
||||||
if (subcommand === "help") {
|
if (subcommand === "help") {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { SlashCommandBuilder, PermissionFlagsBits, userMention, ChatInputCommandInteraction, GuildMember } from "discord.js"
|
import { SlashCommandBuilder, PermissionFlagsBits, userMention, GuildMember } from "discord.js"
|
||||||
import { embedColor, devMessage } from "config/options"
|
import { embedColor, devMessage } from "config/options"
|
||||||
import { ICommand } from "interfaces"
|
import { ICommand } from "interfaces"
|
||||||
import ms from "ms"
|
import ms from "ms"
|
||||||
@@ -34,7 +34,7 @@ export = {
|
|||||||
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
||||||
.setDMPermission(false),
|
.setDMPermission(false),
|
||||||
|
|
||||||
async execute(interaction: ChatInputCommandInteraction) {
|
async execute({ interaction }) {
|
||||||
await interaction.deferReply()
|
await interaction.deferReply()
|
||||||
|
|
||||||
const target = interaction.options.getMember("user")! as GuildMember
|
const target = interaction.options.getMember("user")! as GuildMember
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ export = {
|
|||||||
.setDefaultMemberPermissions(PermissionFlagsBits.BanMembers)
|
.setDefaultMemberPermissions(PermissionFlagsBits.BanMembers)
|
||||||
.setDMPermission(false),
|
.setDMPermission(false),
|
||||||
|
|
||||||
async execute(interaction) {
|
async execute({ interaction }) {
|
||||||
await interaction.deferReply()
|
await interaction.deferReply()
|
||||||
|
|
||||||
const userid = interaction.options.getString("user")!
|
const userid = interaction.options.getString("user")!
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ export = {
|
|||||||
.setDescription("Update your discord roles.")
|
.setDescription("Update your discord roles.")
|
||||||
.setDMPermission(false),
|
.setDMPermission(false),
|
||||||
|
|
||||||
async execute(interaction) {
|
async execute({ interaction }) {
|
||||||
await interaction.deferReply()
|
await interaction.deferReply()
|
||||||
|
|
||||||
const user = interaction.member as GuildMember
|
const user = interaction.member as GuildMember
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ export = {
|
|||||||
)
|
)
|
||||||
.setDMPermission(false),
|
.setDMPermission(false),
|
||||||
|
|
||||||
async execute(interaction) {
|
async execute({ interaction }) {
|
||||||
await interaction.deferReply()
|
await interaction.deferReply()
|
||||||
|
|
||||||
const ign = interaction.options.getString("ign")!
|
const ign = interaction.options.getString("ign")!
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ export = {
|
|||||||
)
|
)
|
||||||
.setDMPermission(false),
|
.setDMPermission(false),
|
||||||
|
|
||||||
async execute(interaction) {
|
async execute({ interaction }) {
|
||||||
await interaction.deferReply()
|
await interaction.deferReply()
|
||||||
|
|
||||||
const user = interaction.member! as GuildMember
|
const user = interaction.member! as GuildMember
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ export = {
|
|||||||
.setDescription("Get your user info")
|
.setDescription("Get your user info")
|
||||||
.setDMPermission(false),
|
.setDMPermission(false),
|
||||||
|
|
||||||
async execute(interaction) {
|
async execute({ interaction }) {
|
||||||
await interaction.deferReply()
|
await interaction.deferReply()
|
||||||
|
|
||||||
const user = interaction.user
|
const user = interaction.user
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ export = {
|
|||||||
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
||||||
.setDMPermission(false),
|
.setDMPermission(false),
|
||||||
|
|
||||||
async execute(interaction) {
|
async execute({ interaction }) {
|
||||||
await interaction.deferReply()
|
await interaction.deferReply()
|
||||||
|
|
||||||
const user = interaction.options.getUser("user")!
|
const user = interaction.options.getUser("user")!
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ export = {
|
|||||||
name: "music",
|
name: "music",
|
||||||
description: "Music",
|
description: "Music",
|
||||||
|
|
||||||
async execute(interaction) {
|
async execute({ interaction }) {
|
||||||
const focusedOption = interaction.options.getFocused(true)
|
const focusedOption = interaction.options.getFocused(true)
|
||||||
if (interaction.options.getSubcommand() !== "play" && focusedOption.name !== "query") return
|
if (interaction.options.getSubcommand() !== "play" && focusedOption.name !== "query") return
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ export = {
|
|||||||
name: "unban",
|
name: "unban",
|
||||||
description: "Unban a user from the server",
|
description: "Unban a user from the server",
|
||||||
|
|
||||||
async execute(interaction) {
|
async execute({ interaction }) {
|
||||||
const focusedOption = interaction.options.getFocused(true)
|
const focusedOption = interaction.options.getFocused(true)
|
||||||
if (focusedOption.name !== "user") return
|
if (focusedOption.name !== "user") return
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ export = {
|
|||||||
name: "checkstats",
|
name: "checkstats",
|
||||||
description: "Check your stats.",
|
description: "Check your stats.",
|
||||||
|
|
||||||
async execute(interaction) {
|
async execute({ interaction }) {
|
||||||
await interaction.deferReply()
|
await interaction.deferReply()
|
||||||
|
|
||||||
const message = interaction.message
|
const message = interaction.message
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ export = {
|
|||||||
name: "guildapplicationaccept",
|
name: "guildapplicationaccept",
|
||||||
description: "Accept a guild application.",
|
description: "Accept a guild application.",
|
||||||
|
|
||||||
async execute(interaction) {
|
async execute({ interaction }) {
|
||||||
await interaction.deferReply()
|
await interaction.deferReply()
|
||||||
|
|
||||||
const user = interaction.user
|
const user = interaction.user
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ export = {
|
|||||||
name: "guildapplicationdeny",
|
name: "guildapplicationdeny",
|
||||||
description: "Deny a guild application.",
|
description: "Deny a guild application.",
|
||||||
|
|
||||||
async execute(interaction) {
|
async execute({ interaction }) {
|
||||||
const modal = new ModalBuilder()
|
const modal = new ModalBuilder()
|
||||||
.setTitle("Deny Reason")
|
.setTitle("Deny Reason")
|
||||||
.setCustomId("denyreasonbox")
|
.setCustomId("denyreasonbox")
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ export = {
|
|||||||
name: "guildapply",
|
name: "guildapply",
|
||||||
description: "Guild application button.",
|
description: "Guild application button.",
|
||||||
|
|
||||||
async execute(interaction) {
|
async execute({ interaction }) {
|
||||||
await interaction.deferReply({ ephemeral: true })
|
await interaction.deferReply({ ephemeral: true })
|
||||||
const user = interaction.member as GuildMember
|
const user = interaction.member as GuildMember
|
||||||
const guild = interaction.guild!
|
const guild = interaction.guild!
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ export = {
|
|||||||
name: "guildinactivitylog",
|
name: "guildinactivitylog",
|
||||||
description: "Configure the bot.",
|
description: "Configure the bot.",
|
||||||
|
|
||||||
async execute(interaction) {
|
async execute({ interaction }) {
|
||||||
const guild = interaction.guild!
|
const guild = interaction.guild!
|
||||||
const user = interaction.member as GuildMember
|
const user = interaction.member as GuildMember
|
||||||
const userRoles = user.roles.cache
|
const userRoles = user.roles.cache
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ export = {
|
|||||||
name: "inactiveapplicationaccept",
|
name: "inactiveapplicationaccept",
|
||||||
description: "Accept an inactivity application.",
|
description: "Accept an inactivity application.",
|
||||||
|
|
||||||
async execute(interaction) {
|
async execute({ interaction }) {
|
||||||
await interaction.reply({
|
await interaction.reply({
|
||||||
content: "This button is currently disabled.",
|
content: "This button is currently disabled.",
|
||||||
ephemeral: true
|
ephemeral: true
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ export = {
|
|||||||
name: "inactiveapplicationdeny",
|
name: "inactiveapplicationdeny",
|
||||||
description: "Denies an inactivity application.",
|
description: "Denies an inactivity application.",
|
||||||
|
|
||||||
async execute(interaction) {
|
async execute({ interaction }) {
|
||||||
await interaction.reply({
|
await interaction.reply({
|
||||||
content: "This button is currently disabled.",
|
content: "This button is currently disabled.",
|
||||||
ephemeral: true
|
ephemeral: true
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ export = {
|
|||||||
name: "staffapplicationaccept",
|
name: "staffapplicationaccept",
|
||||||
description: "Accept a staff application.",
|
description: "Accept a staff application.",
|
||||||
|
|
||||||
async execute(interaction) {
|
async execute({ interaction }) {
|
||||||
await interaction.deferReply()
|
await interaction.deferReply()
|
||||||
|
|
||||||
const user = interaction.user
|
const user = interaction.user
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ export = {
|
|||||||
name: "staffapplicationdeny",
|
name: "staffapplicationdeny",
|
||||||
description: "Deny a guild application.",
|
description: "Deny a guild application.",
|
||||||
|
|
||||||
async execute(interaction) {
|
async execute({ interaction }) {
|
||||||
const modal = new ModalBuilder()
|
const modal = new ModalBuilder()
|
||||||
.setTitle("Deny Reason")
|
.setTitle("Deny Reason")
|
||||||
.setCustomId("staffdenyreasonbox")
|
.setCustomId("staffdenyreasonbox")
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ export = {
|
|||||||
name: "staffapply",
|
name: "staffapply",
|
||||||
description: "Apply for the staff team.",
|
description: "Apply for the staff team.",
|
||||||
|
|
||||||
async execute(interaction) {
|
async execute({ interaction }) {
|
||||||
const user = interaction.member as GuildMember
|
const user = interaction.member as GuildMember
|
||||||
const guild = interaction.guild!
|
const guild = interaction.guild!
|
||||||
const userRoles = user.roles.cache
|
const userRoles = user.roles.cache
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ export = {
|
|||||||
name: "verify",
|
name: "verify",
|
||||||
description: "Configure the bot.",
|
description: "Configure the bot.",
|
||||||
|
|
||||||
async execute(interaction) {
|
async execute({ interaction }) {
|
||||||
const modal = new ModalBuilder()
|
const modal = new ModalBuilder()
|
||||||
.setTitle("Verification")
|
.setTitle("Verification")
|
||||||
.setCustomId("verifybox")
|
.setCustomId("verifybox")
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ export = {
|
|||||||
name: "waitinglistupdate",
|
name: "waitinglistupdate",
|
||||||
description: "Update the waiting list.",
|
description: "Update the waiting list.",
|
||||||
|
|
||||||
async execute(interaction) {
|
async execute({ interaction }) {
|
||||||
await interaction.deferReply({ ephemeral: true })
|
await interaction.deferReply({ ephemeral: true })
|
||||||
|
|
||||||
const user = interaction.user
|
const user = interaction.user
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ export = {
|
|||||||
name: "denyreasonbox",
|
name: "denyreasonbox",
|
||||||
description: "Deny reason box.",
|
description: "Deny reason box.",
|
||||||
|
|
||||||
async execute(interaction) {
|
async execute({ interaction }) {
|
||||||
await interaction.deferReply()
|
await interaction.deferReply()
|
||||||
|
|
||||||
const guild = interaction.guild!
|
const guild = interaction.guild!
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ export = {
|
|||||||
name: "staffdenyreasonbox",
|
name: "staffdenyreasonbox",
|
||||||
description: "Deny reason box.",
|
description: "Deny reason box.",
|
||||||
|
|
||||||
async execute(interaction) {
|
async execute({ interaction }) {
|
||||||
await interaction.deferReply()
|
await interaction.deferReply()
|
||||||
|
|
||||||
const guild = interaction.guild
|
const guild = interaction.guild
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ export = {
|
|||||||
name: "verifybox",
|
name: "verifybox",
|
||||||
description: "Verify box.",
|
description: "Verify box.",
|
||||||
|
|
||||||
async execute(interaction) {
|
async execute({ interaction }) {
|
||||||
await interaction.deferReply({ ephemeral: true })
|
await interaction.deferReply({ ephemeral: true })
|
||||||
|
|
||||||
const user = interaction.member as GuildMember
|
const user = interaction.member as GuildMember
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
/* eslint-disable no-unused-vars */
|
/* eslint-disable no-unused-vars */
|
||||||
import { AutocompleteInteraction } from "discord.js"
|
import { AutocompleteInteraction } from "discord.js"
|
||||||
|
import { ExtendedClient } from "utils/Client"
|
||||||
|
|
||||||
export default interface IAutocomplete {
|
export default interface IAutocomplete {
|
||||||
name: string
|
name: string
|
||||||
description: string
|
description: string
|
||||||
execute: (interacion: AutocompleteInteraction) => Promise<void>
|
execute: (arg: { interaction: AutocompleteInteraction, client :ExtendedClient }) => Promise<void>
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
/* eslint-disable no-unused-vars */
|
/* eslint-disable no-unused-vars */
|
||||||
import { ButtonInteraction } from "discord.js"
|
import { ButtonInteraction } from "discord.js"
|
||||||
|
import { ExtendedClient } from "utils/Client"
|
||||||
|
|
||||||
export default interface IButton {
|
export default interface IButton {
|
||||||
name: string
|
name: string
|
||||||
description: string
|
description: string
|
||||||
execute: (interaction: ButtonInteraction) => Promise<void>
|
execute: (arg: { interaction: ButtonInteraction, client: ExtendedClient }) => Promise<void>
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,5 +9,5 @@ export default interface ICommand {
|
|||||||
public: boolean
|
public: boolean
|
||||||
subcommands?: boolean
|
subcommands?: boolean
|
||||||
data: SlashCommandBuilder
|
data: SlashCommandBuilder
|
||||||
execute: (interaction: ChatInputCommandInteraction, client: Client) => Promise<void>
|
execute: (arg: { interaction: ChatInputCommandInteraction, client: Client }) => Promise<void>
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,11 @@
|
|||||||
/* eslint-disable no-unused-vars */
|
/* eslint-disable no-unused-vars */
|
||||||
import {
|
import { ContextMenuCommandInteraction, ContextMenuCommandBuilder } from "discord.js"
|
||||||
ContextMenuCommandInteraction,
|
import { ExtendedClient } from "utils/Client"
|
||||||
ContextMenuCommandBuilder
|
|
||||||
} from "discord.js"
|
|
||||||
|
|
||||||
export default interface IContextMenu {
|
export default interface IContextMenu {
|
||||||
name: string
|
name: string
|
||||||
description: string
|
description: string
|
||||||
dev?: boolean
|
dev?: boolean
|
||||||
data: ContextMenuCommandBuilder
|
data: ContextMenuCommandBuilder
|
||||||
execute: (interaction: ContextMenuCommandInteraction) => Promise<void>
|
execute: (arg: { interaction: ContextMenuCommandInteraction, client: ExtendedClient }) => Promise<void>
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
/* eslint-disable no-unused-vars */
|
/* eslint-disable no-unused-vars */
|
||||||
import { ModalSubmitInteraction } from "discord.js"
|
import { ModalSubmitInteraction } from "discord.js"
|
||||||
|
import { ExtendedClient } from "utils/Client"
|
||||||
|
|
||||||
export default interface IModal {
|
export default interface IModal {
|
||||||
name: string
|
name: string
|
||||||
description: string
|
description: string
|
||||||
execute: (interaction: ModalSubmitInteraction) => Promise<void>
|
execute: (arg: { interaction: ModalSubmitInteraction, client: ExtendedClient }) => Promise<void>
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ export default function loadAutocompleteEvents(client: Client, ft: FileType) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await autocomplete.execute(interaction)
|
await autocomplete.execute({ interaction, client })
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (process.env.NODE_ENV !== "dev") {
|
if (process.env.NODE_ENV !== "dev") {
|
||||||
await logToChannel("error", {
|
await logToChannel("error", {
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ export default function loadButtonEvents(client: Client, ft: FileType) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await button.execute(interaction)
|
await button.execute({ interaction, client })
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (process.env.NODE_ENV !== "dev") {
|
if (process.env.NODE_ENV !== "dev") {
|
||||||
await logToChannel("error", {
|
await logToChannel("error", {
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ export default function loadSlashCommandsEvents(client: Client, ft: FileType) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await command.execute(interaction, client)
|
await command.execute({ interaction, client })
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (process.env.NODE_ENV !== "dev") {
|
if (process.env.NODE_ENV !== "dev") {
|
||||||
await logToChannel("error", {
|
await logToChannel("error", {
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ export default function loadContextMenuEvents(client: Client, ft: FileType) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await command.execute(interaction)
|
await command.execute({ interaction, client })
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (process.env.NODE_ENV !== "dev") {
|
if (process.env.NODE_ENV !== "dev") {
|
||||||
await logToChannel("error", {
|
await logToChannel("error", {
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ export default function loadModalEvents(client: Client, ft: FileType) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await modal.execute(interaction)
|
await modal.execute({ interaction, client })
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (process.env.NODE_ENV !== "dev") {
|
if (process.env.NODE_ENV !== "dev") {
|
||||||
await logToChannel("error", {
|
await logToChannel("error", {
|
||||||
|
|||||||
Reference in New Issue
Block a user