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:
parent
c7216cfe13
commit
16095c0256
2 changed files with 2 additions and 2 deletions
|
@ -3,7 +3,7 @@ import Command from "../../classes/command.js";
|
||||||
|
|
||||||
class PrefixCommand extends Command {
|
class PrefixCommand extends Command {
|
||||||
async run() {
|
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);
|
const guild = await database.getGuild(this.channel.guild.id);
|
||||||
if (this.args.length !== 0) {
|
if (this.args.length !== 0) {
|
||||||
const owners = process.env.OWNER.split(",");
|
const owners = process.env.OWNER.split(",");
|
||||||
|
|
|
@ -43,7 +43,7 @@ export default async (client, cluster, worker, ipc, message) => {
|
||||||
prefix = prefixCandidate;
|
prefix = prefixCandidate;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
prefix = "";
|
prefix = process.env.PREFIX;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ignore other stuff
|
// ignore other stuff
|
||||||
|
|
Loading…
Reference in a new issue