From 1abd1a7e9c593d2c7c701d8f748b7afb3fcb173b Mon Sep 17 00:00:00 2001 From: Taken Date: Sun, 31 Dec 2023 11:29:39 +0100 Subject: [PATCH] Removed all commands from dms --- src/commands/check.ts | 14 ++++---------- src/commands/guild.ts | 14 ++++---------- src/commands/guild/info.ts | 11 ++--------- src/commands/guild/member.ts | 11 ++--------- src/commands/guild/top.ts | 10 ++-------- src/commands/help.ts | 10 ++-------- src/commands/instructions.ts | 3 ++- src/commands/ping.ts | 14 ++++---------- src/commands/reqs.ts | 21 ++++++--------------- src/commands/uuid.ts | 13 ++++--------- 10 files changed, 32 insertions(+), 89 deletions(-) diff --git a/src/commands/check.ts b/src/commands/check.ts index 079942b..cff6c84 100644 --- a/src/commands/check.ts +++ b/src/commands/check.ts @@ -35,7 +35,8 @@ export = { .setName("ign") .setDescription("The player's IGN.") .setRequired(true), - ), + ) + .setDMPermission(false), async execute(interaction) { await interaction.deferReply({}) @@ -285,13 +286,6 @@ export = { const hypixelExp = player.networkExp || 0 const level = hypixelLevel(hypixelExp) - const footerText = interaction.guild - ? interaction.guild.name - : interaction.user.username - const footerIcon = interaction.guild - ? interaction.guild.iconURL({ forceStatic: false }) - : interaction.user.avatarURL({ forceStatic: false }) - await interaction.editReply({ embeds: [ { @@ -311,8 +305,8 @@ export = { url: head!, }, footer: { - text: footerText + " | " + devMessage, - icon_url: footerIcon!, + text: interaction.guild!.name + " | " + devMessage, + icon_url: interaction.guild!.iconURL({ forceStatic: true })!, }, fields: statsFields, }, diff --git a/src/commands/guild.ts b/src/commands/guild.ts index 944a3b8..caec139 100644 --- a/src/commands/guild.ts +++ b/src/commands/guild.ts @@ -79,7 +79,8 @@ export = { "The amount of guild members to show. [Default: 10]", ), ), - ), + ) + .setDMPermission(false), async execute(interaction) { const subcommand = interaction.options.getSubcommand() @@ -100,21 +101,14 @@ export = { return } - const footerText = interaction.guild - ? interaction.guild.name - : interaction.user.username - const footerIcon = interaction.guild - ? interaction.guild.iconURL({ forceStatic: false }) - : interaction.user.avatarURL({ forceStatic: true }) - await interaction.reply({ embeds: [ { description: "This command is currently under development", color: embedColor, footer: { - text: footerText + " | " + devMessage, - icon_url: footerIcon!, + text: interaction.guild!.name + " | " + devMessage, + icon_url: interaction.guild!.iconURL({ forceStatic: false }) || undefined, }, }, ], diff --git a/src/commands/guild/info.ts b/src/commands/guild/info.ts index 91c29ea..0ae61d7 100644 --- a/src/commands/guild/info.ts +++ b/src/commands/guild/info.ts @@ -191,13 +191,6 @@ async function guildInfo( averageGuildMembersWeeklyXPUnformatted, ) - const footerText = interaction.guild - ? interaction.guild.name - : interaction.user.username - const footerIcon = interaction.guild - ? interaction.guild.iconURL({ forceStatic: false }) - : interaction.user.avatarURL({ forceStatic: false }) - await interaction.editReply({ embeds: [ { @@ -240,8 +233,8 @@ async function guildInfo( ], color: embedColor, footer: { - text: footerText + " | " + devMessage, - icon_url: footerIcon!, + text: interaction.guild!.name + " | " + devMessage, + icon_url: interaction.guild!.iconURL({ forceStatic: false }) || undefined, }, }, ], diff --git a/src/commands/guild/member.ts b/src/commands/guild/member.ts index f692b42..2cbe1cd 100644 --- a/src/commands/guild/member.ts +++ b/src/commands/guild/member.ts @@ -167,13 +167,6 @@ async function guildMember( ":" + guildMemberJoinSeconds - const footerText = interaction.guild - ? interaction.guild.name - : interaction.user.username - const footerIcon = interaction.guild - ? interaction.guild.iconURL({ forceStatic: false }) - : interaction.user.avatarURL({ forceStatic: false }) - await interaction.editReply({ embeds: [ { @@ -210,8 +203,8 @@ async function guildMember( }, ], footer: { - text: footerText + " | " + devMessage, - icon_url: footerIcon!, + text: interaction.guild!.name + " | " + devMessage, + icon_url: interaction.guild!.iconURL({ forceStatic: false })!, }, }, ], diff --git a/src/commands/guild/top.ts b/src/commands/guild/top.ts index db16547..3d02f07 100644 --- a/src/commands/guild/top.ts +++ b/src/commands/guild/top.ts @@ -263,12 +263,6 @@ async function guildTop( } }) - const footerText = interaction.guild - ? interaction.guild.name - : interaction.user.username - const footerIcon = interaction.guild - ? interaction.guild.iconURL({ forceStatic: false }) - : interaction.user.avatarURL({ forceStatic: false }) const cacheStatusText = cacheStatus ? " | [Cache]" : "" await interaction.editReply({ @@ -285,8 +279,8 @@ async function guildTop( color: embedColor, fields: newList, footer: { - text: footerText + " | " + devMessage + cacheStatusText, - icon_url: footerIcon!, + text: interaction.guild!.name + " | " + devMessage + cacheStatusText, + icon_url: interaction.guild!.iconURL({ forceStatic: false })!, }, }, ], diff --git a/src/commands/help.ts b/src/commands/help.ts index 19a92e4..aba68dc 100644 --- a/src/commands/help.ts +++ b/src/commands/help.ts @@ -57,12 +57,6 @@ export = { } const embedColor = Number(color.replace("#", "0x")) - const footerText = interaction.guild - ? interaction.guild.name - : interaction.user.username - const footerIcon = interaction.guild - ? interaction.guild.iconURL({ forceStatic: false }) - : interaction.user.avatarURL({ forceStatic: false }) await interaction.editReply({ embeds: [ @@ -75,8 +69,8 @@ export = { url: interaction.guild!.iconURL({ forceStatic: true, })!, }, footer: { - icon_url: footerIcon!, - text: footerText + " | " + devMessage, + icon_url: interaction.guild!.iconURL({ forceStatic: false})!, + text: interaction.guild!.name + " | " + devMessage, }, }, ], diff --git a/src/commands/instructions.ts b/src/commands/instructions.ts index b26f7d5..ae9316b 100644 --- a/src/commands/instructions.ts +++ b/src/commands/instructions.ts @@ -12,7 +12,8 @@ export = { data: new SlashCommandBuilder() .setName("instructions") .setDescription("Instructions for verification") - .setDefaultMemberPermissions(PermissionFlagsBits.Administrator), + .setDefaultMemberPermissions(PermissionFlagsBits.Administrator) + .setDMPermission(false), async execute(interaction) { const embedColor = Number(color.replace("#", "0x")) diff --git a/src/commands/ping.ts b/src/commands/ping.ts index c743d17..40c1a5b 100644 --- a/src/commands/ping.ts +++ b/src/commands/ping.ts @@ -11,28 +11,22 @@ export = { data: new SlashCommandBuilder() .setName("ping") - .setDescription("Get's the bot's ping."), + .setDescription("Get's the bot's ping.") + .setDMPermission(false), async execute(interaction, client) { await interaction.deferReply() const embedColor = Number(color.replace("#", "0x")) - const footerText = interaction.guild - ? interaction.guild.name - : interaction.user.username - const footerIcon = interaction.guild - ? interaction.guild.iconURL({ forceStatic: false }) - : interaction.user.avatarURL({ forceStatic: false }) - await interaction.editReply({ embeds: [ { description: "Ping of the bot is " + client.ws.ping + "ms.", color: embedColor, footer: { - text: footerText + " | " + devMessage, - icon_url: footerIcon || undefined, + text: interaction.guild!.name + " | " + devMessage, + icon_url: interaction.guild?.iconURL({ forceStatic: false }) || undefined, }, timestamp: new Date().toISOString(), }, diff --git a/src/commands/reqs.ts b/src/commands/reqs.ts index 46c2f49..4e39e68 100644 --- a/src/commands/reqs.ts +++ b/src/commands/reqs.ts @@ -20,20 +20,13 @@ export = { data: new SlashCommandBuilder() .setName("reqs") - .setDescription("Displays the requirements for the guild."), + .setDescription("Displays the requirements for the guild.") + .setDMPermission(false), async execute(interaction) { - await interaction.deferReply({ ephemeral: true }) - const embedColor = Number(color.replace("#", "0x")) - const footerText = interaction.guild - ? interaction.guild.name - : interaction.user.username - const footerIcon = interaction.guild - ? interaction.guild.iconURL({ forceStatic: false }) - : interaction.user.avatarURL({ forceStatic: false }) - await interaction.editReply({ + await interaction.reply({ embeds: [ { title: "Requirements", @@ -42,9 +35,7 @@ export = { color: embedColor, thumbnail: { url: - interaction?.guild?.iconURL({ - forceStatic: false, - }) || "", + interaction?.guild?.iconURL({ forceStatic: false, }) || "", }, fields: [ { @@ -78,8 +69,8 @@ export = { }, ], footer: { - text: footerText + " | " + devMessage, - icon_url: footerIcon || undefined, + text: interaction.guild!.name + " | " + devMessage, + icon_url: interaction.guild!.iconURL({ forceStatic: false }) || undefined, }, }, ], diff --git a/src/commands/uuid.ts b/src/commands/uuid.ts index ab53031..4ce1f8d 100644 --- a/src/commands/uuid.ts +++ b/src/commands/uuid.ts @@ -18,7 +18,8 @@ export = { .setName("ign") .setDescription("Player's name") .setRequired(true), - ), + ) + .setDMPermission(false), async execute(interaction) { await interaction.deferReply() @@ -29,12 +30,6 @@ export = { const newIgn = (await getIGN(uuid)) as string const head = await getHeadURL(ign) const embedColor = Number(color.replace("#", "0x")) - const footerText = interaction.guild - ? interaction.guild.name - : interaction.user.username - const footerIcon = interaction.guild - ? interaction.guild.iconURL({ forceStatic: false }) - : interaction.user.avatarURL({ forceStatic: false }) if (!uuid) { interaction.editReply({ @@ -64,8 +59,8 @@ export = { url: head!, }, footer: { - text: footerText + " | " + devMessage, - icon_url: footerIcon || undefined, + text: interaction.guild!.name + " | " + devMessage, + icon_url: interaction.guild?.iconURL({ forceStatic: false }) || undefined, }, }, ],