wip medication and db (sqlite)
This commit is contained in:
@@ -9,17 +9,20 @@ import type {
|
||||
import client from "lib/client";
|
||||
import EventEmitter from "node:events";
|
||||
import DiscordService from "services/discord.service";
|
||||
import { WaterMeService } from "services/water-me.service";
|
||||
import { WaterMeService } from "actions/waterMe/waterMe.service";
|
||||
import config from "config";
|
||||
import { MedicationService } from "actions/medication/medication.service";
|
||||
|
||||
export default class DiscordController extends EventEmitter {
|
||||
private discordService!: DiscordService;
|
||||
waterMeService: WaterMeService;
|
||||
medicationService: MedicationService;
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
this.discordService = new DiscordService();
|
||||
this.waterMeService = new WaterMeService();
|
||||
this.medicationService = new MedicationService();
|
||||
// log when running
|
||||
client.once("ready", async () => {
|
||||
console.log("hello :)");
|
||||
@@ -64,6 +67,9 @@ export default class DiscordController extends EventEmitter {
|
||||
if (customId === "moreWater") {
|
||||
await this.waterMeService.handleInteraction(interaction);
|
||||
}
|
||||
if (customId.toLowerCase().includes("medication")) {
|
||||
await this.medicationService.handleInteraction(interaction);
|
||||
}
|
||||
}
|
||||
|
||||
async handleChatInputCommand(
|
||||
@@ -73,9 +79,12 @@ export default class DiscordController extends EventEmitter {
|
||||
|
||||
// add commands
|
||||
switch (commandName) {
|
||||
case Commands.Enum["water-me"]:
|
||||
case Commands.Enum.giessen:
|
||||
await this.waterMeService.handleInteraction(interaction);
|
||||
return;
|
||||
case Commands.Enum.medikamente:
|
||||
await this.medicationService.handleInteraction(interaction);
|
||||
return;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user