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

Commit a857bfe

Browse files
committed
sheep bro what is this
1 parent c8208ad commit a857bfe

File tree

2 files changed

+4
-25
lines changed

2 files changed

+4
-25
lines changed

src/commands/main/data.ts

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,29 +8,18 @@ class GetDataCommand implements SlashCommand {
88
parameters = [];
99
dev = true;
1010
kogBot: KOGBot;
11-
db: Knex;
1211

1312
constructor(kogBot: KOGBot) {
1413
this.kogBot = kogBot;
15-
16-
// Initialize knex with database configuration from this.environment.database
17-
this.db = knex({
18-
client: 'mysql',
19-
connection: {
20-
host: this.kogBot.environment.database.host,
21-
user: this.kogBot.environment.database.user,
22-
password: this.kogBot.environment.database.password,
23-
database: this.kogBot.environment.database.name
24-
}
25-
});
14+
2615
}
2716

2817
async execute(interaction: ChatInputCommandInteraction): Promise<void> {
2918
try {
3019
const user = interaction.user;
3120
const userId = interaction.user.id; // Needed for DB
3221

33-
const results = await this.db('KOGDB').where({ userid: userId });
22+
//const results = await this.db('KOGDB').where({ userid: userId });
3423

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

src/commands/main/log.ts

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,26 +9,16 @@ class LogEventCommand implements SlashCommand {
99
parameters = [];
1010
dev = true;
1111
kogBot: KOGBot;
12-
db: Knex;
1312

1413
constructor(kogBot: KOGBot) {
1514
this.kogBot = kogBot;
16-
this.db = knex({
17-
client: 'mysql',
18-
connection: {
19-
host: this.kogBot.environment.database.host,
20-
user: this.kogBot.environment.database.user,
21-
password: this.kogBot.environment.database.password,
22-
database: this.kogBot.environment.database.name
23-
}
24-
});
25-
}
15+
}
2616

2717
async execute(interaction: ChatInputCommandInteraction): Promise<void> {
2818
const allowedroleID = this.kogBot.environment.discord.mr_role; // Set this later when I have perms
2919
const logChannel = this.kogBot.environment.discord.logChannel; // log channel
3020
const userId = interaction.user.id; // Needed for DB
31-
const DB = await this.db('KOGDB').where({ userid: userId });
21+
//const DB = await this.db('KOGDB').where({ userid: userId });
3222
try {
3323
// Check for required role
3424
if (!(interaction.member?.roles instanceof GuildMemberRoleManager) || !interaction.member.roles.cache.has(allowedroleID)) {

0 commit comments

Comments
 (0)