Removed play and pause commands
This commit is contained in:
parent
b957bf0371
commit
ac13725c31
|
@ -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.
|
||||
|
||||
|
|
|
@ -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 = [[
|
|||
<b>%s</b> has added "%s" to the queue.
|
||||
]]
|
||||
|
||||
-- Message shown to channel when a song is resumed with the play command.
|
||||
config.SONG_PLAY_HTML = [[
|
||||
<b>%s</b> resumed audio playback.
|
||||
]]
|
||||
|
||||
-- Message shown to channel when a song is paused by a user.
|
||||
config.SONG_PAUSED_HTML = [[
|
||||
<b>%s</b> has paused the song.
|
||||
]]
|
||||
|
||||
-- Message shown to channel when a user votes to skip a song.
|
||||
config.USER_SKIP_HTML = [[
|
||||
<b>%s</b> has voted to skip this song.
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Reference in a new issue