1
0

test twitch stuff
All checks were successful
Build & Publish / build (push) Successful in 3m17s

This commit is contained in:
Jannik Reimers 2025-04-03 20:35:25 +02:00
parent 948494a9fb
commit 51e864d0c9
Signed by: jansel
GPG Key ID: 39C62D7D5233CFD0
2 changed files with 4 additions and 0 deletions

View File

@ -1,5 +1,6 @@
package dev.jansel.aglaea.utils package dev.jansel.aglaea.utils
import com.github.philippheuer.credentialmanager.domain.OAuth2Credential
import com.github.twitch4j.TwitchClientBuilder import com.github.twitch4j.TwitchClientBuilder
import com.github.twitch4j.chat.events.channel.ChannelMessageEvent import com.github.twitch4j.chat.events.channel.ChannelMessageEvent
import dev.jansel.aglaea.logger import dev.jansel.aglaea.logger
@ -10,6 +11,8 @@ class Twitch : KordExKoinComponent {
suspend fun init() { suspend fun init() {
twitchClient = TwitchClientBuilder.builder() twitchClient = TwitchClientBuilder.builder()
.withEnableHelix(true) .withEnableHelix(true)
.withEnableChat(true)
.withChatAccount(OAuth2Credential("twitch", twitchToken))
.withClientId(twitchcid) .withClientId(twitchcid)
.withClientSecret(twitchcs) .withClientSecret(twitchcs)
.build() .build()

View File

@ -8,6 +8,7 @@ import org.koin.dsl.bind
val twitchcid = env("TWITCH_CLIENT_ID") val twitchcid = env("TWITCH_CLIENT_ID")
val twitchcs = env("TWITCH_CLIENT_SECRET") val twitchcs = env("TWITCH_CLIENT_SECRET")
val twitchToken = env("TWITCH_OAUTH_TOKEN")
suspend inline fun ExtensibleBotBuilder.twitch(active: Boolean) { suspend inline fun ExtensibleBotBuilder.twitch(active: Boolean) {
hooks { hooks {