feat: add MemberIntent

Signed-off-by: limited_dev <loginakkisativ@gmail.com>
This commit is contained in:
moonleay 2023-06-28 22:38:26 +02:00 committed by limited_dev
parent 865964aebe
commit 0a16994e61

View file

@ -24,6 +24,8 @@ import dev.kord.common.entity.PresenceStatus
import dev.kord.core.behavior.interaction.response.respond import dev.kord.core.behavior.interaction.response.respond
import dev.kord.core.event.interaction.ButtonInteractionCreateEvent import dev.kord.core.event.interaction.ButtonInteractionCreateEvent
import dev.kord.core.on import dev.kord.core.on
import dev.kord.gateway.Intent
import dev.kord.gateway.PrivilegedIntent
import kotlinx.coroutines.GlobalScope import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
import net.moonleay.botendo.build.BuildConstants import net.moonleay.botendo.build.BuildConstants
@ -41,6 +43,8 @@ import kotlin.system.exitProcess
object Bot { object Bot {
//The kord object gets set at app launch //The kord object gets set at app launch
lateinit var bot: ExtensibleBot lateinit var bot: ExtensibleBot
@OptIn(PrivilegedIntent::class)
suspend fun start() { suspend fun start() {
Logger.out("Starting Bot...") Logger.out("Starting Bot...")
@ -89,6 +93,7 @@ object Bot {
add(::VersionExtension) add(::VersionExtension)
add(::FeatureManageExtension) add(::FeatureManageExtension)
add(::SendPlannerExtension) add(::SendPlannerExtension)
//add(::UpdateRolesExtension) // This command is only for debugging purposes
//add(::TestExtension) // See comment in TestExtension.kt //add(::TestExtension) // See comment in TestExtension.kt
} }
@ -97,7 +102,11 @@ object Bot {
this.playing("v." + BuildConstants.version) this.playing("v." + BuildConstants.version)
} }
// Sharding will be added if the load of the bot cannot be handled by one instance this.intents {
+Intent.GuildMembers
}
// Will add Sharding someday, I promise
/* /*
sharding { recommended -> sharding { recommended ->
Shards(recommended) Shards(recommended)