Updated guild command formatting

This commit is contained in:
2024-01-19 22:05:39 +01:00
parent 3eed20e788
commit f34923e2c5
4 changed files with 237 additions and 420 deletions

View File

@@ -33,9 +33,7 @@ export = {
.addStringOption(option => .addStringOption(option =>
option option
.setName("query") .setName("query")
.setDescription( .setDescription("The query to search for. [Default: player]")
"The query to search for. [Default: player]"
)
.setRequired(true) .setRequired(true)
) )
.addStringOption(option => .addStringOption(option =>
@@ -56,9 +54,7 @@ export = {
.addStringOption(option => .addStringOption(option =>
option option
.setName("query") .setName("query")
.setDescription( .setDescription("The query to search for. [Default: player]")
"The query to search for. [Default: player]"
)
.setRequired(true) .setRequired(true)
) )
.addStringOption(option => .addStringOption(option =>
@@ -74,9 +70,7 @@ export = {
.addNumberOption(option => .addNumberOption(option =>
option option
.setName("amount") .setName("amount")
.setDescription( .setDescription("The amount of guild members to show. [Default: 10]")
"The amount of guild members to show. [Default: 10]"
)
) )
) )
.setDMPermission(false), .setDMPermission(false),
@@ -101,16 +95,14 @@ export = {
} }
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: interaction.guild!.name + " | " + devMessage, text: interaction.guild!.name + " | " + devMessage,
icon_url: interaction.guild!.iconURL() || undefined icon_url: interaction.guild!.iconURL() || undefined
} }
} }]
]
}) })
} }
} as Command } as Command

View File

@@ -3,9 +3,7 @@ import { color, devMessage } from "config/options.json"
import { ChatInputCommandInteraction } from "discord.js" import { ChatInputCommandInteraction } from "discord.js"
import { GuildData } from "interfaces" import { GuildData } from "interfaces"
export default async function guildInfo( export default async function guildInfo(interaction: ChatInputCommandInteraction): Promise<void> {
interaction: ChatInputCommandInteraction
): Promise<void> {
await interaction.deferReply() await interaction.deferReply()
const query = interaction.options.getString("query")! const query = interaction.options.getString("query")!
@@ -15,111 +13,91 @@ export default async function guildInfo(
if (type === "ign") { if (type === "ign") {
await interaction.editReply({ await interaction.editReply({
embeds: [ embeds: [{
{
description: "Fetching your uuid...", description: "Fetching your uuid...",
color: embedColor color: embedColor
} }]
]
}) })
const uuid = await getUUID(query) const uuid = await getUUID(query)
if (!uuid) { if (!uuid) {
interaction.editReply({ interaction.editReply({
embeds: [ embeds: [{
{
description: "That player doen't exist!", description: "That player doen't exist!",
color: embedColor color: embedColor
} }]
]
}) })
return return
} }
await interaction.editReply({ await interaction.editReply({
embeds: [ embeds: [{
{
description: "Fetching your player data...", description: "Fetching your player data...",
color: embedColor color: embedColor
} }]
]
}) })
const player = await getPlayer(uuid) const player = await getPlayer(uuid)
if (!player) { if (!player) {
interaction.editReply({ interaction.editReply({
embeds: [ embeds: [{
{
description: "That player has never joined the server!", description: "That player has never joined the server!",
color: embedColor color: embedColor
} }]
]
}) })
return return
} }
await interaction.editReply({ await interaction.editReply({
embeds: [ embeds: [{
{
description: "Fetching your guild data...", description: "Fetching your guild data...",
color: embedColor color: embedColor
} }]
]
}) })
guild = await getGuild(uuid, "player") guild = await getGuild(uuid, "player")
if (!guild) { if (!guild) {
interaction.editReply({ interaction.editReply({
embeds: [ embeds: [{
{
description: "That player is not in a guild!", description: "That player is not in a guild!",
color: embedColor color: embedColor
} }]
]
}) })
return return
} }
} else if (type === "name") { } else if (type === "name") {
await interaction.editReply({ await interaction.editReply({
embeds: [ embeds: [{
{
description: "Fetching your guild data...", description: "Fetching your guild data...",
color: embedColor color: embedColor
} }]
]
}) })
guild = await getGuild(query, "name") guild = await getGuild(query, "name")
if (!guild) { if (!guild) {
interaction.editReply({ interaction.editReply({
embeds: [ embeds: [{
{
description: "That guild doesn't exist!", description: "That guild doesn't exist!",
color: embedColor color: embedColor
} }]
]
}) })
return return
} }
} else if (type === "id") { } else if (type === "id") {
await interaction.editReply({ await interaction.editReply({
embeds: [ embeds: [{
{
description: "Fetching your guild data...", description: "Fetching your guild data...",
color: embedColor color: embedColor
} }]
]
}) })
guild = await getGuild(query, "id") guild = await getGuild(query, "id")
if (!guild) { if (!guild) {
interaction.editReply({ interaction.editReply({
embeds: [ embeds: [{
{
description: "That guild doesn't exist!", description: "That guild doesn't exist!",
color: embedColor color: embedColor
} }]
]
}) })
return return
} }
@@ -142,66 +120,35 @@ export default async function guildInfo(
const guildCreatedSecond = guildCreated.getSeconds() const guildCreatedSecond = guildCreated.getSeconds()
const guildCreatedTime = const guildCreatedTime =
guildCreatedDate + guildCreatedDate + "." +
"." + guildCreatedMonth + "." +
guildCreatedMonth + guildCreatedYear + " " +
"." + guildCreatedHour + ":" +
guildCreatedYear + guildCreatedMinute + ":" +
" " +
guildCreatedHour +
":" +
guildCreatedMinute +
":" +
guildCreatedSecond guildCreatedSecond
const guildOwner = guildMembers.find(m => m.rank === "Guild Master")!.uuid const guildOwner = guildMembers.find(m => m.rank === "Guild Master")!.uuid
const guildOwnerName = await getIGN(guildOwner) const guildOwnerName = await getIGN(guildOwner)
const guildRanksUnsorted = guild!.ranks.sort( const guildRanksUnsorted = guild!.ranks.sort((a, b) => b.priority - a.priority
(a, b) => b.priority - a.priority
) )
const guildRanks = guildRanksUnsorted const guildRanks = guildRanksUnsorted.map(r => "**➺ " + r.name + "** `[" + r.tag + "]`").join("\n")
.map(r => "**➺ " + r.name + "** `[" + r.tag + "]`")
.join("\n")
const allGuildMembersWeeklyXP = guildMembers.map( const allGuildMembersWeeklyXP = guildMembers.map(member => member.expHistory)
member => member.expHistory const guildMembersWeeklyXP = allGuildMembersWeeklyXP.map(member => { return Object.values(member).reduce((a, b) => a + b, 0) })
)
const guildMembersWeeklyXP = allGuildMembersWeeklyXP.map(member => {
return Object.values(member).reduce((a, b) => a + b, 0)
})
const totalGuildMembersWeeklyXPUnformatted = guildMembersWeeklyXP.reduce( const totalGuildMembersWeeklyXPUnformatted = guildMembersWeeklyXP.reduce((a, b) => a + b, 0)
(a, b) => a + b, const totalGuildMembersWeeklyXP = new Intl.NumberFormat("en-US").format(totalGuildMembersWeeklyXPUnformatted)
0
)
const totalGuildMembersWeeklyXP = new Intl.NumberFormat("en-US").format(
totalGuildMembersWeeklyXPUnformatted
)
const averageGuildMembersWeeklyXPUnformatted = Math.round( const averageGuildMembersWeeklyXPUnformatted = Math.round(totalGuildMembersWeeklyXPUnformatted / 7)
totalGuildMembersWeeklyXPUnformatted / 7 const averageGuildMembersWeeklyXP = new Intl.NumberFormat("en-US").format(averageGuildMembersWeeklyXPUnformatted)
)
const averageGuildMembersWeeklyXP = new Intl.NumberFormat("en-US").format(
averageGuildMembersWeeklyXPUnformatted
)
await interaction.editReply({ await interaction.editReply({
embeds: [ embeds: [{
{
title: "**Info on** " + guildName, title: "**Info on** " + guildName,
description: description: "**Guild Name: **`" + guildName + "`\n" +
"**Guild Name: **`" + "**Guild Tag: **`" + guildTag + "`\n" +
guildName + "**Guild Level: **`" + guildLvl + "`\n" +
"`\n" + "**Guild Owner: **`" + guildOwnerName + "`",
"**Guild Tag: **`" +
guildTag +
"`\n" +
"**Guild Level: **`" +
guildLvl +
"`\n" +
"**Guild Owner: **`" +
guildOwnerName +
"`",
fields: [ fields: [
{ {
name: "**Guild Ranks**", name: "**Guild Ranks**",
@@ -210,15 +157,9 @@ export default async function guildInfo(
{ {
name: "**GEXP**", name: "**GEXP**",
value: value:
"**➺ Total weekly GEXP:** `" + "**➺ Total weekly GEXP:** `" + totalGuildMembersWeeklyXP + "`\n" +
totalGuildMembersWeeklyXP + "**➺ Daily avarage:** `" + averageGuildMembersWeeklyXP + "`\n" +
"`\n" + "**➺ Total GEXP:** `" + guildExp + "`"
"**➺ Daily avarage:** `" +
averageGuildMembersWeeklyXP +
"`\n" +
"**➺ Total GEXP:** `" +
guildExp +
"`"
}, },
{ {
name: "**Guild Created**", name: "**Guild Created**",
@@ -230,7 +171,6 @@ export default async function guildInfo(
text: interaction.guild!.name + " | " + devMessage, text: interaction.guild!.name + " | " + devMessage,
icon_url: interaction.guild!.iconURL() || undefined icon_url: interaction.guild!.iconURL() || undefined
} }
} }]
]
}) })
} }

View File

@@ -2,51 +2,42 @@ import { getUUID, getPlayer, getGuild, getHeadURL } from "utils/Hypixel"
import { color, devMessage } from "config/options.json" import { color, devMessage } from "config/options.json"
import { ChatInputCommandInteraction } from "discord.js" import { ChatInputCommandInteraction } from "discord.js"
export default async function guildMember( export default async function guildMember(interaction: ChatInputCommandInteraction): Promise<void> {
interaction: ChatInputCommandInteraction
): Promise<void> {
await interaction.deferReply() await interaction.deferReply()
const ign = interaction.options.getString("ign")! const ign = interaction.options.getString("ign")!
const embedColor = Number(color.replace("#", "0x")) const embedColor = Number(color.replace("#", "0x"))
await interaction.editReply({ await interaction.editReply({
embeds: [ embeds: [{
{
description: "Fetching your uuid...", description: "Fetching your uuid...",
color: embedColor color: embedColor
} }]
]
}) })
const uuid = await getUUID(ign) const uuid = await getUUID(ign)
if (!uuid) { if (!uuid) {
interaction.editReply({ interaction.editReply({
embeds: [ embeds: [{
{
description: "This user does not exist", description: "This user does not exist",
color: embedColor color: embedColor
} }]
]
}) })
return return
} }
await interaction.editReply({ await interaction.editReply({
embeds: [ embeds: [{
{
description: "Fetching your player data...", description: "Fetching your player data...",
color: embedColor color: embedColor
} }]
]
}) })
const head = await getHeadURL(ign) const head = await getHeadURL(ign)
const player = await getPlayer(uuid) const player = await getPlayer(uuid)
if (!player) { if (!player) {
await interaction.editReply({ await interaction.editReply({
embeds: [ embeds: [{
{
description: "This user never logged on to hypixel", description: "This user never logged on to hypixel",
color: embedColor, color: embedColor,
thumbnail: { thumbnail: {
@@ -56,8 +47,7 @@ export default async function guildMember(
text: interaction.guild!.name + " | " + devMessage, text: interaction.guild!.name + " | " + devMessage,
icon_url: interaction.guild!.iconURL() || undefined icon_url: interaction.guild!.iconURL() || undefined
} }
} }]
]
}) })
return return
} }
@@ -80,19 +70,16 @@ export default async function guildMember(
} }
await interaction.editReply({ await interaction.editReply({
embeds: [ embeds: [{
{
description: "Fetching your guild data...", description: "Fetching your guild data...",
color: embedColor color: embedColor
} }]
]
}) })
const guild = await getGuild(uuid) const guild = await getGuild(uuid)
if (!guild) { if (!guild) {
await interaction.editReply({ await interaction.editReply({
embeds: [ embeds: [{
{
description: "This user is not in a guild", description: "This user is not in a guild",
color: embedColor, color: embedColor,
thumbnail: { thumbnail: {
@@ -102,8 +89,7 @@ export default async function guildMember(
text: interaction.guild!.name + " | " + devMessage, text: interaction.guild!.name + " | " + devMessage,
icon_url: interaction.guild!.iconURL() || undefined icon_url: interaction.guild!.iconURL() || undefined
} }
} }]
]
}) })
return return
} }
@@ -116,30 +102,13 @@ export default async function guildMember(
const guildRank = guildMember!.rank const guildRank = guildMember!.rank
const memberGexp = guildMember!.expHistory const memberGexp = guildMember!.expHistory
const allDaysGexp = Object.keys(memberGexp).map(key => { const allDaysGexp = Object.keys(memberGexp).map(key => {
return ( return ("**➺ " + key + ":** " + "`" + new Intl.NumberFormat("en-US").format(memberGexp[key]) + "`" + "\n")
"**➺ " +
key +
":** " +
"`" +
new Intl.NumberFormat("en-US").format(memberGexp[key]) +
"`" +
"\n"
)
}) })
const expValue = allDaysGexp.join("") const expValue = allDaysGexp.join("")
const totalWeeklyGexpUnformatted = Object.values(memberGexp).reduce( const totalWeeklyGexpUnformatted = Object.values(memberGexp).reduce((a, b) => a + b, 0)
(a, b) => a + b, const totalWeeklyGexp = new Intl.NumberFormat("en-US").format(totalWeeklyGexpUnformatted)
0 const averageWeeklyGexpUnformatted = Math.round(totalWeeklyGexpUnformatted / 7)
) const averageWeeklyGexp = new Intl.NumberFormat("en-US").format(averageWeeklyGexpUnformatted)
const totalWeeklyGexp = new Intl.NumberFormat("en-US").format(
totalWeeklyGexpUnformatted
)
const averageWeeklyGexpUnformatted = Math.round(
totalWeeklyGexpUnformatted / 7
)
const averageWeeklyGexp = new Intl.NumberFormat("en-US").format(
averageWeeklyGexpUnformatted
)
const guildMemberJoinMS = guildMember!.joined const guildMemberJoinMS = guildMember!.joined
const guildMemberJoinTime = new Date(guildMemberJoinMS) const guildMemberJoinTime = new Date(guildMemberJoinMS)
@@ -151,29 +120,18 @@ export default async function guildMember(
const guildMemberJoinSeconds = guildMemberJoinTime.getSeconds() const guildMemberJoinSeconds = guildMemberJoinTime.getSeconds()
const guildMemberJoin = const guildMemberJoin =
guildMemberJoinDate + guildMemberJoinDate + "." +
"." + guildMemberJoinMonth + "." +
guildMemberJoinMonth + guildMemberJoinYear + " " +
"." + guildMemberJoinHours + ":" +
guildMemberJoinYear + guildMemberJoinMinutes + ":" +
" " +
guildMemberJoinHours +
":" +
guildMemberJoinMinutes +
":" +
guildMemberJoinSeconds guildMemberJoinSeconds
await interaction.editReply({ await interaction.editReply({
embeds: [ embeds: [{
{
title: rank + displayName + guildTag, title: rank + displayName + guildTag,
description: description: "**Guild Name:** `" + guildName + "`\n" +
"**Guild Name:** `" + "**Guild Rank:** `" + guildRank + "`\n",
guildName +
"`\n" +
"**Guild Rank:** `" +
guildRank +
"`\n",
color: embedColor, color: embedColor,
thumbnail: { thumbnail: {
url: head! url: head!
@@ -186,12 +144,8 @@ export default async function guildMember(
{ {
name: "**Weekly GEXP**", name: "**Weekly GEXP**",
value: value:
"**➺ Total:** `" + "**➺ Total:** `" + totalWeeklyGexp + "`\n" +
totalWeeklyGexp + "**➺ Daily avarage:** `" + averageWeeklyGexp + "`"
"`\n" +
"**➺ Daily avarage:** `" +
averageWeeklyGexp +
"`"
}, },
{ {
name: "**Join date**", name: "**Join date**",
@@ -202,7 +156,6 @@ export default async function guildMember(
text: interaction.guild!.name + " | " + devMessage, text: interaction.guild!.name + " | " + devMessage,
icon_url: interaction.guild!.iconURL() || undefined icon_url: interaction.guild!.iconURL() || undefined
} }
} }]
]
}) })
} }

View File

@@ -5,9 +5,7 @@ import { GuildData } from "interfaces"
import Illegitimate from "utils/Illegitimate" import Illegitimate from "utils/Illegitimate"
const redis = Illegitimate.redis const redis = Illegitimate.redis
export default async function guildTop( export default async function guildTop(interaction: ChatInputCommandInteraction): Promise<void> {
interaction: ChatInputCommandInteraction
): Promise<void> {
await interaction.deferReply() await interaction.deferReply()
const query = interaction.options.getString("query")! const query = interaction.options.getString("query")!
@@ -18,123 +16,101 @@ export default async function guildTop(
if (interaction.channel!.type === ChannelType.DM) { if (interaction.channel!.type === ChannelType.DM) {
interaction.editReply({ interaction.editReply({
embeds: [ embeds: [{
{
description: "You can't use this command in DMs!", description: "You can't use this command in DMs!",
color: embedColor color: embedColor
} }]
]
}) })
return return
} }
if (type === "ign") { if (type === "ign") {
await interaction.editReply({ await interaction.editReply({
embeds: [ embeds: [{
{
description: "Fetching your uuid...", description: "Fetching your uuid...",
color: embedColor color: embedColor
} }]
]
}) })
const uuid = await getUUID(query) const uuid = await getUUID(query)
if (!uuid) { if (!uuid) {
interaction.editReply({ interaction.editReply({
embeds: [ embeds: [{
{
description: "That player doen't exist!", description: "That player doen't exist!",
color: embedColor color: embedColor
} }]
]
}) })
return return
} }
await interaction.editReply({ await interaction.editReply({
embeds: [ embeds: [{
{
description: "Fetching your player data...", description: "Fetching your player data...",
color: embedColor color: embedColor
} }]
]
}) })
const player = await getPlayer(uuid) const player = await getPlayer(uuid)
if (!player) { if (!player) {
interaction.editReply({ interaction.editReply({
embeds: [ embeds: [{
{
description: "That player has never joined the server!", description: "That player has never joined the server!",
color: embedColor color: embedColor
} }]
]
}) })
return return
} }
await interaction.editReply({ await interaction.editReply({
embeds: [ embeds: [{
{
description: "Fetching your guild data...", description: "Fetching your guild data...",
color: embedColor color: embedColor
} }]
]
}) })
guild = await getGuild(uuid, "player") guild = await getGuild(uuid, "player")
if (!guild) { if (!guild) {
interaction.editReply({ interaction.editReply({
embeds: [ embeds: [{
{
description: "That player is not in a guild!", description: "That player is not in a guild!",
color: embedColor color: embedColor
} }]
]
}) })
return return
} }
} else if (type === "name") { } else if (type === "name") {
await interaction.editReply({ await interaction.editReply({
embeds: [ embeds: [{
{
description: "Fetching your guild data...", description: "Fetching your guild data...",
color: embedColor color: embedColor
} }]
]
}) })
guild = await getGuild(query, "name") guild = await getGuild(query, "name")
if (!guild) { if (!guild) {
interaction.editReply({ interaction.editReply({
embeds: [ embeds: [{
{
description: "That guild doesn't exist!", description: "That guild doesn't exist!",
color: embedColor color: embedColor
} }]
]
}) })
return return
} }
} else if (type === "id") { } else if (type === "id") {
await interaction.editReply({ await interaction.editReply({
embeds: [ embeds: [{
{
description: "Fetching your guild data...", description: "Fetching your guild data...",
color: embedColor color: embedColor
} }]
]
}) })
guild = await getGuild(query, "id") guild = await getGuild(query, "id")
if (!guild) { if (!guild) {
interaction.editReply({ interaction.editReply({
embeds: [ embeds: [{
{
description: "That guild doesn't exist!", description: "That guild doesn't exist!",
color: embedColor color: embedColor
} }]
]
}) })
return return
} }
@@ -146,21 +122,13 @@ export default async function guildTop(
const cachedData = await redis.get("guildTop+" + guildId) const cachedData = await redis.get("guildTop+" + guildId)
const gexpTodayUnformatted = guildMembers const gexpTodayUnformatted = guildMembers.map(member => {
.map(member => {
return member.expHistory[Object.keys(member.expHistory)[0]] return member.expHistory[Object.keys(member.expHistory)[0]]
}) }).reduce((a, b) => a + b, 0)
.reduce((a, b) => a + b, 0) const gexpToday = new Intl.NumberFormat("en-US").format(gexpTodayUnformatted)
const gexpToday = new Intl.NumberFormat("en-US").format(
gexpTodayUnformatted
)
const averageGuildMemberGEXPUnformatted = Math.floor( const averageGuildMemberGEXPUnformatted = Math.floor(gexpTodayUnformatted / guildMembers.length)
gexpTodayUnformatted / guildMembers.length const averageGuildMemberGEXP = new Intl.NumberFormat("en-US").format(averageGuildMemberGEXPUnformatted)
)
const averageGuildMemberGEXP = new Intl.NumberFormat("en-US").format(
averageGuildMemberGEXPUnformatted
)
const allMembersDailyGEXP = guildMembers.map(member => { const allMembersDailyGEXP = guildMembers.map(member => {
return { return {
@@ -184,24 +152,15 @@ export default async function guildTop(
let guildData: GuildTopData = [] let guildData: GuildTopData = []
const fieldsValueRaw: string[] = [] const fieldsValueRaw: string[] = []
const allMembersSorted = allMembersDailyGEXP.sort((a, b) => b.gexp - a.gexp) const allMembersSorted = allMembersDailyGEXP.sort((a, b) => b.gexp - a.gexp)
const allMembersSortedUUIDArray = allMembersSorted.map(member => { const allMembersSortedUUIDArray = allMembersSorted.map(member => { return member.uuid })
return member.uuid
})
if (!cachedData) { if (!cachedData) {
cacheStatus = false cacheStatus = false
await interaction.editReply({ await interaction.editReply({
embeds: [ embeds: [{
{ description: "Fetching the top " + amount + " members of " + guildName + "...",
description:
"Fetching the top " +
amount +
" members of " +
guildName +
"...",
color: embedColor color: embedColor
} }]
]
}) })
for (let i = 0; i < allMembersSortedUUIDArray.length; i++) { for (let i = 0; i < allMembersSortedUUIDArray.length; i++) {
@@ -214,26 +173,14 @@ export default async function guildTop(
}) })
} }
await redis.set( await redis.set("guildTop+" + guildId, JSON.stringify(guildData), "EX", 60 * 30)
"guildTop+" + guildId,
JSON.stringify(guildData),
"EX",
60 * 30
)
} else { } else {
cacheStatus = true cacheStatus = true
await interaction.editReply({ await interaction.editReply({
embeds: [ embeds: [{
{ description: "Fetching the top " + amount + " members of " + guildName + "using cache...",
description:
"Fetching the top " +
amount +
" members of " +
guildName +
"using cache...",
color: embedColor color: embedColor
} }]
]
}) })
guildData = JSON.parse(cachedData) guildData = JSON.parse(cachedData)
} }
@@ -243,18 +190,14 @@ export default async function guildTop(
for (let i = 0; i < amount; i++) { for (let i = 0; i < amount; i++) {
const gexp = new Intl.NumberFormat("en-US").format(topMembers[i].gexp) const gexp = new Intl.NumberFormat("en-US").format(topMembers[i].gexp)
const ign = guildData.find( const ign = guildData.find(member => member.uuid === topMembers[i].uuid)?.ign
member => member.uuid === topMembers[i].uuid
)?.ign
const position = i + 1 const position = i + 1
fieldsValueRaw.push("**#" + position + " " + ign + ":** `" + gexp + "`") fieldsValueRaw.push("**#" + position + " " + ign + ":** `" + gexp + "`")
} }
const list = Array.from({ length: sliceSize }, (_, i) => const list = Array.from({ length: sliceSize }, (_, i) => fieldsValueRaw.slice(i * sliceSize, (i + 1) * sliceSize))
fieldsValueRaw.slice(i * sliceSize, (i + 1) * sliceSize)
)
const newList: NewList = [] const newList: NewList = []
list.forEach((item, index) => { list.forEach((item, index) => {
@@ -270,27 +213,16 @@ export default async function guildTop(
const cacheStatusText = cacheStatus ? " | [Cache]" : "" const cacheStatusText = cacheStatus ? " | [Cache]" : ""
await interaction.editReply({ await interaction.editReply({
embeds: [ embeds: [{
{
title: "Top members of " + guildName, title: "Top members of " + guildName,
description: description: "**Total daily GEXP:** `" + gexpToday + "`\n" +
"**Total daily GEXP:** `" + "**Average guild memeber GEXP:** `" + averageGuildMemberGEXP + "`",
gexpToday +
"`\n" +
"**Average guild memeber GEXP:** `" +
averageGuildMemberGEXP +
"`",
color: embedColor, color: embedColor,
fields: newList, fields: newList,
footer: { footer: {
text: text: interaction.guild!.name + " | " + devMessage + cacheStatusText,
interaction.guild!.name +
" | " +
devMessage +
cacheStatusText,
icon_url: interaction.guild!.iconURL() || undefined icon_url: interaction.guild!.iconURL() || undefined
} }
} }]
]
}) })
} }