aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/commands/server-config/prefix.ts7
1 files changed, 6 insertions, 1 deletions
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<void> {
+ 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 {