Skip to content

Commit

Permalink
feat: reminder work idk
Browse files Browse the repository at this point in the history
  • Loading branch information
qixils committed Jul 8, 2024
1 parent acaf074 commit cbb28ba
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
9 changes: 4 additions & 5 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,17 @@ version = "1.0-SNAPSHOT"

repositories {
mavenCentral()
maven("https://jitpack.io/")
mavenLocal()
}

dependencies {
testImplementation(kotlin("test"))
implementation("dev.qixils.quasicolon:quasicord:1.0.0-SNAPSHOT")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.0-RC")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-reactor:1.8.0-RC")
implementation("com.github.minndevelopment:jda-ktx:9370cb13cc64646862e6f885959d67eb4b157e4a")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.9.0-RC")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-reactor:1.9.0-RC")
implementation("club.minnced:jda-ktx:0.11.0-beta.20")
implementation("io.projectreactor.kotlin:reactor-kotlin-extensions:1.2.2")
implementation("ch.qos.logback:logback-classic:1.4.14")
implementation("ch.qos.logback:logback-classic:1.5.6")
}

tasks.test {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,19 @@ import dev.qixils.quasicord.text.Text
import kotlinx.coroutines.reactive.awaitSingle
import kotlinx.coroutines.reactor.awaitSingle
import kotlinx.coroutines.runBlocking
import net.dv8tion.jda.api.events.interaction.component.ButtonInteractionEvent
import net.dv8tion.jda.api.hooks.SubscribeEvent
import net.dv8tion.jda.api.interactions.commands.OptionType
import net.dv8tion.jda.api.interactions.commands.SlashCommandInteraction
import reactor.core.publisher.Flux
import java.time.Instant

@SlashCommand("remind")
class ReminderCommand(val quasicolon: Quasicolon) {
class ReminderCommand(private val quasicolon: Quasicolon) {

companion object {
private const val JOIN_ID = "reminder_join"
}

init {
Flux.from(quasicolon.databaseManager.collection(Reminder::class.java).find())
Expand All @@ -40,4 +46,11 @@ class ReminderCommand(val quasicolon: Quasicolon) {
quasicolon.databaseManager.collection(Reminder::class.java).insertOne(reminder).awaitSingle()
ReminderTask(quasicolon, reminder).schedule()
}

@SubscribeEvent
fun onButton(event: ButtonInteractionEvent) {
if (event.componentId != JOIN_ID) return

// TODO
}
}

0 comments on commit cbb28ba

Please sign in to comment.