Skip to content

Commit

Permalink
Merge pull request #44 from devOS-Sanity-Edition/feat/aviation/vibe-c…
Browse files Browse the repository at this point in the history
…heck

✨ Small Heartbeat for checking if the bot is online
  • Loading branch information
asoji authored Sep 9, 2024
2 parents 1afa367 + 368aa85 commit c2dd54e
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 10 deletions.
1 change: 0 additions & 1 deletion Writerside/cfg/static/custom.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
@import "https://tilomitra.github.io/infinite/infinite.css";
@import "https://stijndv.com/fonts/Eudoxus-Sans.css";
@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');

Expand Down
7 changes: 7 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ plugins {
id("com.gradleup.shadow")
id("one.devos.yiski.build")
java
alias(libs.plugins.ktor)
}

group = "one.devos"
Expand Down Expand Up @@ -117,3 +118,9 @@ subprojects {
}
}

application { // apparently needed for ktor? ok.
mainClass.set("one.devos.yiski.runner.YiskiRunnerKt")

val isDevelopment: Boolean = project.ext.has("development")
applicationDefaultJvmArgs = listOf("-Dio.ktor.development=$isDevelopment")
}
22 changes: 14 additions & 8 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,24 @@
# Aviation
aviation = "7d1dcef7"
# Exposed
exposed = "0.52.0"
exposed = "0.54.0"
# GitHub API
github-api = "1.323"
# JDA
jda = "5.0.1"
jda-ktx = "0.12.0"
# Ktor
ktor = "2.3.11"
ktoml = "0.5.1"
ktor = "2.3.12"
ktoml = "0.5.2"
# Kotlin
kotlinx-coroutines = "1.8.1"
kotlinx-serialization = "1.6.3"
kotlin-logging = "5.1.0"
kotlinx-coroutines = "1.9.0-RC.2"
kotlinx-serialization = "1.7.2"
kotlin-logging = "7.0.0"
# Lavalink
lavalink-client = "3.0.0"
pcm-audio-utils = "0.1.0"
# Logback
logback = "1.5.6"
logback = "1.5.8"
# OkHttp
okhttp = "4.12.0"
# PostgresQL
Expand Down Expand Up @@ -51,6 +51,9 @@ jda-ktx = { module = "club.minnced:jda-ktx", version.ref = "jda-ktx" }
ktor-client-core = { module = "io.ktor:ktor-client-core", version.ref = "ktor" }
ktor-client-cio = { module = "io.ktor:ktor-client-cio", version.ref = "ktor" }
ktor-client-cio-jvm = { module = "io.ktor:ktor-client-cio-jvm", version.ref = "ktor" }
ktor-server-core = { module = "io.ktor:ktor-server-core-jvm", version.ref = "ktor" }
ktor-server-cio = { module = "io.ktor:ktor-server-cio-jvm", version.ref = "ktor" }
ktor-server-config-yaml = { module = "io.ktor:ktor-server-config-yaml", version.ref = "ktor" }
# Ktoml
ktoml-core = { module = "com.akuleshov7:ktoml-core", version.ref = "ktoml" }
ktoml-file = { module = "com.akuleshov7:ktoml-file", version.ref = "ktoml" }
Expand Down Expand Up @@ -106,7 +109,10 @@ kotlinx = [
ktor = [
"ktor-client-core",
"ktor-client-cio",
"ktor-client-cio-jvm"
"ktor-client-cio-jvm",
"ktor-server-core",
"ktor-server-cio",
"ktor-server-config-yaml"
]
ktoml = [
"ktoml-core",
Expand Down
13 changes: 13 additions & 0 deletions src/main/kotlin/one/devos/yiski/runner/Routing.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package one.devos.yiski.runner

import io.ktor.server.application.*
import io.ktor.server.response.*
import io.ktor.server.routing.*

fun Application.configureRouting() {
routing {
get("/") {
call.respondText("hai hai?!?1 i guess you found me, oh s-siwwy you?!?1 w-weww don't mind me, im just a bot... existing... bweathing... sighing. teww the *boops your nose* devs *starts twerking* i said hai?!?1 :3")
}
}
}
11 changes: 10 additions & 1 deletion src/main/kotlin/one/devos/yiski/runner/YiskiRunner.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package one.devos.yiski.runner

import io.ktor.server.application.*
import io.ktor.server.cio.*
import io.ktor.server.engine.*
import one.devos.yiski.common.YiskiShared
import one.devos.yiski.module.loader.impl.ModuleClassLoader
import one.devos.yiski.module.loader.impl.ModuleLoader
Expand All @@ -14,12 +17,18 @@ object YiskiRunner {
YiskiShared.initializeModuleLoader(ModuleLoader(classLoader))

bootstrap(classLoader)

embeddedServer(CIO, port = 39480, host = "0.0.0.0", module = Application::module)
.start(wait = true)
}

private fun bootstrap(classLoader: ClassLoader) {
val clz = classLoader.loadClass("one.devos.yiski.runner.Bootstrapper")
val instance = clz.getDeclaredField("INSTANCE").get(null)
clz.getDeclaredMethod("start").invoke(instance)
}

}

fun Application.module() {
configureRouting()
}

0 comments on commit c2dd54e

Please sign in to comment.