This commit is contained in:
2026-09-23 19:39:36 +02:00
parent cbf1fec04d
commit 2237aae4f8
4 changed files with 8 additions and 6 deletions

View File

@@ -8,7 +8,7 @@ export default {
handle: async (interaction, database) => { handle: async (interaction, database) => {
await interaction.defer(MessageFlags.EPHEMERAL) await interaction.defer(MessageFlags.EPHEMERAL)
const db = database.table(`rr`) const db = await database.table(`rr`)
const splitID = interaction.data.customID.split('.') const splitID = interaction.data.customID.split('.')

View File

@@ -177,7 +177,7 @@ export default {
}, },
handle: async (interaction, database) => { handle: async (interaction, database) => {
const db = database.table(`rr`) const db = await database.table(`rr`)
const action = interaction.data.options.getSubCommand()[0] const action = interaction.data.options.getSubCommand()[0]

View File

@@ -8,7 +8,7 @@ export default {
handle: async (interaction, database) => { handle: async (interaction, database) => {
await interaction.defer(MessageFlags.EPHEMERAL) await interaction.defer(MessageFlags.EPHEMERAL)
const db = database.table(`rr`) const db = await database.table(`rr`)
const splitID = interaction.data.customID.split('.') const splitID = interaction.data.customID.split('.')

View File

@@ -32,10 +32,12 @@ export class KVDB {
/** /**
* Switch database table/context sharing the same connection pool * Switch database table/context sharing the same connection pool
* @param {string} newTableName * @param {string} newTableName
* @returns {KVDB} * @returns {Promise<KVDB>}
*/ */
table(newTableName) { async table(newTableName) {
return new KVDB(this.pool, newTableName); const newDb = new KVDB(this.pool, newTableName);
await newDb.init();
return newDb;
} }
/** /**