From ac13725c312ac60172bacbd50d385b209a4be657 Mon Sep 17 00:00:00 2001 From: Matthieu Grieger Date: Fri, 26 Sep 2014 16:04:07 -0700 Subject: [PATCH] Removed play and pause commands --- CHANGELOG.md | 4 ++++ mumbledj/config.lua | 32 --------------------------- mumbledj/mumbledj.lua | 50 ++----------------------------------------- 3 files changed, 6 insertions(+), 80 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 55df933..2f164dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ MumbleDJ Changelog ================== +### September 26, 2014 +* Removed play and pause commands. There were issues with these commands, and they both serve functions that can be done within Mumble per-user. +* Removed all play and pause configuration options from config.lua. + ### September 25, 2014 * Forced ffmpeg to use libvorbis codec. diff --git a/mumbledj/config.lua b/mumbledj/config.lua index f2c4f6c..170a3dc 100644 --- a/mumbledj/config.lua +++ b/mumbledj/config.lua @@ -50,14 +50,6 @@ config.SKIP_RATIO = 0.5 -- COMMAND CONFIGURATION ------------------------- --- Alias used for play command. --- DEFAULT VALUE: "play" -config.PLAY_ALIAS = "play" - --- Alias used for pause command. --- DEFAULT VALUE: "pause" -config.PAUSE_ALIAS = "pause" - -- Alias used for add command. -- DEFAULT VALUE: "add" config.ADD_ALIAS = "add" @@ -95,14 +87,6 @@ config.ENABLE_ADMINS = true -- config.ADMINS = {"Matt", "Matthieu"} config.ADMINS = {"Matt"} --- Make play an admin command? --- DEFAULT VALUE: false -config.ADMIN_PLAY = false - --- Make pause an admin command? --- DEFAULT VALUE: false -config.ADMIN_PAUSE = false - -- Make add an admin command? -- DEFAULT VALUE: false config.ADMIN_ADD = false @@ -145,15 +129,9 @@ config.CHANNEL_DOES_NOT_EXIST_MSG = "The channel you specified does not exist." -- Message shown to users when they attempt to add an invalid URL to the queue. config.INVALID_URL_MSG = "The URL you submitted does not match the required format. Please submit a valid YouTube URL." --- Message shown to users when they attempt to execute the play command when music is already playing. -config.MUSIC_PLAYING_MSG = "A music track is already playing!" - -- Message shown to users when they attempt to use the stop command when no music is playing. config.NO_MUSIC_PLAYING_MSG = "There is no music playing at the moment." --- Message shown to users when they attempt to use the play command when there are no songs in the queue. -config.NO_SONGS_AVAILABLE = "There are no songs currently in the queue. Use " .. config.COMMAND_PREFIX .. "add to add a song to the queue." - -- Message shown to users when they issue a command that requires an argument and one was not supplied. config.NO_ARGUMENT = "The command you issued requires an argument and you did not provide one. Make sure a space exists between the command and the argument." @@ -185,16 +163,6 @@ config.SONG_ADDED_HTML = [[ %s has added "%s" to the queue. ]] --- Message shown to channel when a song is resumed with the play command. -config.SONG_PLAY_HTML = [[ - %s resumed audio playback. -]] - --- Message shown to channel when a song is paused by a user. -config.SONG_PAUSED_HTML = [[ - %s has paused the song. -]] - -- Message shown to channel when a user votes to skip a song. config.USER_SKIP_HTML = [[ %s has voted to skip this song. diff --git a/mumbledj/mumbledj.lua b/mumbledj/mumbledj.lua index 69053d8..b5449ff 100644 --- a/mumbledj/mumbledj.lua +++ b/mumbledj/mumbledj.lua @@ -41,47 +41,8 @@ function parse_command(message) command = string.sub(message.text, 2) end - -- Play command - if command == config.PLAY_ALIAS then - local has_permission = check_permissions(config.ADMIN_PLAY, message.user.name) - - if has_permission then - if config.OUTPUT then - print(message.user.name .. " has told the bot to start playing music.") - end - if song_queue.get_length() == 0 then - message.user:send(config.NO_SONGS_AVAILABLE) - else - if piepan.Audio.isPlaying() then - message.user:send(config.MUSIC_PLAYING_MSG) - else - piepan.me.channel:play("song-converted.ogg", SongQueue.get_next_song) - end - end - - else - message.user:send(config.NO_PERMISSION_MSG) - end - -- Pause command - elseif command == config.PAUSE_ALIAS then - local has_permission = check_permissions(config.ADMIN_PAUSE, message.user.name) - - if has_permission then - if config.OUTPUT then - print(message.user.name .. " has told the bot to pause music playback.") - end - - if piepan.Audio.isPlaying() then - piepan.me.channel:send(string.format(config.SONG_PAUSED_HTML, message.user.name)) - piepan.Audio.stop() - else - message.user:send(config.NO_MUSIC_PLAYING_MSG) - end - else - message.user:send(config.NO_PERMISSION_MSG) - end -- Add command - elseif command == config.ADD_ALIAS then + if command == config.ADD_ALIAS then local has_permission = check_permissions(config.ADMIN_ADD, message.user.name) if has_permission then @@ -151,14 +112,6 @@ function parse_command(message) else message.user:send(config.NO_PERMISSION_MSG) end - -- This is just where I put commands for testing. These will most likely be removed - -- in the "final" version. - elseif command == "musicplaying" then - if piepan.Audio.isPlaying() then - message.user:send("Music is currently playing.") - else - message.user:send("Music is not currently playing.") - end else message.user:send("The command you have entered is not valid.") end @@ -201,6 +154,7 @@ function kill() os.remove("song.ogg") os.remove("song-converted.ogg") os.remove(".video_fail") + piepan.disconnect() os.exit(0) end