diff --git a/src/bot/modal.rs b/src/bot/modal.rs index 4fdf3eb..2a7d3cd 100644 --- a/src/bot/modal.rs +++ b/src/bot/modal.rs @@ -42,7 +42,7 @@ impl Handler { .and_then(|x| x.value.clone()) .context("unable to get value text from input")?; - sqlx::query("update guilds set script = $1 where id = $2") + sqlx::query("insert into guilds (id, script) values ($1, $2) on conflict do update set script = excluded.script") .bind(value.as_str()) .bind(guild_id.to_string()) .execute(&self.db)