File tree Expand file tree Collapse file tree
acidify-milky/src/commonMain/kotlin/org/ntqqrev/acidify/milky/event Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,7 +6,9 @@ import io.ktor.client.request.*
66import io.ktor.http.*
77import io.ktor.serialization.kotlinx.json.*
88import io.ktor.server.application.*
9+ import io.ktor.server.plugins.di.dependencies
910import kotlinx.coroutines.launch
11+ import org.ntqqrev.acidify.AbstractBot
1012import org.ntqqrev.acidify.milky.MilkyContext
1113import org.ntqqrev.milky.milkyJsonModule
1214
@@ -19,7 +21,8 @@ val webhookClient = HttpClient {
1921context(ctx: MilkyContext )
2022fun Application.eventWebhook () = monitor.subscribe(ApplicationStarted ) {
2123 this .launch {
22- val logger = ctx.bot.createLogger(" WebhookModule" )
24+ val bot = dependencies.resolve<AbstractBot >()
25+ val logger = bot.createLogger(" WebhookModule" )
2326 ctx.eventFlow.collect {
2427 ctx.webhookEndpoints.forEach { webhook ->
2528 launch {
You can’t perform that action at this time.
0 commit comments