Skip to content

Commit a4eadca

Browse files
committed
Test some voice state stuff
1 parent df6f2f4 commit a4eadca

File tree

2 files changed

+32
-2
lines changed

2 files changed

+32
-2
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
package io.github.freya022.botcommands.test.commands.slash
2+
3+
import io.github.freya022.botcommands.api.commands.annotations.Command
4+
import io.github.freya022.botcommands.api.commands.application.ApplicationCommand
5+
import io.github.freya022.botcommands.api.commands.application.slash.GuildSlashEvent
6+
import io.github.freya022.botcommands.api.commands.application.slash.annotations.JDASlashCommand
7+
import io.github.freya022.botcommands.api.core.utils.reply
8+
9+
@Command
10+
class SlashVoiceState : ApplicationCommand() {
11+
12+
@JDASlashCommand(name = "voice_state")
13+
fun onSlashVoiceState(event: GuildSlashEvent) {
14+
event.reply(ephemeral = true) {
15+
content = """
16+
Cached member: ${event.guild.getMember(event.member)}
17+
Voice state: ${event.member.voiceState}
18+
Voice state member: ${event.member.voiceState?.member}
19+
Voice state channel: ${event.member.voiceState?.channel}
20+
Voice state deafened: ${event.member.voiceState?.isDeafened}
21+
Voice state muted: ${event.member.voiceState?.isMuted}
22+
Voice state self deafened: ${event.member.voiceState?.isSelfDeafened}
23+
Voice state self muted: ${event.member.voiceState?.isSelfMuted}
24+
Voice state guild deafened: ${event.member.voiceState?.isGuildDeafened}
25+
Voice state guild muted: ${event.member.voiceState?.isGuildMuted}
26+
Voice state suppressed: ${event.member.voiceState?.isSuppressed}
27+
Voice state stream: ${event.member.voiceState?.isStream}
28+
Voice state sending video: ${event.member.voiceState?.isSendingVideo}
29+
""".trimIndent()
30+
}.queue()
31+
}
32+
}

src/test/kotlin/io/github/freya022/botcommands/test/services/Bot.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import io.github.freya022.botcommands.test.config.Config
99
import net.dv8tion.jda.api.entities.Activity
1010
import net.dv8tion.jda.api.hooks.IEventManager
1111
import net.dv8tion.jda.api.requests.GatewayIntent
12-
import net.dv8tion.jda.api.utils.MemberCachePolicy
1312
import net.dv8tion.jda.api.utils.cache.CacheFlag
1413
import org.springframework.core.env.ConfigurableEnvironment
1514
import org.springframework.core.env.MapPropertySource
@@ -35,7 +34,6 @@ class Bot(private val config: Config, environment: ConfigurableEnvironment?) : J
3534
token = config.token,
3635
shardRange = if (config.testMode) 0..1 else null,
3736
shardsTotal = if (config.testMode) 2 else -1,
38-
memberCachePolicy = MemberCachePolicy.VOICE,
3937
activityProvider = { Activity.playing("coroutines go brrr #$it") },
4038
) {
4139
setEventPassthrough(true)

0 commit comments

Comments
 (0)