Merge branch 'dev' into 'main'

Dev

See merge request illegitimate/illegitimate-bot!276
This commit is contained in:
2024-09-09 20:21:35 +00:00
37 changed files with 100 additions and 77 deletions

View File

@@ -19,8 +19,9 @@
"dev:ts": "nodemon --config nodemon.json src/index.ts", "dev:ts": "nodemon --config nodemon.json src/index.ts",
"dev:js": "nodemon --config nodemon-js.json dist/index.js", "dev:js": "nodemon --config nodemon-js.json dist/index.js",
"format": "dprint fmt \"**/*.ts\"", "format": "dprint fmt \"**/*.ts\"",
"check": "tsc --noEmit", "check": "yarn tscheck && yarn lint",
"lint": "eslint", "tscheck": "tsc && echo \"TypeScript check passed!\"",
"lint": "eslint && echo \"Linting passed!\"",
"lint:fix": "eslint --fix", "lint:fix": "eslint --fix",
"push:prod": "tsx scripts/deploy-commands.ts", "push:prod": "tsx scripts/deploy-commands.ts",
"push:dev": "tsx scripts/dev-deploy.ts", "push:dev": "tsx scripts/dev-deploy.ts",

View File

@@ -14,8 +14,7 @@ export default {
data: new ContextMenuCommandBuilder() data: new ContextMenuCommandBuilder()
.setName("Update User") .setName("Update User")
.setType(ApplicationCommandType.User) .setType(ApplicationCommandType.User)
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator) .setDefaultMemberPermissions(PermissionFlagsBits.Administrator),
.setDMPermission(false),
async execute({ interaction }) { async execute({ interaction }) {
await interaction.deferReply({ ephemeral: true }) await interaction.deferReply({ ephemeral: true })

View File

@@ -1,6 +1,6 @@
import { anilist } from "anilist" import { anilist } from "anilist"
import { devMessage, embedColor } from "config/options.js" import { devMessage, embedColor } from "config/options.js"
import { SlashCommandBuilder } from "discord.js" import { InteractionContextType, SlashCommandBuilder } from "discord.js"
import { ICommand } from "interfaces" import { ICommand } from "interfaces"
export default { export default {
@@ -18,7 +18,7 @@ export default {
.setDescription("The anime to search for") .setDescription("The anime to search for")
.setRequired(true) .setRequired(true)
) )
.setDMPermission(false), .setContexts(InteractionContextType.Guild),
async execute({ interaction }) { async execute({ interaction }) {
await interaction.deferReply() await interaction.deferReply()

View File

@@ -1,6 +1,6 @@
import { devMessage, embedColor } from "config/options.js" import { devMessage, embedColor } from "config/options.js"
import { admin, helper } from "config/roles.js" import { admin, helper } from "config/roles.js"
import { GuildMember, PermissionFlagsBits, SlashCommandBuilder, userMention } from "discord.js" import { GuildMember, InteractionContextType, PermissionFlagsBits, SlashCommandBuilder, userMention } from "discord.js"
import { ICommand } from "interfaces" import { ICommand } from "interfaces"
import logToChannel from "utils/functions/logtochannel.js" import logToChannel from "utils/functions/logtochannel.js"
@@ -39,7 +39,7 @@ export default {
) )
) )
.setDefaultMemberPermissions(PermissionFlagsBits.BanMembers) .setDefaultMemberPermissions(PermissionFlagsBits.BanMembers)
.setDMPermission(false), .setContexts(InteractionContextType.Guild),
async execute({ interaction }) { async execute({ interaction }) {
await interaction.deferReply() await interaction.deferReply()

View File

@@ -1,6 +1,6 @@
import { execSync } from "child_process" import { execSync } from "child_process"
import { devMessage, embedColor } from "config/options.js" import { devMessage, embedColor } from "config/options.js"
import { SlashCommandBuilder } from "discord.js" import { InteractionContextType, SlashCommandBuilder } from "discord.js"
import { ICommand } from "interfaces" import { ICommand } from "interfaces"
import { createRequire } from "node:module" import { createRequire } from "node:module"
import os from "os" import os from "os"
@@ -18,7 +18,7 @@ export default {
data: new SlashCommandBuilder() data: new SlashCommandBuilder()
.setName("botinfo") .setName("botinfo")
.setDescription("Get information about the bot") .setDescription("Get information about the bot")
.setDMPermission(false), .setContexts(InteractionContextType.Guild),
async execute({ interaction, client }) { async execute({ interaction, client }) {
const castedDeps = dependencies as { [key: string]: string } const castedDeps = dependencies as { [key: string]: string }

View File

@@ -1,6 +1,6 @@
import { devMessage, embedColor } from "config/options.js" import { devMessage, embedColor } from "config/options.js"
import { bwfkdr, bwstars, bwwins, duelswins, duelswlr, swkdr, swstars } from "config/reqs.js" import { bwfkdr, bwstars, bwwins, duelswins, duelswlr, swkdr, swstars } from "config/reqs.js"
import { SlashCommandBuilder } from "discord.js" import { InteractionContextType, SlashCommandBuilder } from "discord.js"
import { ICommand } from "interfaces" import { ICommand } from "interfaces"
import { bedwarsLevel, getGuild, getHeadURL, getPlayer, getUUID, hypixelLevel, skywarsLevel } from "utils/Hypixel.js" import { bedwarsLevel, getGuild, getHeadURL, getPlayer, getUUID, hypixelLevel, skywarsLevel } from "utils/Hypixel.js"
@@ -21,7 +21,7 @@ export default {
.setMaxLength(16) .setMaxLength(16)
.setRequired(true) .setRequired(true)
) )
.setDMPermission(false), .setContexts(InteractionContextType.Guild),
async execute({ interaction }) { async execute({ interaction }) {
await interaction.deferReply({}) await interaction.deferReply({})

View File

@@ -1,5 +1,5 @@
import { embedColor } from "config/options.js" import { embedColor } from "config/options.js"
import { channelMention, PermissionFlagsBits, SlashCommandBuilder, TextChannel, userMention } from "discord.js" import { channelMention, InteractionContextType, PermissionFlagsBits, SlashCommandBuilder, TextChannel, userMention } from "discord.js"
import { ICommand } from "interfaces" import { ICommand } from "interfaces"
import logToChannel from "utils/functions/logtochannel.js" import logToChannel from "utils/functions/logtochannel.js"
@@ -19,7 +19,7 @@ export default {
.setRequired(true) .setRequired(true)
) )
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator) .setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
.setDMPermission(false), .setContexts(InteractionContextType.Guild),
async execute({ interaction }) { async execute({ interaction }) {
await interaction.deferReply({ ephemeral: true }) await interaction.deferReply({ ephemeral: true })

View File

@@ -1,5 +1,5 @@
import { embedColor } from "config/options.js" import { embedColor } from "config/options.js"
import { PermissionFlagsBits, SlashCommandBuilder } from "discord.js" import { InteractionContextType, PermissionFlagsBits, SlashCommandBuilder } from "discord.js"
import { ICommand } from "interfaces" import { ICommand } from "interfaces"
import settings from "schemas/settingsTag.js" import settings from "schemas/settingsTag.js"
@@ -28,8 +28,8 @@ export default {
.setDescription("The value to set") .setDescription("The value to set")
.setRequired(true) .setRequired(true)
) )
.setDMPermission(false) .setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator), .setContexts(InteractionContextType.Guild),
async execute({ interaction }) { async execute({ interaction }) {
await interaction.deferReply() await interaction.deferReply()

View File

@@ -1,5 +1,5 @@
import { devMessage, embedColor } from "config/options.js" import { devMessage, embedColor } from "config/options.js"
import { PermissionFlagsBits, SlashCommandBuilder } from "discord.js" import { InteractionContextType, PermissionFlagsBits, SlashCommandBuilder } from "discord.js"
import { ICommand } from "interfaces" import { ICommand } from "interfaces"
import ban from "./counting/ban.js" import ban from "./counting/ban.js"
import unban from "./counting/unban.js" import unban from "./counting/unban.js"
@@ -37,7 +37,7 @@ export default {
) )
) )
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator) .setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
.setDMPermission(false), .setContexts(InteractionContextType.Guild),
async execute({ interaction }) { async execute({ interaction }) {
const subcommand = interaction.options.getSubcommand() const subcommand = interaction.options.getSubcommand()

View File

@@ -1,5 +1,5 @@
import { devMessage, embedColor } from "config/options.js" import { devMessage, embedColor } from "config/options.js"
import { PermissionFlagsBits, SlashCommandBuilder, userMention } from "discord.js" import { InteractionContextType, PermissionFlagsBits, SlashCommandBuilder, userMention } from "discord.js"
import { ICommand } from "interfaces" import { ICommand } from "interfaces"
import verify from "schemas/verifyTag.js" import verify from "schemas/verifyTag.js"
import { getHeadURL, getIGN, getUUID } from "utils/Hypixel.js" import { getHeadURL, getIGN, getUUID } from "utils/Hypixel.js"
@@ -20,7 +20,7 @@ export default {
.setRequired(true) .setRequired(true)
) )
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator) .setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
.setDMPermission(false), .setContexts(InteractionContextType.Guild),
async execute({ interaction }) { async execute({ interaction }) {
await interaction.deferReply() await interaction.deferReply()

View File

@@ -1,5 +1,5 @@
import { devMessage, embedColor } from "config/options.js" import { devMessage, embedColor } from "config/options.js"
import { GuildMember, PermissionFlagsBits, SlashCommandBuilder, userMention } from "discord.js" import { GuildMember, InteractionContextType, PermissionFlagsBits, SlashCommandBuilder, userMention } from "discord.js"
import { ICommand } from "interfaces" import { ICommand } from "interfaces"
import verify from "schemas/verifyTag.js" import verify from "schemas/verifyTag.js"
import logToChannel from "utils/functions/logtochannel.js" import logToChannel from "utils/functions/logtochannel.js"
@@ -21,8 +21,8 @@ export default {
.setDescription("The user to force unverify") .setDescription("The user to force unverify")
.setRequired(true) .setRequired(true)
) )
.setDMPermission(false) .setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator), .setContexts(InteractionContextType.Guild),
async execute({ interaction }) { async execute({ interaction }) {
const member = interaction.options.getMember("user") as GuildMember const member = interaction.options.getMember("user") as GuildMember

View File

@@ -1,6 +1,6 @@
import { devMessage, embedColor, hypixelGuildID } from "config/options.js" import { devMessage, embedColor, hypixelGuildID } from "config/options.js"
import { waitingListRole } from "config/roles.js" import { waitingListRole } from "config/roles.js"
import { GuildMember, PermissionFlagsBits, SlashCommandBuilder, userMention } from "discord.js" import { GuildMember, InteractionContextType, PermissionFlagsBits, SlashCommandBuilder, userMention } from "discord.js"
import { ICommand } from "interfaces" import { ICommand } from "interfaces"
import verify from "schemas/verifyTag.js" import verify from "schemas/verifyTag.js"
import roleManage from "utils/functions/rolesmanage.js" import roleManage from "utils/functions/rolesmanage.js"
@@ -22,7 +22,7 @@ export default {
.setRequired(true) .setRequired(true)
) )
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator) .setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
.setDMPermission(false), .setContexts(InteractionContextType.Guild),
async execute({ interaction }) { async execute({ interaction }) {
await interaction.deferReply() await interaction.deferReply()

View File

@@ -1,5 +1,5 @@
import { devMessage, embedColor, hypixelGuildID } from "config/options.js" import { devMessage, embedColor, hypixelGuildID } from "config/options.js"
import { GuildMember, PermissionFlagsBits, SlashCommandBuilder, userMention } from "discord.js" import { GuildMember, InteractionContextType, PermissionFlagsBits, SlashCommandBuilder, userMention } from "discord.js"
import { ICommand } from "interfaces" import { ICommand } from "interfaces"
import verify from "schemas/verifyTag.js" import verify from "schemas/verifyTag.js"
import logToChannel from "utils/functions/logtochannel.js" import logToChannel from "utils/functions/logtochannel.js"
@@ -26,7 +26,7 @@ export default {
.setDescription("The user's in-game name.") .setDescription("The user's in-game name.")
) )
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator) .setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
.setDMPermission(false), .setContexts(InteractionContextType.Guild),
async execute({ interaction }) { async execute({ interaction }) {
await interaction.deferReply() await interaction.deferReply()

View File

@@ -1,5 +1,5 @@
import { devMessage, embedColor } from "config/options.js" import { devMessage, embedColor } from "config/options.js"
import { SlashCommandBuilder } from "discord.js" import { InteractionContextType, SlashCommandBuilder } from "discord.js"
import { ICommand } from "interfaces" import { ICommand } from "interfaces"
import guildInfo from "./guild/info.js" import guildInfo from "./guild/info.js"
import guildMember from "./guild/member.js" import guildMember from "./guild/member.js"
@@ -75,7 +75,7 @@ export default {
.setDescription("The amount of guild members to show. [Default: 10]") .setDescription("The amount of guild members to show. [Default: 10]")
) )
) )
.setDMPermission(false), .setContexts(InteractionContextType.Guild),
async execute({ interaction }) { async execute({ interaction }) {
const subcommand = interaction.options.getSubcommand() const subcommand = interaction.options.getSubcommand()

View File

@@ -1,5 +1,5 @@
import { devMessage, embedColor } from "config/options.js" import { devMessage, embedColor } from "config/options.js"
import { SlashCommandBuilder } from "discord.js" import { InteractionContextType, SlashCommandBuilder } from "discord.js"
import { ICommand } from "interfaces" import { ICommand } from "interfaces"
export default { export default {
@@ -11,7 +11,7 @@ export default {
data: new SlashCommandBuilder() data: new SlashCommandBuilder()
.setName("help") .setName("help")
.setDescription("List's all commands usable by a member") .setDescription("List's all commands usable by a member")
.setDMPermission(false), .setContexts(InteractionContextType.Guild),
async execute({ interaction, client }) { async execute({ interaction, client }) {
await interaction.deferReply({ ephemeral: true }) await interaction.deferReply({ ephemeral: true })

View File

@@ -1,5 +1,5 @@
import { devMessage, embedColor, instructionsgif } from "config/options.js" import { devMessage, embedColor, instructionsgif } from "config/options.js"
import { PermissionFlagsBits, SlashCommandBuilder } from "discord.js" import { InteractionContextType, PermissionFlagsBits, SlashCommandBuilder } from "discord.js"
import { ICommand } from "interfaces" import { ICommand } from "interfaces"
export default { export default {
@@ -12,7 +12,7 @@ export default {
.setName("instructions") .setName("instructions")
.setDescription("Instructions for verification") .setDescription("Instructions for verification")
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator) .setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
.setDMPermission(false), .setContexts(InteractionContextType.Guild),
async execute({ interaction }) { async execute({ interaction }) {
await interaction.reply({ await interaction.reply({

View File

@@ -1,6 +1,6 @@
import { devMessage, embedColor } from "config/options.js" import { devMessage, embedColor } from "config/options.js"
import { admin, helper } from "config/roles.js" import { admin, helper } from "config/roles.js"
import { GuildMember, PermissionFlagsBits, SlashCommandBuilder, userMention } from "discord.js" import { GuildMember, InteractionContextType, PermissionFlagsBits, SlashCommandBuilder, userMention } from "discord.js"
import { ICommand } from "interfaces" import { ICommand } from "interfaces"
import logToChannel from "utils/functions/logtochannel.js" import logToChannel from "utils/functions/logtochannel.js"
@@ -25,7 +25,7 @@ export default {
.setDescription("Reason for kicking the member.") .setDescription("Reason for kicking the member.")
) )
.setDefaultMemberPermissions(PermissionFlagsBits.KickMembers) .setDefaultMemberPermissions(PermissionFlagsBits.KickMembers)
.setDMPermission(false), .setContexts(InteractionContextType.Guild),
async execute({ interaction }) { async execute({ interaction }) {
await interaction.deferReply() await interaction.deferReply()

View File

@@ -1,4 +1,4 @@
import { PermissionFlagsBits, SlashCommandBuilder } from "discord.js" import { InteractionContextType, PermissionFlagsBits, SlashCommandBuilder } from "discord.js"
import { ICommand } from "interfaces" import { ICommand } from "interfaces"
import leave from "./music/leave.js" import leave from "./music/leave.js"
import nowplaying from "./music/nowplaying.js" import nowplaying from "./music/nowplaying.js"
@@ -79,8 +79,8 @@ export default {
.setName("leave") .setName("leave")
.setDescription("Leave the voice channel") .setDescription("Leave the voice channel")
) )
.setDMPermission(false) .setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator), .setContexts(InteractionContextType.Guild),
async execute({ interaction }) { async execute({ interaction }) {
const subcommand = interaction.options.getSubcommand() const subcommand = interaction.options.getSubcommand()

View File

@@ -1,5 +1,5 @@
import { devMessage, embedColor } from "config/options.js" import { devMessage, embedColor } from "config/options.js"
import { SlashCommandBuilder } from "discord.js" import { InteractionContextType, SlashCommandBuilder } from "discord.js"
import { ICommand } from "interfaces" import { ICommand } from "interfaces"
export default { export default {
@@ -11,7 +11,7 @@ export default {
data: new SlashCommandBuilder() data: new SlashCommandBuilder()
.setName("ping") .setName("ping")
.setDescription("Get's the bot's ping.") .setDescription("Get's the bot's ping.")
.setDMPermission(false), .setContexts(InteractionContextType.Guild),
async execute({ interaction, client }) { async execute({ interaction, client }) {
await interaction.deferReply() await interaction.deferReply()

View File

@@ -1,5 +1,5 @@
import { embedColor } from "config/options.js" import { embedColor } from "config/options.js"
import { SlashCommandBuilder, User } from "discord.js" import { InteractionContextType, SlashCommandBuilder, User } from "discord.js"
import { ICommand } from "interfaces" import { ICommand } from "interfaces"
import env from "utils/Env.js" import env from "utils/Env.js"
@@ -18,7 +18,7 @@ export default {
.setDescription("User to show pp size") .setDescription("User to show pp size")
.setRequired(false) .setRequired(false)
) )
.setDMPermission(false), .setContexts(InteractionContextType.Guild),
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

View File

@@ -1,6 +1,6 @@
import { devMessage, embedColor } from "config/options.js" import { devMessage, embedColor } from "config/options.js"
import { waitingListRole } from "config/roles.js" import { waitingListRole } from "config/roles.js"
import { GuildMember, PermissionFlagsBits, SlashCommandBuilder, userMention } from "discord.js" import { GuildMember, InteractionContextType, PermissionFlagsBits, SlashCommandBuilder, userMention } from "discord.js"
import { ICommand } from "interfaces" import { ICommand } from "interfaces"
import waitinglist from "schemas/waitinglistTag.js" import waitinglist from "schemas/waitinglistTag.js"
import logToChannel from "utils/functions/logtochannel.js" import logToChannel from "utils/functions/logtochannel.js"
@@ -27,7 +27,7 @@ export default {
.setRequired(false) .setRequired(false)
) )
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator) .setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
.setDMPermission(false), .setContexts(InteractionContextType.Guild),
async execute({ interaction }) { async execute({ interaction }) {
await interaction.deferReply() await interaction.deferReply()

View File

@@ -1,6 +1,6 @@
import { devMessage, embedColor } from "config/options.js" import { devMessage, embedColor } from "config/options.js"
import { bwfkdr, bwstars, bwwins, duelswins, duelswlr, swkdr, swstars } from "config/reqs.js" import { bwfkdr, bwstars, bwwins, duelswins, duelswlr, swkdr, swstars } from "config/reqs.js"
import { SlashCommandBuilder } from "discord.js" import { InteractionContextType, SlashCommandBuilder } from "discord.js"
import { ICommand } from "interfaces" import { ICommand } from "interfaces"
export default { export default {
@@ -12,7 +12,7 @@ export default {
data: new SlashCommandBuilder() data: new SlashCommandBuilder()
.setName("reqs") .setName("reqs")
.setDescription("Displays the requirements for the guild.") .setDescription("Displays the requirements for the guild.")
.setDMPermission(false), .setContexts(InteractionContextType.Guild),
async execute({ interaction }) { async execute({ interaction }) {
await interaction.reply({ await interaction.reply({

View File

@@ -1,5 +1,5 @@
import { devMessage, embedColor } from "config/options.js" import { devMessage, embedColor } from "config/options.js"
import { ChannelType, PermissionFlagsBits, SlashCommandBuilder, TextChannel } from "discord.js" import { ChannelType, InteractionContextType, PermissionFlagsBits, SlashCommandBuilder, TextChannel } from "discord.js"
import { ICommand } from "interfaces" import { ICommand } from "interfaces"
export default { export default {
@@ -24,7 +24,7 @@ export default {
.addChannelTypes(ChannelType.GuildText, ChannelType.GuildAnnouncement) .addChannelTypes(ChannelType.GuildText, ChannelType.GuildAnnouncement)
) )
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator) .setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
.setDMPermission(false), .setContexts(InteractionContextType.Guild),
async execute({ interaction }) { async execute({ interaction }) {
await interaction.deferReply({ ephemeral: true }) await interaction.deferReply({ ephemeral: true })

View File

@@ -1,5 +1,5 @@
import { devMessage, embedColor } from "config/options.js" import { devMessage, embedColor } from "config/options.js"
import { GuildMember, PermissionFlagsBits, SlashCommandBuilder, userMention } from "discord.js" import { GuildMember, InteractionContextType, PermissionFlagsBits, SlashCommandBuilder, userMention } from "discord.js"
import { ICommand } from "interfaces" import { ICommand } from "interfaces"
import logToChannel from "utils/functions/logtochannel.js" import logToChannel from "utils/functions/logtochannel.js"
@@ -25,7 +25,7 @@ export default {
.setRequired(true) .setRequired(true)
) )
.setDefaultMemberPermissions(PermissionFlagsBits.ManageNicknames) .setDefaultMemberPermissions(PermissionFlagsBits.ManageNicknames)
.setDMPermission(false), .setContexts(InteractionContextType.Guild),
async execute({ interaction }) { async execute({ interaction }) {
const member = interaction.options.getMember("user") as GuildMember const member = interaction.options.getMember("user") as GuildMember

View File

@@ -1,5 +1,14 @@
import { devMessage, embedColor } from "config/options.js" import { devMessage, embedColor } from "config/options.js"
import { ActionRowBuilder, ButtonBuilder, ButtonStyle, ChannelType, PermissionFlagsBits, SlashCommandBuilder, TextChannel } from "discord.js" import {
ActionRowBuilder,
ButtonBuilder,
ButtonStyle,
ChannelType,
InteractionContextType,
PermissionFlagsBits,
SlashCommandBuilder,
TextChannel
} from "discord.js"
import { ICommand } from "interfaces" import { ICommand } from "interfaces"
export default { export default {
@@ -73,7 +82,7 @@ export default {
) )
) )
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator) .setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
.setDMPermission(false), .setContexts(InteractionContextType.Guild),
async execute({ interaction }) { async execute({ interaction }) {
const subcommand = interaction.options.getSubcommand() const subcommand = interaction.options.getSubcommand()

View File

@@ -1,5 +1,5 @@
import { devMessage, embedColor } from "config/options.js" import { devMessage, embedColor } from "config/options.js"
import { channelMention, ChannelType, PermissionFlagsBits, SlashCommandBuilder, TextChannel, userMention } from "discord.js" import { channelMention, ChannelType, InteractionContextType, PermissionFlagsBits, SlashCommandBuilder, TextChannel, userMention } from "discord.js"
import { ICommand } from "interfaces" import { ICommand } from "interfaces"
import logToChannel from "utils/functions/logtochannel.js" import logToChannel from "utils/functions/logtochannel.js"
@@ -24,7 +24,7 @@ export default {
.addChannelTypes(ChannelType.GuildText, ChannelType.GuildAnnouncement) .addChannelTypes(ChannelType.GuildText, ChannelType.GuildAnnouncement)
) )
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator) .setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
.setDMPermission(false), .setContexts(InteractionContextType.Guild),
async execute({ interaction }) { async execute({ interaction }) {
await interaction.deferReply({ ephemeral: true }) await interaction.deferReply({ ephemeral: true })

View File

@@ -1,5 +1,5 @@
import { devMessage, embedColor } from "config/options.js" import { devMessage, embedColor } from "config/options.js"
import { PermissionFlagsBits, SlashCommandBuilder } from "discord.js" import { InteractionContextType, PermissionFlagsBits, SlashCommandBuilder } from "discord.js"
import { ICommand } from "interfaces" import { ICommand } from "interfaces"
import beast from "./staff/beast.js" import beast from "./staff/beast.js"
import help from "./staff/help.js" import help from "./staff/help.js"
@@ -49,7 +49,7 @@ export default {
.setDescription("Update the discord roles of all guild members") .setDescription("Update the discord roles of all guild members")
) )
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator) .setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
.setDMPermission(false), .setContexts(InteractionContextType.Guild),
async execute({ interaction, client }) { async execute({ interaction, client }) {
const subcommand = interaction.options.getSubcommand() const subcommand = interaction.options.getSubcommand()

View File

@@ -67,7 +67,7 @@ export default async function prune(interaction: ChatInputCommandInteraction): P
) )
] ]
}).then(async (m) => { }).then(async (m) => {
const collector = interaction.channel!.createMessageComponentCollector({ const collector = m.createMessageComponentCollector({
componentType: ComponentType.Button, componentType: ComponentType.Button,
filter: (i: ButtonInteraction) => filter: (i: ButtonInteraction) =>
(i.customId === buttonid || i.customId === cancelid) && (i.customId === buttonid || i.customId === cancelid) &&

View File

@@ -1,5 +1,5 @@
import { embedColor, hypixelGuildID } from "config/options.js" import { embedColor, hypixelGuildID } from "config/options.js"
import { ChatInputCommandInteraction, GuildMember } from "discord.js" import { ChannelType, ChatInputCommandInteraction, GuildMember, TextChannel } from "discord.js"
import { IGuildData } from "interfaces" import { IGuildData } from "interfaces"
import verify from "schemas/verifyTag.js" import verify from "schemas/verifyTag.js"
import env from "utils/Env.js" import env from "utils/Env.js"
@@ -11,6 +11,17 @@ export default async function updateAll(interaction: ChatInputCommandInteraction
await interaction.deferReply() await interaction.deferReply()
const discordMember = interaction.member as GuildMember const discordMember = interaction.member as GuildMember
const channel = interaction.channel
if (channel?.type !== ChannelType.GuildText) {
await interaction.editReply({
embeds: [{
description: "This command can only be used in a server.",
color: embedColor
}]
})
return
}
if (discordMember.user.id !== env.prod.dev) { if (discordMember.user.id !== env.prod.dev) {
await interaction.editReply({ await interaction.editReply({
@@ -117,7 +128,7 @@ export default async function updateAll(interaction: ChatInputCommandInteraction
console.log("Successfully updated all roles.") console.log("Successfully updated all roles.")
await interaction.channel?.send({ await channel.send({
embeds: [{ embeds: [{
description: "Successfully updated all roles.", description: "Successfully updated all roles.",
color: embedColor color: embedColor

View File

@@ -1,5 +1,5 @@
import { devMessage, embedColor } from "config/options.js" import { devMessage, embedColor } from "config/options.js"
import { GuildMember, PermissionFlagsBits, SlashCommandBuilder, userMention } from "discord.js" import { GuildMember, InteractionContextType, PermissionFlagsBits, SlashCommandBuilder, userMention } from "discord.js"
import { ICommand } from "interfaces" import { ICommand } from "interfaces"
import ms from "ms" import ms from "ms"
import prettyMs from "pretty-ms" import prettyMs from "pretty-ms"
@@ -32,7 +32,7 @@ export default {
.setDescription("The reason for the timeout") .setDescription("The reason for the timeout")
) )
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator) .setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
.setDMPermission(false), .setContexts(InteractionContextType.Guild),
async execute({ interaction }) { async execute({ interaction }) {
await interaction.deferReply() await interaction.deferReply()

View File

@@ -1,5 +1,5 @@
import { devMessage, embedColor } from "config/options.js" import { devMessage, embedColor } from "config/options.js"
import { PermissionFlagsBits, SlashCommandBuilder, User, userMention } from "discord.js" import { InteractionContextType, PermissionFlagsBits, SlashCommandBuilder, User, userMention } from "discord.js"
import { ICommand } from "interfaces" import { ICommand } from "interfaces"
import logToChannel from "utils/functions/logtochannel.js" import logToChannel from "utils/functions/logtochannel.js"
@@ -26,7 +26,7 @@ export default {
.setRequired(false) .setRequired(false)
) )
.setDefaultMemberPermissions(PermissionFlagsBits.BanMembers) .setDefaultMemberPermissions(PermissionFlagsBits.BanMembers)
.setDMPermission(false), .setContexts(InteractionContextType.Guild),
async execute({ interaction }) { async execute({ interaction }) {
await interaction.deferReply() await interaction.deferReply()

View File

@@ -1,6 +1,6 @@
import { devMessage, embedColor, hypixelGuildID } from "config/options.js" import { devMessage, embedColor, hypixelGuildID } from "config/options.js"
import { waitingListRole } from "config/roles.js" import { waitingListRole } from "config/roles.js"
import { GuildMember, SlashCommandBuilder } from "discord.js" import { GuildMember, InteractionContextType, SlashCommandBuilder } from "discord.js"
import { ICommand } from "interfaces" import { ICommand } from "interfaces"
import verify from "schemas/verifyTag.js" import verify from "schemas/verifyTag.js"
import roleManage from "utils/functions/rolesmanage.js" import roleManage from "utils/functions/rolesmanage.js"
@@ -15,7 +15,7 @@ export default {
data: new SlashCommandBuilder() data: new SlashCommandBuilder()
.setName("update") .setName("update")
.setDescription("Update your discord roles.") .setDescription("Update your discord roles.")
.setDMPermission(false), .setContexts(InteractionContextType.Guild),
async execute({ interaction }) { async execute({ interaction }) {
await interaction.deferReply() await interaction.deferReply()

View File

@@ -1,5 +1,5 @@
import { devMessage, embedColor } from "config/options.js" import { devMessage, embedColor } from "config/options.js"
import { SlashCommandBuilder } from "discord.js" import { InteractionContextType, SlashCommandBuilder } from "discord.js"
import { ICommand } from "interfaces" import { ICommand } from "interfaces"
import { formatUuid, getHeadURL, getIGN, getUUID } from "utils/Hypixel.js" import { formatUuid, getHeadURL, getIGN, getUUID } from "utils/Hypixel.js"
@@ -20,7 +20,7 @@ export default {
.setMaxLength(16) .setMaxLength(16)
.setRequired(true) .setRequired(true)
) )
.setDMPermission(false), .setContexts(InteractionContextType.Guild),
async execute({ interaction }) { async execute({ interaction }) {
await interaction.deferReply() await interaction.deferReply()

View File

@@ -1,5 +1,5 @@
import { devMessage, embedColor, hypixelGuildID } from "config/options.js" import { devMessage, embedColor, hypixelGuildID } from "config/options.js"
import { GuildMember, SlashCommandBuilder } from "discord.js" import { GuildMember, InteractionContextType, SlashCommandBuilder } from "discord.js"
import { ICommand } from "interfaces" import { ICommand } from "interfaces"
import { IPlayerData } from "interfaces" import { IPlayerData } from "interfaces"
import { IGuildData } from "interfaces" import { IGuildData } from "interfaces"
@@ -24,7 +24,7 @@ export default {
.setMaxLength(16) .setMaxLength(16)
.setRequired(true) .setRequired(true)
) )
.setDMPermission(false), .setContexts(InteractionContextType.Guild),
async execute({ interaction }) { async execute({ interaction }) {
await interaction.deferReply() await interaction.deferReply()

View File

@@ -1,5 +1,5 @@
import { devMessage, embedColor } from "config/options.js" import { devMessage, embedColor } from "config/options.js"
import { SlashCommandBuilder, userMention } from "discord.js" import { InteractionContextType, SlashCommandBuilder, userMention } from "discord.js"
import { ICommand } from "interfaces" import { ICommand } from "interfaces"
import verify from "schemas/verifyTag.js" import verify from "schemas/verifyTag.js"
import { getHeadURL, getIGN } from "utils/Hypixel.js" import { getHeadURL, getIGN } from "utils/Hypixel.js"
@@ -13,7 +13,7 @@ export default {
data: new SlashCommandBuilder() data: new SlashCommandBuilder()
.setName("whoami") .setName("whoami")
.setDescription("Get your user info") .setDescription("Get your user info")
.setDMPermission(false), .setContexts(InteractionContextType.Guild),
async execute({ interaction }) { async execute({ interaction }) {
await interaction.deferReply() await interaction.deferReply()

View File

@@ -1,5 +1,5 @@
import { devMessage, embedColor } from "config/options.js" import { devMessage, embedColor } from "config/options.js"
import { PermissionFlagsBits, SlashCommandBuilder, userMention } from "discord.js" import { InteractionContextType, PermissionFlagsBits, SlashCommandBuilder, userMention } from "discord.js"
import { ICommand } from "interfaces" import { ICommand } from "interfaces"
import verify from "schemas/verifyTag.js" import verify from "schemas/verifyTag.js"
import { getHeadURL, getIGN } from "utils/Hypixel.js" import { getHeadURL, getIGN } from "utils/Hypixel.js"
@@ -20,7 +20,7 @@ export default {
.setRequired(true) .setRequired(true)
) )
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator) .setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
.setDMPermission(false), .setContexts(InteractionContextType.Guild),
async execute({ interaction }) { async execute({ interaction }) {
await interaction.deferReply() await interaction.deferReply()

View File

@@ -1,4 +1,4 @@
import { Message } from "discord.js" import { ChannelType, Message } from "discord.js"
import { IEvent } from "interfaces" import { IEvent } from "interfaces"
import env from "utils/Env.js" import env from "utils/Env.js"
@@ -14,17 +14,20 @@ export default {
if (!message.content.startsWith("!eval")) return if (!message.content.startsWith("!eval")) return
const code = message.content.split(" ").slice(1).join(" ") const code = message.content.split(" ").slice(1).join(" ")
const channel = message.channel
if (channel.type !== ChannelType.GuildText) return
try { try {
const output = eval(code) const output = eval(code)
const outputString = String(output) const outputString = String(output)
await message.channel.send({ await channel.send({
embeds: [{ embeds: [{
description: `\`\`\`js\n${outputString}\`\`\`` description: `\`\`\`js\n${outputString}\`\`\``
}] }]
}) })
} catch (error) { } catch (error) {
await message.channel.send({ await channel.send({
embeds: [{ embeds: [{
description: `\`\`\`js\n${error}\`\`\`` description: `\`\`\`js\n${error}\`\`\``
}] }]