Replace into guild_active from homepage

Allow user to change their mind about auto-create by redoing oauth flow.
This commit is contained in:
Cadence Ember 2024-12-02 15:42:32 +13:00
parent 88a232fb4a
commit e00ce22aad

View file

@ -86,7 +86,7 @@ as.router.get("/oauth", defineEventHandler(async event => {
// Set auto-create for the guild
// @ts-ignore
if (managedGuilds.includes(parsedQuery.data.guild_id)) {
db.prepare("INSERT OR IGNORE INTO guild_active (guild_id, autocreate) VALUES (?, ?)").run(parsedQuery.data.guild_id, +!session.data.selfService)
db.prepare("REPLACE INTO guild_active (guild_id, autocreate) VALUES (?, ?)").run(parsedQuery.data.guild_id, +!session.data.selfService)
}
if (parsedQuery.data.guild_id) {