This commit is contained in:
parent
948494a9fb
commit
51e864d0c9
@ -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()
|
||||||
|
@ -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 {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user