diff --git a/src/commands/guild/top.ts b/src/commands/guild/top.ts index 1b9450c..28359f3 100644 --- a/src/commands/guild/top.ts +++ b/src/commands/guild/top.ts @@ -2,8 +2,7 @@ import { getUUID, getPlayer, getGuild, getIGN } from "utils/Hypixel" import { color, devMessage } from "config/options.json" import { ChannelType, ChatInputCommandInteraction } from "discord.js" import { GuildData } from "interfaces" -import Illegitimate from "utils/Illegitimate" -const redis = Illegitimate.redis +import { redis } from "utils/Illegitimate" export default async function guildTop(interaction: ChatInputCommandInteraction): Promise { await interaction.deferReply() diff --git a/src/events/cron/weeklyGexp.ts b/src/events/cron/weeklyGexp.ts index 897e3f2..bf3c5fd 100644 --- a/src/events/cron/weeklyGexp.ts +++ b/src/events/cron/weeklyGexp.ts @@ -2,9 +2,8 @@ import { hypixelGuildID, guildLogChannel, color, devMessage } from "config/optio import colorLog from "utils/functions/colors" import { getGuild, getIGN } from "utils/Hypixel" import { Cron, GuildData } from "interfaces" -import Illegitimate from "utils/Illegitimate" +import { client } from "utils/Illegitimate" import { TextChannel } from "discord.js" -const client = Illegitimate.client async function guildWeekly() { const channel = client.channels.cache.get(guildLogChannel) as TextChannel diff --git a/src/index.ts b/src/index.ts index 59588f7..66892d3 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,4 +1,3 @@ -import Illegitimate from "utils/Illegitimate" -const illegitimate = new Illegitimate.Bot() +import { Bot as Illegitimate } from "utils/Illegitimate" -illegitimate.start() +new Illegitimate().start() diff --git a/src/utils/Illegitimate.ts b/src/utils/Illegitimate.ts index 4b23a7c..a3b76d7 100644 --- a/src/utils/Illegitimate.ts +++ b/src/utils/Illegitimate.ts @@ -49,4 +49,4 @@ class Bot { } } -export default { Bot, client, redis } +export { Bot, client, redis } diff --git a/src/utils/functions/logtochannel.ts b/src/utils/functions/logtochannel.ts index bf05fdf..a86f37d 100644 --- a/src/utils/functions/logtochannel.ts +++ b/src/utils/functions/logtochannel.ts @@ -8,7 +8,7 @@ import { devLogChannel } from "config/options.json" import { Guild, MessageCreateOptions, TextChannel } from "discord.js" -import Illegitimate from "utils/Illegitimate" +import { client } from "utils/Illegitimate" const channels = { online: onlineLogChannel, @@ -22,7 +22,7 @@ const channels = { type Channel = keyof typeof channels export default async function logToChannel(channel: Channel, message: MessageCreateOptions): Promise { - const guild = Illegitimate.client.guilds.cache.get(guildid) as Guild + const guild = client.guilds.cache.get(guildid) as Guild let logChannel: TextChannel if (process.env.NODE_ENV === "dev") {