From 795a773462df83969783496f29fed969a53c66ab Mon Sep 17 00:00:00 2001 From: TymanWasTaken Date: Thu, 27 May 2021 15:31:50 -0600 Subject: fix probably idk --- src/commands/server-config/prefix.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/commands') diff --git a/src/commands/server-config/prefix.ts b/src/commands/server-config/prefix.ts index cf70bd2..661284f 100644 --- a/src/commands/server-config/prefix.ts +++ b/src/commands/server-config/prefix.ts @@ -33,8 +33,13 @@ export default class PrefixCommand extends BushCommand { } async changePrefix(guild: DiscordGuild, prefix?: string): Promise { + let row = await Guild.findByPk(guild.id); + if (!row) { + row = Guild.build({ + id: guild.id + }) + } if (prefix) { - const row = await Guild.findByPk(guild.id); row.prefix = prefix; await row.save(); } else { -- cgit