Add voice channel disconnect test

This commit is contained in:
Helloyunho 2021-03-31 11:29:07 +09:00
parent 96b273ed04
commit 3fe5ce3063
1 changed files with 4 additions and 9 deletions

View File

@ -14,15 +14,10 @@ export default class KickFromSpecificVoiceCommand extends Command {
}
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
const voiceStates = await (channel as VoiceChannel).voiceStates.array()
if (voiceStates !== undefined) {
voiceStates.forEach(async (voiceState) => {
const member = await voiceState.disconnect()
if (member !== undefined) {
ctx.channel.send(`Kicked member ${member.id}`)
}
})
}
const members = await (channel as VoiceChannel).disconnectAll()
members.forEach((member) => {
ctx.channel.send(`Kicked member ${member.id}`)
})
}
}
}