mirror of
https://github.com/dalbodeule/chibot-chzzk-bot.git
synced 2025-06-09 07:18:22 +00:00
Merge pull request #107 from dalbodeule/debug
add "!명령어" commandListCommand.
This commit is contained in:
commit
7553e8be7e
@ -53,13 +53,14 @@ class MessageHandler(
|
|||||||
?: throw RuntimeException("User not found. it's bug? ${channel.channelName} - ${channel.channelId}")
|
?: throw RuntimeException("User not found. it's bug? ${channel.channelName} - ${channel.channelId}")
|
||||||
val commands = CommandService.getCommands(user)
|
val commands = CommandService.getCommands(user)
|
||||||
val manageCommands = mapOf(
|
val manageCommands = mapOf(
|
||||||
|
"!명령어" to this::commandListCommand,
|
||||||
"!명령어추가" to this::manageAddCommand,
|
"!명령어추가" to this::manageAddCommand,
|
||||||
"!명령어삭제" to this::manageRemoveCommand,
|
"!명령어삭제" to this::manageRemoveCommand,
|
||||||
"!명령어수정" to this::manageUpdateCommand,
|
"!명령어수정" to this::manageUpdateCommand,
|
||||||
"!시간" to this::timerCommand,
|
"!시간" to this::timerCommand,
|
||||||
"!신청곡" to this::songAddCommand,
|
"!신청곡" to this::songAddCommand,
|
||||||
"!노래목록" to this::songListCommand,
|
"!노래목록" to this::songListCommand,
|
||||||
"!노래시작" to this::songStartCommand
|
"!노래시작" to this::songStartCommand,
|
||||||
)
|
)
|
||||||
|
|
||||||
manageCommands.forEach { (commandName, command) ->
|
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) {
|
private fun manageAddCommand(msg: ChatMessage, user: User) {
|
||||||
if (msg.profile?.userRoleCode == "common_user") {
|
if (msg.profile?.userRoleCode == "common_user") {
|
||||||
listener.sendChat("매니저만 명령어를 추가할 수 있습니다.")
|
listener.sendChat("매니저만 명령어를 추가할 수 있습니다.")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user