diff --git a/aurora/slashcommands/nation.ts b/aurora/slashcommands/nation.ts index c93cc92e..d74c2557 100644 --- a/aurora/slashcommands/nation.ts +++ b/aurora/slashcommands/nation.ts @@ -1,5 +1,4 @@ import * as fn from '../../bot/utils/fn.js' -import * as emc from "earthmc" import * as database from "../../bot/utils/database.js" import { @@ -13,6 +12,8 @@ import { import { CustomEmbed, EntityType } from "../../bot/objects/CustomEmbed.js" import News from "../../bot/objects/News.js" +import { Aurora, NotFoundError } from 'earthmc' + export default { name: "nation", description: "Displays info for a nation.", @@ -34,7 +35,7 @@ export default { const nationsWithoutDuplicates = [] let nations = await database.Aurora.getNations() - if (!nations) nations = await emc.Aurora.Nations.all().catch(err => console.log(err)) + if (!nations) nations = await Aurora.Nations.all().catch(err => console.log(err)) if (subCmd == "list") { let comparator = interaction.options.getString("comparator") @@ -43,12 +44,12 @@ export default { comparator = comparator.toLowerCase() if (comparator == "online") { - const onlinePlayers = await emc.Aurora.Players.online().catch(() => {}) + const onlinePlayers = await Aurora.Players.online().catch(() => {}) if (!onlinePlayers) return await interaction.editReply({embeds: [fn.fetchError]}) .then(() => setTimeout(() => interaction.deleteReply(), 10000)).catch(() => {}) let towns = await database.Aurora.getTowns() - if (!towns) towns = await emc.Aurora.Towns.all() + if (!towns) towns = await Aurora.Towns.all() const len = towns.length for (let i = 0; i < len; i++) { @@ -209,8 +210,8 @@ export default { return interaction.editReply({embeds: [nationEmbed]}) } - const capitalColours = await emc.Aurora.Towns.get(nation.capital.name).then((t: any) => { - return t instanceof emc.NotFoundError ? null : t.colourCodes + const capitalColours = await Aurora.Towns.get(nation.capital.name).then((t: any) => { + return t instanceof NotFoundError ? null : t.colourCodes }) const colour = capitalColours ? parseInt(capitalColours.fill.replace('#', '0x')) : Colors.Aqua @@ -260,7 +261,7 @@ export default { if (nation.discord) nationEmbed.setURL(nation.discord) - const onlinePlayers = await emc.Aurora.Players.online().catch(() => {}) + const onlinePlayers = await Aurora.Players.online().catch(() => {}) if (onlinePlayers) { // Filter nation residents by which are online const onlineNationResidents = fn.removeDuplicates( diff --git a/aurora/slashcommands/resident.ts b/aurora/slashcommands/resident.ts index f558ce4e..4feaf969 100644 --- a/aurora/slashcommands/resident.ts +++ b/aurora/slashcommands/resident.ts @@ -4,8 +4,8 @@ import { EmbedBuilder, SlashCommandBuilder, Colors } from "discord.js" -import * as fn from '../../bot/utils/fn.js' import { ResidentHelper } from '../../common/resident.js' +import { devsFooter } from "../../bot/utils/fn.js" export default { name: "resident", @@ -20,7 +20,7 @@ export default { .setTitle("Invalid Arguments!") .setDescription("Usage: `/resident playerName`") .setColor(Colors.Red) - .setFooter(fn.devsFooter(client)) + .setFooter(devsFooter(client)) .setTimestamp() ], ephemeral: true }) } @@ -33,7 +33,7 @@ export default { return interaction.followUp({embeds: [new EmbedBuilder() .setTitle(name + " isn't a registered player name, please try again.") .setColor(Colors.Red) - .setFooter(fn.devsFooter(client)) + .setFooter(devsFooter(client)) .setTimestamp() ], ephemeral: true }) }