From c9cb46e4be436f64ab171178400b8064cafe7b5e Mon Sep 17 00:00:00 2001 From: skinmaker1345 Date: Sun, 20 Oct 2024 00:06:26 +0900 Subject: [PATCH] fix: updating owners does not work properly --- utils/Query.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/utils/Query.ts b/utils/Query.ts index f1b53efb6e..a23c388c07 100644 --- a/utils/Query.ts +++ b/utils/Query.ts @@ -759,11 +759,11 @@ async function updateWebhook(id: string, type: 'bots' | 'servers', value: Partia } async function updateOwners(id: string, owners: string[], type: 'bot' | 'server'): Promise { - await knex('owners_mapping').where({ target: id }).del() + await knex('owners_mapping').where({ target_id: id }).del() await knex('owners_mapping').insert( owners.map((el) => ({ - owner: el, - target: id, + user_id: el, + target_id: id, type: type === 'bot' ? ObjectType.Bot : ObjectType.Server, })) )