From 16095c02567fce78d203bcba327fe5c790644365 Mon Sep 17 00:00:00 2001 From: IoIxD <30945097+IoIxD@users.noreply.github.com> Date: Mon, 13 Jun 2022 22:03:18 -0700 Subject: [PATCH] Prefix shouldn't be null ever, let alone when message.channel.guild isn't defined. (#276) * '/eval 9+10' returns 21 * undid 9+10 joke, fixed prefix bug * nope that's not how it was * fully undid 9+10 joke oops --- commands/general/prefix.js | 2 +- events/messageCreate.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/commands/general/prefix.js b/commands/general/prefix.js index a671b2d..6ab4648 100644 --- a/commands/general/prefix.js +++ b/commands/general/prefix.js @@ -3,7 +3,7 @@ import Command from "../../classes/command.js"; class PrefixCommand extends Command { async run() { - if (!this.channel.guild) return "This command only works in servers!"; + if (!this.channel.guild) return `The current prefix is \`${process.env.PREFIX}\``; const guild = await database.getGuild(this.channel.guild.id); if (this.args.length !== 0) { const owners = process.env.OWNER.split(","); diff --git a/events/messageCreate.js b/events/messageCreate.js index a33effd..b7f267d 100644 --- a/events/messageCreate.js +++ b/events/messageCreate.js @@ -43,7 +43,7 @@ export default async (client, cluster, worker, ipc, message) => { prefix = prefixCandidate; } } else { - prefix = ""; + prefix = process.env.PREFIX; } // ignore other stuff