Removed all commands from dms

This commit is contained in:
2023-12-31 11:29:39 +01:00
parent b5eb58a4f1
commit 1abd1a7e9c
10 changed files with 32 additions and 89 deletions

View File

@@ -35,7 +35,8 @@ export = {
.setName("ign") .setName("ign")
.setDescription("The player's IGN.") .setDescription("The player's IGN.")
.setRequired(true), .setRequired(true),
), )
.setDMPermission(false),
async execute(interaction) { async execute(interaction) {
await interaction.deferReply({}) await interaction.deferReply({})
@@ -285,13 +286,6 @@ export = {
const hypixelExp = player.networkExp || 0 const hypixelExp = player.networkExp || 0
const level = hypixelLevel(hypixelExp) 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({ await interaction.editReply({
embeds: [ embeds: [
{ {
@@ -311,8 +305,8 @@ export = {
url: head!, url: head!,
}, },
footer: { footer: {
text: footerText + " | " + devMessage, text: interaction.guild!.name + " | " + devMessage,
icon_url: footerIcon!, icon_url: interaction.guild!.iconURL({ forceStatic: true })!,
}, },
fields: statsFields, fields: statsFields,
}, },

View File

@@ -79,7 +79,8 @@ export = {
"The amount of guild members to show. [Default: 10]", "The amount of guild members to show. [Default: 10]",
), ),
), ),
), )
.setDMPermission(false),
async execute(interaction) { async execute(interaction) {
const subcommand = interaction.options.getSubcommand() const subcommand = interaction.options.getSubcommand()
@@ -100,21 +101,14 @@ export = {
return 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({ await interaction.reply({
embeds: [ embeds: [
{ {
description: "This command is currently under development", description: "This command is currently under development",
color: embedColor, color: embedColor,
footer: { footer: {
text: footerText + " | " + devMessage, text: interaction.guild!.name + " | " + devMessage,
icon_url: footerIcon!, icon_url: interaction.guild!.iconURL({ forceStatic: false }) || undefined,
}, },
}, },
], ],

View File

@@ -191,13 +191,6 @@ async function guildInfo(
averageGuildMembersWeeklyXPUnformatted, 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({ await interaction.editReply({
embeds: [ embeds: [
{ {
@@ -240,8 +233,8 @@ async function guildInfo(
], ],
color: embedColor, color: embedColor,
footer: { footer: {
text: footerText + " | " + devMessage, text: interaction.guild!.name + " | " + devMessage,
icon_url: footerIcon!, icon_url: interaction.guild!.iconURL({ forceStatic: false }) || undefined,
}, },
}, },
], ],

View File

@@ -167,13 +167,6 @@ async function guildMember(
":" + ":" +
guildMemberJoinSeconds 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({ await interaction.editReply({
embeds: [ embeds: [
{ {
@@ -210,8 +203,8 @@ async function guildMember(
}, },
], ],
footer: { footer: {
text: footerText + " | " + devMessage, text: interaction.guild!.name + " | " + devMessage,
icon_url: footerIcon!, icon_url: interaction.guild!.iconURL({ forceStatic: false })!,
}, },
}, },
], ],

View File

@@ -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]" : "" const cacheStatusText = cacheStatus ? " | [Cache]" : ""
await interaction.editReply({ await interaction.editReply({
@@ -285,8 +279,8 @@ async function guildTop(
color: embedColor, color: embedColor,
fields: newList, fields: newList,
footer: { footer: {
text: footerText + " | " + devMessage + cacheStatusText, text: interaction.guild!.name + " | " + devMessage + cacheStatusText,
icon_url: footerIcon!, icon_url: interaction.guild!.iconURL({ forceStatic: false })!,
}, },
}, },
], ],

View File

@@ -57,12 +57,6 @@ export = {
} }
const embedColor = Number(color.replace("#", "0x")) 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.editReply({
embeds: [ embeds: [
@@ -75,8 +69,8 @@ export = {
url: interaction.guild!.iconURL({ forceStatic: true, })!, url: interaction.guild!.iconURL({ forceStatic: true, })!,
}, },
footer: { footer: {
icon_url: footerIcon!, icon_url: interaction.guild!.iconURL({ forceStatic: false})!,
text: footerText + " | " + devMessage, text: interaction.guild!.name + " | " + devMessage,
}, },
}, },
], ],

View File

@@ -12,7 +12,8 @@ export = {
data: new SlashCommandBuilder() data: new SlashCommandBuilder()
.setName("instructions") .setName("instructions")
.setDescription("Instructions for verification") .setDescription("Instructions for verification")
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator), .setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
.setDMPermission(false),
async execute(interaction) { async execute(interaction) {
const embedColor = Number(color.replace("#", "0x")) const embedColor = Number(color.replace("#", "0x"))

View File

@@ -11,28 +11,22 @@ export = {
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),
async execute(interaction, client) { async execute(interaction, client) {
await interaction.deferReply() await interaction.deferReply()
const embedColor = Number(color.replace("#", "0x")) 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.editReply({
embeds: [ embeds: [
{ {
description: "Ping of the bot is " + client.ws.ping + "ms.", description: "Ping of the bot is " + client.ws.ping + "ms.",
color: embedColor, color: embedColor,
footer: { footer: {
text: footerText + " | " + devMessage, text: interaction.guild!.name + " | " + devMessage,
icon_url: footerIcon || undefined, icon_url: interaction.guild?.iconURL({ forceStatic: false }) || undefined,
}, },
timestamp: new Date().toISOString(), timestamp: new Date().toISOString(),
}, },

View File

@@ -20,20 +20,13 @@ export = {
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),
async execute(interaction) { async execute(interaction) {
await interaction.deferReply({ ephemeral: true })
const embedColor = Number(color.replace("#", "0x")) 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: [ embeds: [
{ {
title: "Requirements", title: "Requirements",
@@ -42,9 +35,7 @@ export = {
color: embedColor, color: embedColor,
thumbnail: { thumbnail: {
url: url:
interaction?.guild?.iconURL({ interaction?.guild?.iconURL({ forceStatic: false, }) || "",
forceStatic: false,
}) || "",
}, },
fields: [ fields: [
{ {
@@ -78,8 +69,8 @@ export = {
}, },
], ],
footer: { footer: {
text: footerText + " | " + devMessage, text: interaction.guild!.name + " | " + devMessage,
icon_url: footerIcon || undefined, icon_url: interaction.guild!.iconURL({ forceStatic: false }) || undefined,
}, },
}, },
], ],

View File

@@ -18,7 +18,8 @@ export = {
.setName("ign") .setName("ign")
.setDescription("Player's name") .setDescription("Player's name")
.setRequired(true), .setRequired(true),
), )
.setDMPermission(false),
async execute(interaction) { async execute(interaction) {
await interaction.deferReply() await interaction.deferReply()
@@ -29,12 +30,6 @@ export = {
const newIgn = (await getIGN(uuid)) as string const newIgn = (await getIGN(uuid)) as string
const head = await getHeadURL(ign) const head = await getHeadURL(ign)
const embedColor = Number(color.replace("#", "0x")) 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) { if (!uuid) {
interaction.editReply({ interaction.editReply({
@@ -64,8 +59,8 @@ export = {
url: head!, url: head!,
}, },
footer: { footer: {
text: footerText + " | " + devMessage, text: interaction.guild!.name + " | " + devMessage,
icon_url: footerIcon || undefined, icon_url: interaction.guild?.iconURL({ forceStatic: false }) || undefined,
}, },
}, },
], ],