we also should have the bot enable listeners on bot restarts lmaooooooo
This commit is contained in:
parent
0ad78ba494
commit
3a8dc16037
@ -1,5 +1,7 @@
|
|||||||
package dev.jansel.feixiao.extensions
|
package dev.jansel.feixiao.extensions
|
||||||
|
|
||||||
|
import dev.jansel.feixiao.database.collections.StreamerCollection
|
||||||
|
import dev.jansel.feixiao.twitchClient
|
||||||
import dev.kord.core.event.gateway.ReadyEvent
|
import dev.kord.core.event.gateway.ReadyEvent
|
||||||
import dev.kordex.core.extensions.Extension
|
import dev.kordex.core.extensions.Extension
|
||||||
import dev.kordex.core.extensions.event
|
import dev.kordex.core.extensions.event
|
||||||
@ -12,6 +14,10 @@ class EventHooks : Extension() {
|
|||||||
action {
|
action {
|
||||||
println("Bot is ready!")
|
println("Bot is ready!")
|
||||||
kord.editPresence { listening("to the database") }
|
kord.editPresence { listening("to the database") }
|
||||||
|
// check every entry in the database and enable the stream event listener
|
||||||
|
StreamerCollection().collection.find().toList().forEach {
|
||||||
|
twitchClient!!.clientHelper.enableStreamEventListener(it.name)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user