mirror of
https://github.com/dalbodeule/chibot-chzzk-bot.git
synced 2025-06-09 07:18:22 +00:00
commit
7df2b68a5f
@ -265,7 +265,7 @@ class MessageHandler(
|
||||
|
||||
bot.retrieveUserById(user.discord).queue { discordUser ->
|
||||
discordUser?.openPrivateChannel()?.queue { channel ->
|
||||
channel.sendMessage("여기로 접속해주세요! ||https://nabot,mori.space/songlist/${session}||.\n주소가 노출될 경우 방송을 다시 켜셔야 합니다!")
|
||||
channel.sendMessage("여기로 접속해주세요! ||https://nabot.mori.space/songlist/${session}||.\n주소가 노출될 경우 방송을 다시 켜셔야 합니다!")
|
||||
.queue()
|
||||
}
|
||||
}
|
||||
|
@ -12,6 +12,7 @@ import kotlinx.serialization.json.Json
|
||||
import org.koin.java.KoinJavaComponent.inject
|
||||
import org.slf4j.LoggerFactory
|
||||
import space.mori.chzzk_bot.common.events.*
|
||||
import space.mori.chzzk_bot.common.models.Counters.withDefinition
|
||||
import space.mori.chzzk_bot.common.services.SongConfigService
|
||||
import space.mori.chzzk_bot.common.services.SongListService
|
||||
import space.mori.chzzk_bot.common.services.UserService
|
||||
@ -95,25 +96,17 @@ fun Routing.wsSongListRoutes() {
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(data.type == SongType.REMOVE.value && data.remove != null && data.remove > 0) {
|
||||
val songs = SongListService.getSong(user)
|
||||
if(songs.size < data.remove) {
|
||||
val song = songs[data.remove]
|
||||
SongListService.deleteSong(user, song.uid, song.name)
|
||||
|
||||
dispatcher.post(
|
||||
SongEvent(
|
||||
user.token,
|
||||
SongType.REMOVE,
|
||||
user.token,
|
||||
user.username,
|
||||
song.name,
|
||||
song.author,
|
||||
0,
|
||||
song.url
|
||||
)
|
||||
)
|
||||
}
|
||||
else if(data.type == SongType.REMOVE.value && data.url != null) {
|
||||
dispatcher.post(SongEvent(
|
||||
user.token,
|
||||
SongType.REMOVE,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
0,
|
||||
data.url
|
||||
))
|
||||
} else if(data.type == SongType.NEXT.value) {
|
||||
val song = SongListService.getSong(user)[0]
|
||||
SongListService.deleteSong(user, song.uid, song.name)
|
||||
|
Loading…
x
Reference in New Issue
Block a user