Skip to content

Commit

Permalink
fix: changed guild by id to guild by uuid
Browse files Browse the repository at this point in the history
  • Loading branch information
kk committed Feb 9, 2023
1 parent e87bc50 commit 5904b65
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/discord/GuildRequirements.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const GuildRequirements = async (client: Client, interaction: ChatInputCommandIn
playerData = { uuid: hypixelPlayer.uuid, name: hypixelPlayer.displayname, gxpTotal: 0 };

// Get Guild members
const guild = await hypixelClient.getGuildById(config.guild.id);
const guild = await hypixelClient.getGuildByPlayer(playerData.uuid);
if (guild?.members) {
for (const guildMember of guild.members) {
if (guildMember.uuid == hypixelPlayer.uuid) {
Expand Down Expand Up @@ -49,6 +49,10 @@ const GuildRequirements = async (client: Client, interaction: ChatInputCommandIn
},
);

if (playerData.gxpTotal != 0) {
playerEmbed.addFields({ name: "Guild XP", value: `${playerData.gxpTotal}` });
}

const requirements = config.guild.requirements;
if (requirements.bedwars_wins < (hypixelPlayer?.stats?.Bedwars?.wins_bedwars ?? 0) || requirements.duels_wins < duelsWins) {
playerEmbed.setColor("Green");
Expand Down

0 comments on commit 5904b65

Please sign in to comment.