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

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

View File

@@ -109,37 +109,38 @@ async function guildMember(interaction) {
guildMemberJoinMinutes + ":" +
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({
embeds: [
{
title: rank + displayName + guildTag,
description: "**Guild Name:** `" + guildName + "`\n" +
"**Guild Rank:** `" + guildRank + "`\n",
color: embedColor,
thumbnail: {
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 }),
},
embeds: [{
title: rank + displayName + guildTag,
description: "**Guild Name:** `" + guildName + "`\n" +
"**Guild Rank:** `" + guildRank + "`\n",
color: embedColor,
thumbnail: {
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: footerText,
icon_url: footerIcon
},
}],
})
}