Skip to content
This repository was archived by the owner on May 15, 2025. It is now read-only.

Commit babed02

Browse files
this wont work but womp
1 parent ad58956 commit babed02

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/commands/main/data.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { SlashCommandBuilder, EmbedBuilder, ChatInputCommandInteraction } from "discord.js";
22
import { KOGBot } from "index.js";
3-
import knex, { Knex } from "knex";
3+
44
class GetDataCommand implements SlashCommand {
55
data = new SlashCommandBuilder()
66
.setName('data')
@@ -16,9 +16,9 @@ class GetDataCommand implements SlashCommand {
1616
async execute(interaction: ChatInputCommandInteraction): Promise<void> {
1717
try {
1818
const user = interaction.user;
19-
const userId = interaction.user.id; // Needed for DB
20-
const db = knex({ client: 'mysql', connection: this.kogBot.environment.database });
21-
const results = await db('kog').where({ userid: userId });
19+
const userId = interaction.user.id;
20+
const db = this.kogBot.database('users');
21+
const results = await db.where({ userId }).select();
2222

2323
if (results.length > 0) {
2424
const { eventsAttended, eventsHosted } = results[0];

0 commit comments

Comments
 (0)