Merge branch 'dev' into 'main'
Dev See merge request illegitimate/illegitimate-bot!338
This commit is contained in:
@@ -1,9 +1,9 @@
|
|||||||
import { InteractionContextType, SlashCommandBuilder } from "discord.js"
|
import { InteractionContextType, SlashCommandBuilder } from "discord.js"
|
||||||
import { devMessage, embedColor } from "~/config/options"
|
import { devMessage, embedColor } from "~/config/options"
|
||||||
import { ICommand } from "~/typings"
|
import { ICommand } from "~/typings"
|
||||||
import guildInfo from "./guild/info"
|
import guildInfo, { infoSub } from "./guild/info"
|
||||||
import guildMember from "./guild/member"
|
import guildMember, { memberSub } from "./guild/member"
|
||||||
import guildTop from "./guild/top"
|
import guildTop, { topSub } from "./guild/top"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "guild",
|
name: "guild",
|
||||||
@@ -15,83 +15,26 @@ export default {
|
|||||||
data: new SlashCommandBuilder()
|
data: new SlashCommandBuilder()
|
||||||
.setName("guild")
|
.setName("guild")
|
||||||
.setDescription("Subcommands for guilds")
|
.setDescription("Subcommands for guilds")
|
||||||
.addSubcommand(subcommand =>
|
.addSubcommand(memberSub)
|
||||||
subcommand
|
.addSubcommand(infoSub)
|
||||||
.setName("member")
|
.addSubcommand(topSub)
|
||||||
.setDescription("Get info about a guild memeber")
|
|
||||||
.addStringOption(option =>
|
|
||||||
option
|
|
||||||
.setName("ign")
|
|
||||||
.setDescription("The IGN of the player.")
|
|
||||||
.setMinLength(3)
|
|
||||||
.setMaxLength(16)
|
|
||||||
.setRequired(true)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
.addSubcommand(subcommand =>
|
|
||||||
subcommand
|
|
||||||
.setName("info")
|
|
||||||
.setDescription("Get info about a guild.")
|
|
||||||
.addStringOption(option =>
|
|
||||||
option
|
|
||||||
.setName("query")
|
|
||||||
.setDescription("The query to search for. [Default: player]")
|
|
||||||
.setRequired(true)
|
|
||||||
)
|
|
||||||
.addStringOption(option =>
|
|
||||||
option
|
|
||||||
.setName("type")
|
|
||||||
.setDescription("The type of query.")
|
|
||||||
.addChoices(
|
|
||||||
{ name: "Guild Member", value: "ign" },
|
|
||||||
{ name: "Guild Name", value: "name" },
|
|
||||||
{ name: "Guild Id", value: "id" }
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
.addSubcommand(subcommand =>
|
|
||||||
subcommand
|
|
||||||
.setName("top")
|
|
||||||
.setDescription("Get the top guild members based on gexp")
|
|
||||||
.addStringOption(option =>
|
|
||||||
option
|
|
||||||
.setName("query")
|
|
||||||
.setDescription("The query to search for. [Default: player]")
|
|
||||||
.setRequired(true)
|
|
||||||
)
|
|
||||||
.addStringOption(option =>
|
|
||||||
option
|
|
||||||
.setName("type")
|
|
||||||
.setDescription("The type of query.")
|
|
||||||
.addChoices(
|
|
||||||
{ name: "Guild Member", value: "ign" },
|
|
||||||
{ name: "Guild Name", value: "name" },
|
|
||||||
{ name: "Guild Id", value: "id" }
|
|
||||||
)
|
|
||||||
)
|
|
||||||
.addNumberOption(option =>
|
|
||||||
option
|
|
||||||
.setName("amount")
|
|
||||||
.setDescription("The amount of guild members to show. [Default: 10]")
|
|
||||||
)
|
|
||||||
)
|
|
||||||
.setContexts(InteractionContextType.Guild),
|
.setContexts(InteractionContextType.Guild),
|
||||||
|
|
||||||
async execute({ interaction }) {
|
async execute({ interaction }) {
|
||||||
const subcommand = interaction.options.getSubcommand()
|
const subcommand = interaction.options.getSubcommand()
|
||||||
|
|
||||||
if (subcommand === "member") {
|
if (subcommand === "member") {
|
||||||
await guildMember(interaction)
|
await guildMember({ interaction })
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if (subcommand === "info") {
|
if (subcommand === "info") {
|
||||||
await guildInfo(interaction)
|
await guildInfo({ interaction })
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if (subcommand === "top") {
|
if (subcommand === "top") {
|
||||||
await guildTop(interaction)
|
await guildTop({ interaction })
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,30 @@
|
|||||||
|
import { SlashCommandSubcommandBuilder } from "discord.js"
|
||||||
import { devMessage, embedColor } from "~/config/options"
|
import { devMessage, embedColor } from "~/config/options"
|
||||||
import { IGuildData, SubCommand } from "~/typings"
|
import { IGuildData, SubCommand } from "~/typings"
|
||||||
import { dateTimeFormatter, numberFormatter } from "~/utils/Functions/intlFormaters"
|
import { dateTimeFormatter, numberFormatter } from "~/utils/Functions/intlFormaters"
|
||||||
import { getGuild, getIGN, getPlayer, getUUID, guildLevel } from "~/utils/Hypixel"
|
import { getGuild, getIGN, getPlayer, getUUID, guildLevel } from "~/utils/Hypixel"
|
||||||
|
|
||||||
const cmd: SubCommand = async (interaction) => {
|
export const infoSub = new SlashCommandSubcommandBuilder()
|
||||||
|
.setName("info")
|
||||||
|
.setDescription("Get info about a guild.")
|
||||||
|
.addStringOption(option =>
|
||||||
|
option
|
||||||
|
.setName("query")
|
||||||
|
.setDescription("The query to search for. [Default: player]")
|
||||||
|
.setRequired(true)
|
||||||
|
)
|
||||||
|
.addStringOption(option =>
|
||||||
|
option
|
||||||
|
.setName("type")
|
||||||
|
.setDescription("The type of query.")
|
||||||
|
.addChoices(
|
||||||
|
{ name: "Guild Member", value: "ign" },
|
||||||
|
{ name: "Guild Name", value: "name" },
|
||||||
|
{ name: "Guild Id", value: "id" }
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
const cmd: SubCommand = async ({ interaction }) => {
|
||||||
await interaction.deferReply()
|
await interaction.deferReply()
|
||||||
|
|
||||||
const query = interaction.options.getString("query")!
|
const query = interaction.options.getString("query")!
|
||||||
|
|||||||
@@ -1,9 +1,22 @@
|
|||||||
|
import { SlashCommandSubcommandBuilder } from "discord.js"
|
||||||
import { devMessage, embedColor } from "~/config/options"
|
import { devMessage, embedColor } from "~/config/options"
|
||||||
import { SubCommand } from "~/typings"
|
import { SubCommand } from "~/typings"
|
||||||
import { dateTimeFormatter, numberFormatter } from "~/utils/Functions/intlFormaters"
|
import { dateTimeFormatter, numberFormatter } from "~/utils/Functions/intlFormaters"
|
||||||
import { getGuild, getHeadURL, getPlayer, getUUID } from "~/utils/Hypixel"
|
import { getGuild, getHeadURL, getPlayer, getUUID } from "~/utils/Hypixel"
|
||||||
|
|
||||||
const cmd: SubCommand = async (interaction) => {
|
export const memberSub = new SlashCommandSubcommandBuilder()
|
||||||
|
.setName("member")
|
||||||
|
.setDescription("Get info about a guild memeber")
|
||||||
|
.addStringOption(option =>
|
||||||
|
option
|
||||||
|
.setName("ign")
|
||||||
|
.setDescription("The IGN of the player.")
|
||||||
|
.setMinLength(3)
|
||||||
|
.setMaxLength(16)
|
||||||
|
.setRequired(true)
|
||||||
|
)
|
||||||
|
|
||||||
|
const cmd: SubCommand = async ({ interaction }) => {
|
||||||
await interaction.deferReply()
|
await interaction.deferReply()
|
||||||
|
|
||||||
const ign = interaction.options.getString("ign")!
|
const ign = interaction.options.getString("ign")!
|
||||||
|
|||||||
@@ -1,10 +1,36 @@
|
|||||||
|
import { SlashCommandSubcommandBuilder } from "discord.js"
|
||||||
import { devMessage, embedColor } from "~/config/options"
|
import { devMessage, embedColor } from "~/config/options"
|
||||||
import { IGuildData, SubCommand } from "~/typings"
|
import { IGuildData, SubCommand } from "~/typings"
|
||||||
import { numberFormatter } from "~/utils/Functions/intlFormaters"
|
import { numberFormatter } from "~/utils/Functions/intlFormaters"
|
||||||
import { getGuild, getIGN, getPlayer, getUUID } from "~/utils/Hypixel"
|
import { getGuild, getIGN, getPlayer, getUUID } from "~/utils/Hypixel"
|
||||||
import { redis } from "~/utils/Illegitimate"
|
import { redis } from "~/utils/Illegitimate"
|
||||||
|
|
||||||
const cmd: SubCommand = async (interaction) => {
|
export const topSub = new SlashCommandSubcommandBuilder()
|
||||||
|
.setName("top")
|
||||||
|
.setDescription("Get the top guild members based on gexp")
|
||||||
|
.addStringOption(option =>
|
||||||
|
option
|
||||||
|
.setName("query")
|
||||||
|
.setDescription("The query to search for. [Default: player]")
|
||||||
|
.setRequired(true)
|
||||||
|
)
|
||||||
|
.addStringOption(option =>
|
||||||
|
option
|
||||||
|
.setName("type")
|
||||||
|
.setDescription("The type of query.")
|
||||||
|
.addChoices(
|
||||||
|
{ name: "Guild Member", value: "ign" },
|
||||||
|
{ name: "Guild Name", value: "name" },
|
||||||
|
{ name: "Guild Id", value: "id" }
|
||||||
|
)
|
||||||
|
)
|
||||||
|
.addNumberOption(option =>
|
||||||
|
option
|
||||||
|
.setName("amount")
|
||||||
|
.setDescription("The amount of guild members to show. [Default: 10]")
|
||||||
|
)
|
||||||
|
|
||||||
|
const cmd: SubCommand = async ({ interaction }) => {
|
||||||
await interaction.deferReply()
|
await interaction.deferReply()
|
||||||
|
|
||||||
const query = interaction.options.getString("query")!
|
const query = interaction.options.getString("query")!
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
import { InteractionContextType, PermissionFlagsBits, SlashCommandBuilder } from "discord.js"
|
import { InteractionContextType, PermissionFlagsBits, SlashCommandBuilder } from "discord.js"
|
||||||
import { devMessage, embedColor } from "~/config/options"
|
import { devMessage, embedColor } from "~/config/options"
|
||||||
import { ICommand } from "~/typings"
|
import { ICommand } from "~/typings"
|
||||||
import beast from "./staff/beast"
|
import beast, { beastSub } from "./staff/beast"
|
||||||
import help from "./staff/help"
|
import help, { helpSub } from "./staff/help"
|
||||||
import prune from "./staff/prune"
|
import prune, { pruneSub } from "./staff/prune"
|
||||||
import removeGuildRoles from "./staff/removeguildroles"
|
import removeGuildRoles, { removeGuildRolesSub } from "./staff/removeguildroles"
|
||||||
import updateAll from "./staff/updateall"
|
import updateAll, { updateAllSub } from "./staff/updateall"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "staff",
|
name: "staff",
|
||||||
@@ -17,37 +17,11 @@ export default {
|
|||||||
data: new SlashCommandBuilder()
|
data: new SlashCommandBuilder()
|
||||||
.setName("staff")
|
.setName("staff")
|
||||||
.setDescription("Subcommands for staff")
|
.setDescription("Subcommands for staff")
|
||||||
.addSubcommand(subcommand =>
|
.addSubcommand(helpSub)
|
||||||
subcommand
|
.addSubcommand(beastSub)
|
||||||
.setName("help")
|
.addSubcommand(pruneSub)
|
||||||
.setDescription("Get help with staff commands")
|
.addSubcommand(removeGuildRolesSub)
|
||||||
)
|
.addSubcommand(updateAllSub)
|
||||||
.addSubcommand(subcommand =>
|
|
||||||
subcommand
|
|
||||||
.setName("beast")
|
|
||||||
.setDescription("Check a user for beast reqs")
|
|
||||||
.addStringOption(option =>
|
|
||||||
option
|
|
||||||
.setName("ign")
|
|
||||||
.setDescription("The IGN of the player.")
|
|
||||||
.setRequired(true)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
.addSubcommand(subcommand =>
|
|
||||||
subcommand
|
|
||||||
.setName("prune")
|
|
||||||
.setDescription("Update the discord roles of all guild members")
|
|
||||||
)
|
|
||||||
.addSubcommand(subcommand =>
|
|
||||||
subcommand
|
|
||||||
.setName("removeguildroles")
|
|
||||||
.setDescription("Remove guild roles from non members")
|
|
||||||
)
|
|
||||||
.addSubcommand(subcommand =>
|
|
||||||
subcommand
|
|
||||||
.setName("updateall")
|
|
||||||
.setDescription("Update the discord roles of all guild members")
|
|
||||||
)
|
|
||||||
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
||||||
.setContexts(InteractionContextType.Guild),
|
.setContexts(InteractionContextType.Guild),
|
||||||
|
|
||||||
@@ -55,27 +29,27 @@ export default {
|
|||||||
const subcommand = interaction.options.getSubcommand()
|
const subcommand = interaction.options.getSubcommand()
|
||||||
|
|
||||||
if (subcommand === "help") {
|
if (subcommand === "help") {
|
||||||
help(interaction, client)
|
help({ interaction, client })
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if (subcommand === "beast") {
|
if (subcommand === "beast") {
|
||||||
beast(interaction)
|
beast({ interaction })
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if (subcommand === "prune") {
|
if (subcommand === "prune") {
|
||||||
prune(interaction)
|
prune({ interaction })
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if (subcommand === "removeguildroles") {
|
if (subcommand === "removeguildroles") {
|
||||||
removeGuildRoles(interaction)
|
removeGuildRoles({ interaction })
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if (subcommand === "updateall") {
|
if (subcommand === "updateall") {
|
||||||
updateAll(interaction)
|
updateAll({ interaction })
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,20 @@
|
|||||||
|
import { SlashCommandSubcommandBuilder } from "discord.js"
|
||||||
import { devMessage, embedColor } from "~/config/options"
|
import { devMessage, embedColor } from "~/config/options"
|
||||||
import { beastbwfkdr, beastbwstars, beastduelswins, beastswkdr, beastswstars, bwwins, duelswlr } from "~/config/reqs"
|
import { beastbwfkdr, beastbwstars, beastduelswins, beastswkdr, beastswstars, bwwins, duelswlr } from "~/config/reqs"
|
||||||
import { SubCommand } from "~/typings"
|
import { SubCommand } from "~/typings"
|
||||||
import { bedwarsLevel, getGuild, getHeadURL, getPlayer, getUUID, hypixelLevel, skywarsLevel } from "~/utils/Hypixel"
|
import { bedwarsLevel, getGuild, getHeadURL, getPlayer, getUUID, hypixelLevel, skywarsLevel } from "~/utils/Hypixel"
|
||||||
|
|
||||||
const cmd: SubCommand = async (interaction) => {
|
export const beastSub = new SlashCommandSubcommandBuilder()
|
||||||
|
.setName("beast")
|
||||||
|
.setDescription("Check a user for beast reqs")
|
||||||
|
.addStringOption(option =>
|
||||||
|
option
|
||||||
|
.setName("ign")
|
||||||
|
.setDescription("The IGN of the player.")
|
||||||
|
.setRequired(true)
|
||||||
|
)
|
||||||
|
|
||||||
|
const cmd: SubCommand = async ({ interaction }) => {
|
||||||
await interaction.deferReply()
|
await interaction.deferReply()
|
||||||
|
|
||||||
const ign = interaction.options.getString("ign")!
|
const ign = interaction.options.getString("ign")!
|
||||||
|
|||||||
@@ -1,8 +1,12 @@
|
|||||||
import { ActionRowBuilder, ButtonBuilder, ButtonStyle, ComponentType, MessageFlags } from "discord.js"
|
import { ActionRowBuilder, ButtonBuilder, ButtonStyle, ComponentType, MessageFlags, SlashCommandSubcommandBuilder } from "discord.js"
|
||||||
import { devMessage, embedColor } from "~/config/options"
|
import { devMessage, embedColor } from "~/config/options"
|
||||||
import { SubCommmndClient } from "~/typings"
|
import { SubCommand } from "~/typings"
|
||||||
|
|
||||||
const cmd: SubCommmndClient = async (interaction, client) => {
|
export const helpSub = new SlashCommandSubcommandBuilder()
|
||||||
|
.setName("help")
|
||||||
|
.setDescription("Get help with staff commands")
|
||||||
|
|
||||||
|
const cmd: SubCommand<true> = async ({ interaction, client }) => {
|
||||||
await interaction.deferReply()
|
await interaction.deferReply()
|
||||||
|
|
||||||
type CommandList = {
|
type CommandList = {
|
||||||
|
|||||||
@@ -1,9 +1,13 @@
|
|||||||
import { ActionRowBuilder, ButtonBuilder, ButtonInteraction, ButtonStyle, ComponentType } from "discord.js"
|
import { ActionRowBuilder, ButtonBuilder, ButtonInteraction, ButtonStyle, ComponentType, SlashCommandSubcommandBuilder } from "discord.js"
|
||||||
import { devMessage, embedColor } from "~/config/options"
|
import { devMessage, embedColor } from "~/config/options"
|
||||||
import { SubCommand } from "~/typings"
|
import { SubCommand } from "~/typings"
|
||||||
import env from "~/utils/Env"
|
import env from "~/utils/Env"
|
||||||
|
|
||||||
const cmd: SubCommand = async (interaction) => {
|
export const pruneSub = new SlashCommandSubcommandBuilder()
|
||||||
|
.setName("prune")
|
||||||
|
.setDescription("Update the discord roles of all guild members")
|
||||||
|
|
||||||
|
const cmd: SubCommand = async ({ interaction }) => {
|
||||||
await interaction.deferReply()
|
await interaction.deferReply()
|
||||||
|
|
||||||
if (interaction.user.id !== env.prod.DEV) {
|
if (interaction.user.id !== env.prod.DEV) {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { GuildMember } from "discord.js"
|
import { GuildMember, SlashCommandSubcommandBuilder } from "discord.js"
|
||||||
import { getVerifies } from "src/drizzle/functions"
|
import { getVerifies } from "src/drizzle/functions"
|
||||||
import { embedColor, hypixelGuildID } from "~/config/options"
|
import { embedColor, hypixelGuildID } from "~/config/options"
|
||||||
import { IGuildData, SubCommand } from "~/typings"
|
import { IGuildData, SubCommand } from "~/typings"
|
||||||
@@ -6,7 +6,11 @@ import env from "~/utils/Env"
|
|||||||
import roleManage from "~/utils/Functions/rolesmanage"
|
import roleManage from "~/utils/Functions/rolesmanage"
|
||||||
import { getGuild } from "~/utils/Hypixel"
|
import { getGuild } from "~/utils/Hypixel"
|
||||||
|
|
||||||
const cmd: SubCommand = async (interaction) => {
|
export const removeGuildRolesSub = new SlashCommandSubcommandBuilder()
|
||||||
|
.setName("removeguildroles")
|
||||||
|
.setDescription("Remove guild roles from non members")
|
||||||
|
|
||||||
|
const cmd: SubCommand = async ({ interaction }) => {
|
||||||
await interaction.deferReply()
|
await interaction.deferReply()
|
||||||
|
|
||||||
const discordMember = interaction.member as GuildMember
|
const discordMember = interaction.member as GuildMember
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { ChannelType, GuildMember } from "discord.js"
|
import { ChannelType, GuildMember, SlashCommandSubcommandBuilder } from "discord.js"
|
||||||
import { getVerifies } from "src/drizzle/functions"
|
import { getVerifies } from "src/drizzle/functions"
|
||||||
import { embedColor, hypixelGuildID } from "~/config/options"
|
import { embedColor, hypixelGuildID } from "~/config/options"
|
||||||
import { IGuildData, SubCommand } from "~/typings"
|
import { IGuildData, SubCommand } from "~/typings"
|
||||||
@@ -8,7 +8,11 @@ import roleManage from "~/utils/Functions/rolesmanage"
|
|||||||
import { getGuild, getIGN } from "~/utils/Hypixel"
|
import { getGuild, getIGN } from "~/utils/Hypixel"
|
||||||
import { log } from "~/utils/Logger"
|
import { log } from "~/utils/Logger"
|
||||||
|
|
||||||
const cmd: SubCommand = async (interaction) => {
|
export const updateAllSub = new SlashCommandSubcommandBuilder()
|
||||||
|
.setName("updateall")
|
||||||
|
.setDescription("Update the discord roles of all guild members")
|
||||||
|
|
||||||
|
const cmd: SubCommand = async ({ interaction }) => {
|
||||||
await interaction.deferReply()
|
await interaction.deferReply()
|
||||||
|
|
||||||
const discordMember = interaction.member as GuildMember
|
const discordMember = interaction.member as GuildMember
|
||||||
|
|||||||
@@ -1,5 +1,14 @@
|
|||||||
import { ChatInputCommandInteraction } from "discord.js"
|
import { ChatInputCommandInteraction } from "discord.js"
|
||||||
import { ExtendedClient } from "~/utils/Client"
|
import { ExtendedClient } from "~/utils/Client"
|
||||||
|
|
||||||
export type SubCommand = (interaction: ChatInputCommandInteraction) => Promise<void>
|
type InteractionObject = {
|
||||||
export type SubCommmndClient = (interaction: ChatInputCommandInteraction, client: ExtendedClient) => Promise<void>
|
interaction: ChatInputCommandInteraction
|
||||||
|
}
|
||||||
|
|
||||||
|
type ClientObject = {
|
||||||
|
client: ExtendedClient
|
||||||
|
}
|
||||||
|
|
||||||
|
type SubCommandObject<T extends boolean> = T extends true ? InteractionObject & ClientObject : InteractionObject
|
||||||
|
|
||||||
|
export type SubCommand<T extends boolean = false> = (arg: SubCommandObject<T>) => Promise<void>
|
||||||
|
|||||||
Reference in New Issue
Block a user