Skip to content

Commit 2034540

Browse files
committed
move channel endpoint
1 parent 9bbe3be commit 2034540

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/main/kotlin/dev/arbjerg/ukulele/api/PlayerController.kt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,4 +209,14 @@ class PlayerController(
209209
// Only say if there is a text channel the bot last spoke in
210210
player.lastChannel?.sendMessage(text)?.queue()
211211
}
212+
213+
@PostMapping("/player/{guildId}/move")
214+
suspend fun move(@PathVariable guildId: Long, @RequestBody body: Map<String, String>) {
215+
val guild = shardManager.getGuildById(guildId) ?: return
216+
val channelId = body["channelId"] ?: return
217+
val channel = guild.getVoiceChannelById(channelId)
218+
if (channel != null) {
219+
guild.audioManager.openAudioConnection(channel)
220+
}
221+
}
212222
}

0 commit comments

Comments
 (0)