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
This commit is contained in:
IoIxD 2022-06-13 22:03:18 -07:00 committed by GitHub
parent c7216cfe13
commit 16095c0256
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -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(",");

View file

@ -43,7 +43,7 @@ export default async (client, cluster, worker, ipc, message) => {
prefix = prefixCandidate;
}
} else {
prefix = "";
prefix = process.env.PREFIX;
}
// ignore other stuff