add "!명령어" commandListCommand.

This commit is contained in:
dalbodeule 2024-08-18 18:34:49 +09:00
parent 0813955b12
commit 764714c33a
No known key found for this signature in database
GPG Key ID: EFA860D069C9FA65

View File

@ -53,13 +53,14 @@ class MessageHandler(
?: throw RuntimeException("User not found. it's bug? ${channel.channelName} - ${channel.channelId}")
val commands = CommandService.getCommands(user)
val manageCommands = mapOf(
"!명령어" to this::commandListCommand,
"!명령어추가" to this::manageAddCommand,
"!명령어삭제" to this::manageRemoveCommand,
"!명령어수정" to this::manageUpdateCommand,
"!시간" to this::timerCommand,
"!신청곡" to this::songAddCommand,
"!노래목록" to this::songListCommand,
"!노래시작" to this::songStartCommand
"!노래시작" to this::songStartCommand,
)
manageCommands.forEach { (commandName, command) ->
@ -76,6 +77,10 @@ class MessageHandler(
}
}
private fun commandListCommand(msg: ChatMessage, user: User) {
listener.sendChat("리스트는 여기입니다. https://nabot.mori.space/commands/${user.token}")
}
private fun manageAddCommand(msg: ChatMessage, user: User) {
if (msg.profile?.userRoleCode == "common_user") {
listener.sendChat("매니저만 명령어를 추가할 수 있습니다.")