Updated dm availabe commands

This commit is contained in:
2023-11-30 16:36:34 +01:00
parent b43391ae71
commit 0e4ed441a0
8 changed files with 64 additions and 46 deletions

View File

@@ -204,6 +204,9 @@ module.exports = {
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 + " | " + devMessage
const footerIcon = interaction.guild ? interaction.guild.iconURL({ dynamic: true }) : interaction.user.avatarURL({ dynamic: true })
await interaction.editReply({ await interaction.editReply({
embeds: [{ embeds: [{
title: rank + player.displayname + guildTag, title: rank + player.displayname + guildTag,
@@ -215,8 +218,8 @@ module.exports = {
url: head url: head
}, },
footer: { footer: {
text: interaction?.guild.name || interaction.user.username + " | " + devMessage, text: footerText,
icon_url: interaction?.guild.iconURL() || interaction.user.avatarURL() icon_url: footerIcon
}, },
fields: statsFields fields: statsFields
}] }]

View File

@@ -53,13 +53,16 @@ module.exports = {
return return
} }
const footerText = interaction.guild ? interaction.guild.name : interaction.user.username + " | " + devMessage
const footerIcon = interaction.guild ? interaction.guild.iconURL({ dynamic: true }) : interaction.user.avatarURL({ dynamic: true })
await interaction.editReply({ await interaction.editReply({
embeds: [{ embeds: [{
description: "This command is currently under development", description: "This command is currently under development",
color: embedColor, color: embedColor,
footer: { footer: {
text: interaction?.guild.name || interaction.user.username + " | " + devMessage, text: footerText,
icon_url: interaction?.guild.iconURL({ dynamic: true }) || interaction.user.avatarURL({ dynamic: true }) icon_url: footerIcon
} }
}] }]
}) })

View File

@@ -70,6 +70,9 @@ async function guildInfo(interaction) {
const guildMembersDailyXP = Object.values(guildMembers).map((m) => m.expHistory[Object.keys(m.expHistory)[0]]) const guildMembersDailyXP = Object.values(guildMembers).map((m) => m.expHistory[Object.keys(m.expHistory)[0]])
const totalGuildMembersDailyXP = guildMembersDailyXP.reduce((a, b) => a + b, 0) const totalGuildMembersDailyXP = guildMembersDailyXP.reduce((a, b) => a + b, 0)
const footerText = interaction.guild ? interaction.guild.name : interaction.user.username + " | " + devMessage
const footerIcon = interaction.guild ? interaction.guild.iconURL({ dynamic: true }) : interaction.user.avatarURL({ dynamic: true })
await interaction.editReply({ await interaction.editReply({
embeds: [{ embeds: [{
title: "**Info on** " + guildName, title: "**Info on** " + guildName,
@@ -95,8 +98,8 @@ async function guildInfo(interaction) {
], ],
color: embedColor, color: embedColor,
footer: { footer: {
text: interaction?.guild.name || interaction.user.username + " | " + devMessage, text: footerText,
icon_url: interaction?.guild.iconURL({ dynamic: true }) || interaction.user.avatarURL({ dynamic: true }) icon_url: footerIcon
} }
}] }]
}) })

View File

@@ -109,37 +109,38 @@ async function guildMember(interaction) {
guildMemberJoinMinutes + ":" + guildMemberJoinMinutes + ":" +
guildMemberJoinSeconds guildMemberJoinSeconds
const footerText = interaction.guild ? interaction.guild.name : interaction.user.username + " | " + devMessage
const footerIcon = interaction.guild ? interaction.guild.iconURL({ dynamic: true }) : interaction.user.avatarURL({ dynamic: true })
await interaction.editReply({ await interaction.editReply({
embeds: [ embeds: [{
{ title: rank + displayName + guildTag,
title: rank + displayName + guildTag, description: "**Guild Name:** `" + guildName + "`\n" +
description: "**Guild Name:** `" + guildName + "`\n" + "**Guild Rank:** `" + guildRank + "`\n",
"**Guild Rank:** `" + guildRank + "`\n", color: embedColor,
color: embedColor, thumbnail: {
thumbnail: { url: head,
url: head,
},
fields: [
{
name: "**Daily GEXP**",
value: expValue,
},
{
name: "**Weekly GEXP**",
value: "**➺ Total:** `" + totalWeeklyGexp + "`\n" +
"**➺ Daily avarage:** `" + averageWeeklyGexp + "`",
},
{
name: "**Join date**",
value: "**➺ **`" + guildMemberJoin + "`",
},
],
footer: {
text: interaction.guild.name + " | " + devMessage,
icon_url: interaction.guild.iconURL({ dynamic: true }),
},
}, },
], fields: [
{
name: "**Daily GEXP**",
value: expValue,
},
{
name: "**Weekly GEXP**",
value: "**➺ Total:** `" + totalWeeklyGexp + "`\n" +
"**➺ Daily avarage:** `" + averageWeeklyGexp + "`",
},
{
name: "**Join date**",
value: "**➺ **`" + guildMemberJoin + "`",
},
],
footer: {
text: footerText,
icon_url: footerIcon
},
}],
}) })
} }

View File

@@ -19,6 +19,9 @@ module.exports = {
const embedColor = Number(color.replace("#", "0x")) const embedColor = Number(color.replace("#", "0x"))
const footerText = interaction.guild ? interaction.guild.name : interaction.user.username + " | " + devMessage
const footerIcon = interaction.guild ? interaction.guild.iconURL({ dynamic: true }) : interaction.user.avatarURL({ dynamic: true })
await interaction.editReply({ await interaction.editReply({
embeds: [{ embeds: [{
title: "Commands", title: "Commands",
@@ -43,11 +46,11 @@ module.exports = {
], ],
color: embedColor, color: embedColor,
thumbnail: { thumbnail: {
url: interaction.guild.iconURL({ dynamic: true }) url: interaction?.guild.iconURL({ dynamic: true }) || null
}, },
footer: { footer: {
icon_url: interaction?.guild.iconURL({ dynamic: true }) || interaction.user.avatarURL({ dynamic: true }), icon_url: footerIcon,
text: interaction?.guild.name || interaction.user.username + " | " + devMessage text: footerText
} }
}] }]
}) })

View File

@@ -1,5 +1,5 @@
const { SlashCommandBuilder } = require("discord.js") const { SlashCommandBuilder } = require("discord.js")
const { color } = require("../../config/options.json") const { color, devMessage } = require("../../config/options.json")
module.exports = { module.exports = {
name: "ping", name: "ping",
@@ -20,15 +20,16 @@ module.exports = {
const embedColor = Number(color.replace("#", "0x")) const embedColor = Number(color.replace("#", "0x"))
console.log(client.ws.ping) const footerText = interaction.guild ? interaction.guild.name : interaction.user.username + " | " + devMessage
const footerIcon = interaction.guild ? interaction.guild.iconURL({ dynamic: true }) : interaction.user.avatarURL({ dynamic: true })
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: interaction?.guild.name || interaction.user.username, text: footerText,
icon_url: interaction?.guild.iconURL({ dynamic: true }) || interaction.user.avatarURL({ dynamic: true }) icon_url: footerIcon
}, },
timestamp: new Date() timestamp: new Date()
}] }]

View File

@@ -17,6 +17,8 @@ module.exports = {
await interaction.deferReply({ ephemeral: true }) 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 + " | " + devMessage
const footerIcon = interaction.guild ? interaction.guild.iconURL({ dynamic: true }) : interaction.user.avatarURL({ dynamic: true })
await interaction.editReply({ await interaction.editReply({
embeds: [{ embeds: [{
@@ -44,8 +46,8 @@ module.exports = {
} }
], ],
footer: { footer: {
text: interaction?.guild.name || interaction.user.username + " | " + devMessage, text: footerText,
icon_url: interaction?.guild.iconURL() || interaction.user.avatarURL() icon_url: footerIcon
} }
}] }]
}) })

View File

@@ -28,6 +28,8 @@ module.exports = {
const newIgn = await getIGN(uuid) const newIgn = await getIGN(uuid)
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 + " | " + devMessage
const footerIcon = interaction.guild ? interaction.guild.iconURL({ dynamic: true }) : interaction.user.avatarURL({ dynamic: true })
if (!uuid) { if (!uuid) {
interaction.editReply({ interaction.editReply({
@@ -47,8 +49,8 @@ module.exports = {
url: head url: head
}, },
footer: { footer: {
text: interaction?.guild.name || interaction.user.username + " | " + devMessage, text: footerText,
icon_url: interaction?.guild.iconURL({ dynamic: true }) || interaction.user.avatarURL({ dynamic: true }) icon_url: footerIcon
} }
}] }]
}) })