Skip to content

Commit

Permalink
✨ added heartbeat
Browse files Browse the repository at this point in the history
  • Loading branch information
asoji committed Sep 9, 2024
1 parent 33ad448 commit 67edbae
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
20 changes: 20 additions & 0 deletions src/main/kotlin/one/devos/yiski/Yiski.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ import dev.minn.jda.ktx.events.listener
import dev.minn.jda.ktx.generics.getChannel
import dev.minn.jda.ktx.jdabuilder.default
import dev.minn.jda.ktx.jdabuilder.intents
import io.ktor.server.application.*
import io.ktor.server.cio.*
import io.ktor.server.engine.*
import io.ktor.server.response.*
import io.ktor.server.routing.*
import kotlinx.coroutines.runBlocking
import net.dv8tion.jda.api.JDA
import net.dv8tion.jda.api.entities.Activity
Expand Down Expand Up @@ -140,6 +145,9 @@ object Yiski {
}
}
}

io.ktor.server.engine.embeddedServer(CIO, port = 8080, host = "0.0.0.0", module = Application::module)
.start(wait = true)
}

private fun listenAviationEvents() {
Expand All @@ -151,4 +159,16 @@ object Yiski {
logger.error("[Command Execution] A command has failed. ", this.error)
}
}
}

fun Application.module() {
configureRouting()
}

fun Application.configureRouting() {
routing {
get("/heartbeat") {
call.respondText("howdy")
}
}
}
8 changes: 7 additions & 1 deletion src/main/kotlin/one/devos/yiski/audio/Audio.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import com.sedmelluq.discord.lavaplayer.source.AudioSourceManagers
import com.sedmelluq.discord.lavaplayer.tools.FriendlyException
import com.sedmelluq.discord.lavaplayer.track.AudioPlaylist
import com.sedmelluq.discord.lavaplayer.track.AudioTrack
import net.dv8tion.jda.api.audio.SpeakingMode
import net.dv8tion.jda.api.audio.hooks.ConnectionListener
import net.dv8tion.jda.api.audio.hooks.ConnectionStatus
import net.dv8tion.jda.api.entities.Guild
Expand All @@ -17,6 +18,7 @@ import net.dv8tion.jda.api.managers.AudioManager
import one.devos.yiski.Yiski
import one.devos.yiski.audio.lavaplayer.ByteAudioSourceManager
import one.devos.yiski.tiktok.Voices
import java.util.*

object Audio {
/**
Expand Down Expand Up @@ -72,7 +74,11 @@ object Audio {
}
}

override fun onUserSpeaking(user: User, speaking: Boolean) {
// override fun onUserSpeaking(user: User, speaking: Boolean) {
//
// }

override fun onUserSpeakingModeUpdate(user: User, modes: EnumSet<SpeakingMode>) {

}
}
Expand Down

0 comments on commit 67edbae

Please sign in to comment.