Merge branch 'dev' into 'main'
Dev See merge request illegitimate/illegitimate-bot!276
This commit is contained in:
@@ -19,8 +19,9 @@
|
||||
"dev:ts": "nodemon --config nodemon.json src/index.ts",
|
||||
"dev:js": "nodemon --config nodemon-js.json dist/index.js",
|
||||
"format": "dprint fmt \"**/*.ts\"",
|
||||
"check": "tsc --noEmit",
|
||||
"lint": "eslint",
|
||||
"check": "yarn tscheck && yarn lint",
|
||||
"tscheck": "tsc && echo \"TypeScript check passed!\"",
|
||||
"lint": "eslint && echo \"Linting passed!\"",
|
||||
"lint:fix": "eslint --fix",
|
||||
"push:prod": "tsx scripts/deploy-commands.ts",
|
||||
"push:dev": "tsx scripts/dev-deploy.ts",
|
||||
|
||||
@@ -14,8 +14,7 @@ export default {
|
||||
data: new ContextMenuCommandBuilder()
|
||||
.setName("Update User")
|
||||
.setType(ApplicationCommandType.User)
|
||||
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
||||
.setDMPermission(false),
|
||||
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator),
|
||||
|
||||
async execute({ interaction }) {
|
||||
await interaction.deferReply({ ephemeral: true })
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { anilist } from "anilist"
|
||||
import { devMessage, embedColor } from "config/options.js"
|
||||
import { SlashCommandBuilder } from "discord.js"
|
||||
import { InteractionContextType, SlashCommandBuilder } from "discord.js"
|
||||
import { ICommand } from "interfaces"
|
||||
|
||||
export default {
|
||||
@@ -18,7 +18,7 @@ export default {
|
||||
.setDescription("The anime to search for")
|
||||
.setRequired(true)
|
||||
)
|
||||
.setDMPermission(false),
|
||||
.setContexts(InteractionContextType.Guild),
|
||||
|
||||
async execute({ interaction }) {
|
||||
await interaction.deferReply()
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { devMessage, embedColor } from "config/options.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 logToChannel from "utils/functions/logtochannel.js"
|
||||
|
||||
@@ -39,7 +39,7 @@ export default {
|
||||
)
|
||||
)
|
||||
.setDefaultMemberPermissions(PermissionFlagsBits.BanMembers)
|
||||
.setDMPermission(false),
|
||||
.setContexts(InteractionContextType.Guild),
|
||||
|
||||
async execute({ interaction }) {
|
||||
await interaction.deferReply()
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { execSync } from "child_process"
|
||||
import { devMessage, embedColor } from "config/options.js"
|
||||
import { SlashCommandBuilder } from "discord.js"
|
||||
import { InteractionContextType, SlashCommandBuilder } from "discord.js"
|
||||
import { ICommand } from "interfaces"
|
||||
import { createRequire } from "node:module"
|
||||
import os from "os"
|
||||
@@ -18,7 +18,7 @@ export default {
|
||||
data: new SlashCommandBuilder()
|
||||
.setName("botinfo")
|
||||
.setDescription("Get information about the bot")
|
||||
.setDMPermission(false),
|
||||
.setContexts(InteractionContextType.Guild),
|
||||
|
||||
async execute({ interaction, client }) {
|
||||
const castedDeps = dependencies as { [key: string]: string }
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { devMessage, embedColor } from "config/options.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 { bedwarsLevel, getGuild, getHeadURL, getPlayer, getUUID, hypixelLevel, skywarsLevel } from "utils/Hypixel.js"
|
||||
|
||||
@@ -21,7 +21,7 @@ export default {
|
||||
.setMaxLength(16)
|
||||
.setRequired(true)
|
||||
)
|
||||
.setDMPermission(false),
|
||||
.setContexts(InteractionContextType.Guild),
|
||||
|
||||
async execute({ interaction }) {
|
||||
await interaction.deferReply({})
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
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 logToChannel from "utils/functions/logtochannel.js"
|
||||
|
||||
@@ -19,7 +19,7 @@ export default {
|
||||
.setRequired(true)
|
||||
)
|
||||
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
||||
.setDMPermission(false),
|
||||
.setContexts(InteractionContextType.Guild),
|
||||
|
||||
async execute({ interaction }) {
|
||||
await interaction.deferReply({ ephemeral: true })
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { embedColor } from "config/options.js"
|
||||
import { PermissionFlagsBits, SlashCommandBuilder } from "discord.js"
|
||||
import { InteractionContextType, PermissionFlagsBits, SlashCommandBuilder } from "discord.js"
|
||||
import { ICommand } from "interfaces"
|
||||
import settings from "schemas/settingsTag.js"
|
||||
|
||||
@@ -28,8 +28,8 @@ export default {
|
||||
.setDescription("The value to set")
|
||||
.setRequired(true)
|
||||
)
|
||||
.setDMPermission(false)
|
||||
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator),
|
||||
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
||||
.setContexts(InteractionContextType.Guild),
|
||||
|
||||
async execute({ interaction }) {
|
||||
await interaction.deferReply()
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
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 ban from "./counting/ban.js"
|
||||
import unban from "./counting/unban.js"
|
||||
@@ -37,7 +37,7 @@ export default {
|
||||
)
|
||||
)
|
||||
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
||||
.setDMPermission(false),
|
||||
.setContexts(InteractionContextType.Guild),
|
||||
|
||||
async execute({ interaction }) {
|
||||
const subcommand = interaction.options.getSubcommand()
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
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 verify from "schemas/verifyTag.js"
|
||||
import { getHeadURL, getIGN, getUUID } from "utils/Hypixel.js"
|
||||
@@ -20,7 +20,7 @@ export default {
|
||||
.setRequired(true)
|
||||
)
|
||||
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
||||
.setDMPermission(false),
|
||||
.setContexts(InteractionContextType.Guild),
|
||||
|
||||
async execute({ interaction }) {
|
||||
await interaction.deferReply()
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
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 verify from "schemas/verifyTag.js"
|
||||
import logToChannel from "utils/functions/logtochannel.js"
|
||||
@@ -21,8 +21,8 @@ export default {
|
||||
.setDescription("The user to force unverify")
|
||||
.setRequired(true)
|
||||
)
|
||||
.setDMPermission(false)
|
||||
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator),
|
||||
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
||||
.setContexts(InteractionContextType.Guild),
|
||||
|
||||
async execute({ interaction }) {
|
||||
const member = interaction.options.getMember("user") as GuildMember
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { devMessage, embedColor, hypixelGuildID } from "config/options.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 verify from "schemas/verifyTag.js"
|
||||
import roleManage from "utils/functions/rolesmanage.js"
|
||||
@@ -22,7 +22,7 @@ export default {
|
||||
.setRequired(true)
|
||||
)
|
||||
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
||||
.setDMPermission(false),
|
||||
.setContexts(InteractionContextType.Guild),
|
||||
|
||||
async execute({ interaction }) {
|
||||
await interaction.deferReply()
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
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 verify from "schemas/verifyTag.js"
|
||||
import logToChannel from "utils/functions/logtochannel.js"
|
||||
@@ -26,7 +26,7 @@ export default {
|
||||
.setDescription("The user's in-game name.")
|
||||
)
|
||||
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
||||
.setDMPermission(false),
|
||||
.setContexts(InteractionContextType.Guild),
|
||||
|
||||
async execute({ interaction }) {
|
||||
await interaction.deferReply()
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { devMessage, embedColor } from "config/options.js"
|
||||
import { SlashCommandBuilder } from "discord.js"
|
||||
import { InteractionContextType, SlashCommandBuilder } from "discord.js"
|
||||
import { ICommand } from "interfaces"
|
||||
import guildInfo from "./guild/info.js"
|
||||
import guildMember from "./guild/member.js"
|
||||
@@ -75,7 +75,7 @@ export default {
|
||||
.setDescription("The amount of guild members to show. [Default: 10]")
|
||||
)
|
||||
)
|
||||
.setDMPermission(false),
|
||||
.setContexts(InteractionContextType.Guild),
|
||||
|
||||
async execute({ interaction }) {
|
||||
const subcommand = interaction.options.getSubcommand()
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { devMessage, embedColor } from "config/options.js"
|
||||
import { SlashCommandBuilder } from "discord.js"
|
||||
import { InteractionContextType, SlashCommandBuilder } from "discord.js"
|
||||
import { ICommand } from "interfaces"
|
||||
|
||||
export default {
|
||||
@@ -11,7 +11,7 @@ export default {
|
||||
data: new SlashCommandBuilder()
|
||||
.setName("help")
|
||||
.setDescription("List's all commands usable by a member")
|
||||
.setDMPermission(false),
|
||||
.setContexts(InteractionContextType.Guild),
|
||||
|
||||
async execute({ interaction, client }) {
|
||||
await interaction.deferReply({ ephemeral: true })
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
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"
|
||||
|
||||
export default {
|
||||
@@ -12,7 +12,7 @@ export default {
|
||||
.setName("instructions")
|
||||
.setDescription("Instructions for verification")
|
||||
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
||||
.setDMPermission(false),
|
||||
.setContexts(InteractionContextType.Guild),
|
||||
|
||||
async execute({ interaction }) {
|
||||
await interaction.reply({
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { devMessage, embedColor } from "config/options.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 logToChannel from "utils/functions/logtochannel.js"
|
||||
|
||||
@@ -25,7 +25,7 @@ export default {
|
||||
.setDescription("Reason for kicking the member.")
|
||||
)
|
||||
.setDefaultMemberPermissions(PermissionFlagsBits.KickMembers)
|
||||
.setDMPermission(false),
|
||||
.setContexts(InteractionContextType.Guild),
|
||||
|
||||
async execute({ interaction }) {
|
||||
await interaction.deferReply()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { PermissionFlagsBits, SlashCommandBuilder } from "discord.js"
|
||||
import { InteractionContextType, PermissionFlagsBits, SlashCommandBuilder } from "discord.js"
|
||||
import { ICommand } from "interfaces"
|
||||
import leave from "./music/leave.js"
|
||||
import nowplaying from "./music/nowplaying.js"
|
||||
@@ -79,8 +79,8 @@ export default {
|
||||
.setName("leave")
|
||||
.setDescription("Leave the voice channel")
|
||||
)
|
||||
.setDMPermission(false)
|
||||
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator),
|
||||
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
||||
.setContexts(InteractionContextType.Guild),
|
||||
|
||||
async execute({ interaction }) {
|
||||
const subcommand = interaction.options.getSubcommand()
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { devMessage, embedColor } from "config/options.js"
|
||||
import { SlashCommandBuilder } from "discord.js"
|
||||
import { InteractionContextType, SlashCommandBuilder } from "discord.js"
|
||||
import { ICommand } from "interfaces"
|
||||
|
||||
export default {
|
||||
@@ -11,7 +11,7 @@ export default {
|
||||
data: new SlashCommandBuilder()
|
||||
.setName("ping")
|
||||
.setDescription("Get's the bot's ping.")
|
||||
.setDMPermission(false),
|
||||
.setContexts(InteractionContextType.Guild),
|
||||
|
||||
async execute({ interaction, client }) {
|
||||
await interaction.deferReply()
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { embedColor } from "config/options.js"
|
||||
import { SlashCommandBuilder, User } from "discord.js"
|
||||
import { InteractionContextType, SlashCommandBuilder, User } from "discord.js"
|
||||
import { ICommand } from "interfaces"
|
||||
import env from "utils/Env.js"
|
||||
|
||||
@@ -18,7 +18,7 @@ export default {
|
||||
.setDescription("User to show pp size")
|
||||
.setRequired(false)
|
||||
)
|
||||
.setDMPermission(false),
|
||||
.setContexts(InteractionContextType.Guild),
|
||||
|
||||
async execute({ interaction }) {
|
||||
const user = (interaction.options.getUser("user") || interaction.user) as User
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { devMessage, embedColor } from "config/options.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 waitinglist from "schemas/waitinglistTag.js"
|
||||
import logToChannel from "utils/functions/logtochannel.js"
|
||||
@@ -27,7 +27,7 @@ export default {
|
||||
.setRequired(false)
|
||||
)
|
||||
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
||||
.setDMPermission(false),
|
||||
.setContexts(InteractionContextType.Guild),
|
||||
|
||||
async execute({ interaction }) {
|
||||
await interaction.deferReply()
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { devMessage, embedColor } from "config/options.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"
|
||||
|
||||
export default {
|
||||
@@ -12,7 +12,7 @@ export default {
|
||||
data: new SlashCommandBuilder()
|
||||
.setName("reqs")
|
||||
.setDescription("Displays the requirements for the guild.")
|
||||
.setDMPermission(false),
|
||||
.setContexts(InteractionContextType.Guild),
|
||||
|
||||
async execute({ interaction }) {
|
||||
await interaction.reply({
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
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"
|
||||
|
||||
export default {
|
||||
@@ -24,7 +24,7 @@ export default {
|
||||
.addChannelTypes(ChannelType.GuildText, ChannelType.GuildAnnouncement)
|
||||
)
|
||||
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
||||
.setDMPermission(false),
|
||||
.setContexts(InteractionContextType.Guild),
|
||||
|
||||
async execute({ interaction }) {
|
||||
await interaction.deferReply({ ephemeral: true })
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
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 logToChannel from "utils/functions/logtochannel.js"
|
||||
|
||||
@@ -25,7 +25,7 @@ export default {
|
||||
.setRequired(true)
|
||||
)
|
||||
.setDefaultMemberPermissions(PermissionFlagsBits.ManageNicknames)
|
||||
.setDMPermission(false),
|
||||
.setContexts(InteractionContextType.Guild),
|
||||
|
||||
async execute({ interaction }) {
|
||||
const member = interaction.options.getMember("user") as GuildMember
|
||||
|
||||
@@ -1,5 +1,14 @@
|
||||
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"
|
||||
|
||||
export default {
|
||||
@@ -73,7 +82,7 @@ export default {
|
||||
)
|
||||
)
|
||||
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
||||
.setDMPermission(false),
|
||||
.setContexts(InteractionContextType.Guild),
|
||||
|
||||
async execute({ interaction }) {
|
||||
const subcommand = interaction.options.getSubcommand()
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
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 logToChannel from "utils/functions/logtochannel.js"
|
||||
|
||||
@@ -24,7 +24,7 @@ export default {
|
||||
.addChannelTypes(ChannelType.GuildText, ChannelType.GuildAnnouncement)
|
||||
)
|
||||
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
||||
.setDMPermission(false),
|
||||
.setContexts(InteractionContextType.Guild),
|
||||
|
||||
async execute({ interaction }) {
|
||||
await interaction.deferReply({ ephemeral: true })
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
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 beast from "./staff/beast.js"
|
||||
import help from "./staff/help.js"
|
||||
@@ -49,7 +49,7 @@ export default {
|
||||
.setDescription("Update the discord roles of all guild members")
|
||||
)
|
||||
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
||||
.setDMPermission(false),
|
||||
.setContexts(InteractionContextType.Guild),
|
||||
|
||||
async execute({ interaction, client }) {
|
||||
const subcommand = interaction.options.getSubcommand()
|
||||
|
||||
@@ -67,7 +67,7 @@ export default async function prune(interaction: ChatInputCommandInteraction): P
|
||||
)
|
||||
]
|
||||
}).then(async (m) => {
|
||||
const collector = interaction.channel!.createMessageComponentCollector({
|
||||
const collector = m.createMessageComponentCollector({
|
||||
componentType: ComponentType.Button,
|
||||
filter: (i: ButtonInteraction) =>
|
||||
(i.customId === buttonid || i.customId === cancelid) &&
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
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 verify from "schemas/verifyTag.js"
|
||||
import env from "utils/Env.js"
|
||||
@@ -11,6 +11,17 @@ export default async function updateAll(interaction: ChatInputCommandInteraction
|
||||
await interaction.deferReply()
|
||||
|
||||
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) {
|
||||
await interaction.editReply({
|
||||
@@ -117,7 +128,7 @@ export default async function updateAll(interaction: ChatInputCommandInteraction
|
||||
|
||||
console.log("Successfully updated all roles.")
|
||||
|
||||
await interaction.channel?.send({
|
||||
await channel.send({
|
||||
embeds: [{
|
||||
description: "Successfully updated all roles.",
|
||||
color: embedColor
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
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 ms from "ms"
|
||||
import prettyMs from "pretty-ms"
|
||||
@@ -32,7 +32,7 @@ export default {
|
||||
.setDescription("The reason for the timeout")
|
||||
)
|
||||
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
||||
.setDMPermission(false),
|
||||
.setContexts(InteractionContextType.Guild),
|
||||
|
||||
async execute({ interaction }) {
|
||||
await interaction.deferReply()
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
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 logToChannel from "utils/functions/logtochannel.js"
|
||||
|
||||
@@ -26,7 +26,7 @@ export default {
|
||||
.setRequired(false)
|
||||
)
|
||||
.setDefaultMemberPermissions(PermissionFlagsBits.BanMembers)
|
||||
.setDMPermission(false),
|
||||
.setContexts(InteractionContextType.Guild),
|
||||
|
||||
async execute({ interaction }) {
|
||||
await interaction.deferReply()
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { devMessage, embedColor, hypixelGuildID } from "config/options.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 verify from "schemas/verifyTag.js"
|
||||
import roleManage from "utils/functions/rolesmanage.js"
|
||||
@@ -15,7 +15,7 @@ export default {
|
||||
data: new SlashCommandBuilder()
|
||||
.setName("update")
|
||||
.setDescription("Update your discord roles.")
|
||||
.setDMPermission(false),
|
||||
.setContexts(InteractionContextType.Guild),
|
||||
|
||||
async execute({ interaction }) {
|
||||
await interaction.deferReply()
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { devMessage, embedColor } from "config/options.js"
|
||||
import { SlashCommandBuilder } from "discord.js"
|
||||
import { InteractionContextType, SlashCommandBuilder } from "discord.js"
|
||||
import { ICommand } from "interfaces"
|
||||
import { formatUuid, getHeadURL, getIGN, getUUID } from "utils/Hypixel.js"
|
||||
|
||||
@@ -20,7 +20,7 @@ export default {
|
||||
.setMaxLength(16)
|
||||
.setRequired(true)
|
||||
)
|
||||
.setDMPermission(false),
|
||||
.setContexts(InteractionContextType.Guild),
|
||||
|
||||
async execute({ interaction }) {
|
||||
await interaction.deferReply()
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
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 { IPlayerData } from "interfaces"
|
||||
import { IGuildData } from "interfaces"
|
||||
@@ -24,7 +24,7 @@ export default {
|
||||
.setMaxLength(16)
|
||||
.setRequired(true)
|
||||
)
|
||||
.setDMPermission(false),
|
||||
.setContexts(InteractionContextType.Guild),
|
||||
|
||||
async execute({ interaction }) {
|
||||
await interaction.deferReply()
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
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 verify from "schemas/verifyTag.js"
|
||||
import { getHeadURL, getIGN } from "utils/Hypixel.js"
|
||||
@@ -13,7 +13,7 @@ export default {
|
||||
data: new SlashCommandBuilder()
|
||||
.setName("whoami")
|
||||
.setDescription("Get your user info")
|
||||
.setDMPermission(false),
|
||||
.setContexts(InteractionContextType.Guild),
|
||||
|
||||
async execute({ interaction }) {
|
||||
await interaction.deferReply()
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
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 verify from "schemas/verifyTag.js"
|
||||
import { getHeadURL, getIGN } from "utils/Hypixel.js"
|
||||
@@ -20,7 +20,7 @@ export default {
|
||||
.setRequired(true)
|
||||
)
|
||||
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
||||
.setDMPermission(false),
|
||||
.setContexts(InteractionContextType.Guild),
|
||||
|
||||
async execute({ interaction }) {
|
||||
await interaction.deferReply()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Message } from "discord.js"
|
||||
import { ChannelType, Message } from "discord.js"
|
||||
import { IEvent } from "interfaces"
|
||||
import env from "utils/Env.js"
|
||||
|
||||
@@ -14,17 +14,20 @@ export default {
|
||||
if (!message.content.startsWith("!eval")) return
|
||||
|
||||
const code = message.content.split(" ").slice(1).join(" ")
|
||||
const channel = message.channel
|
||||
|
||||
if (channel.type !== ChannelType.GuildText) return
|
||||
|
||||
try {
|
||||
const output = eval(code)
|
||||
const outputString = String(output)
|
||||
await message.channel.send({
|
||||
await channel.send({
|
||||
embeds: [{
|
||||
description: `\`\`\`js\n${outputString}\`\`\``
|
||||
}]
|
||||
})
|
||||
} catch (error) {
|
||||
await message.channel.send({
|
||||
await channel.send({
|
||||
embeds: [{
|
||||
description: `\`\`\`js\n${error}\`\`\``
|
||||
}]
|
||||
|
||||
Reference in New Issue
Block a user