From 47228394d5d5c63c25dbf2f0fdb5663045d8a1e9 Mon Sep 17 00:00:00 2001 From: dalbodeule <11470513+dalbodeule@users.noreply.github.com> Date: Sun, 4 Aug 2024 21:54:55 +0900 Subject: [PATCH] =?UTF-8?q?Add=20command,=20update=20document.=20-=20add?= =?UTF-8?q?=20!=EB=85=B8=EB=9E=98=EB=AA=A9=EB=A1=9D=20command=20-=20Docume?= =?UTF-8?q?nt=20add=20(timer,=20playlist=20commands)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 9 +++++++++ .../space/mori/chzzk_bot/chatbot/chzzk/MessageHandler.kt | 9 +++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e325a5b..5ac3203 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,15 @@ - [x] !명령어추가 \[명령어] \[내용] - [x] !명령어수정 \[명령어] \[내용] - [x] !명령어삭제 \[명령어] +### 타이머 명령어 (on Chzzk chat, 매니저/스트리머 전용) +- [x] !시간 \[숫자: 분] +- [x] !시간 업타임 +- [x] !시간 삭제 +### 플레이리스트 명령어 (on Chzzk chat) +- [x] !노래추가 \[유튜브 주소] +- [x] !노래목록 +- [ ] !노래삭제 \[번호] +- [ ] !노래설정 \[내용] \[켜기/끄기] ### Envs - DISCORD_TOKEN diff --git a/chatbot/src/main/kotlin/space/mori/chzzk_bot/chatbot/chzzk/MessageHandler.kt b/chatbot/src/main/kotlin/space/mori/chzzk_bot/chatbot/chzzk/MessageHandler.kt index cff8cd0..e336c6e 100644 --- a/chatbot/src/main/kotlin/space/mori/chzzk_bot/chatbot/chzzk/MessageHandler.kt +++ b/chatbot/src/main/kotlin/space/mori/chzzk_bot/chatbot/chzzk/MessageHandler.kt @@ -56,7 +56,8 @@ class MessageHandler( "!명령어삭제" to this::manageRemoveCommand, "!명령어수정" to this::manageUpdateCommand, "!시간" to this::timerCommand, - "!노래추가" to this::songAddCommand + "!노래추가" to this::songAddCommand, + "!노래목록" to this::songListCommand ) manageCommands.forEach { (commandName, command) -> @@ -198,7 +199,7 @@ class MessageHandler( } // songs - fun songAddCommand(msg: ChatMessage, user: User) { + private fun songAddCommand(msg: ChatMessage, user: User) { val parts = msg.content.split(" ", limit = 3) if (parts.size < 2) { listener.sendChat("유튜브 URL을 입력해주세요!") @@ -243,6 +244,10 @@ class MessageHandler( listener.sendChat("노래가 추가되었습니다.") } + private fun songListCommand(msg: ChatMessage, user: User) { + listener.sendChat("리스트는 여기입니다. https://nabot.mori.space/songs/${user.token}") + } + internal fun handle(msg: ChatMessage, user: User) { if(msg.userId == ChzzkHandler.botUid) return