Removed useless functions, working on implementing add/play

This commit is contained in:
Matthieu Grieger 2014-09-16 12:25:44 -07:00
parent 004678967f
commit fd79716cab

View file

@ -4,7 +4,7 @@
------------------------- -------------------------
local config = require("config") local config = require("config")
require "song_queue" local song_queue = require("song_queue")
function piepan.onConnect() function piepan.onConnect()
print("MumbleDJ has connected to the server!") print("MumbleDJ has connected to the server!")
@ -40,6 +40,7 @@ function parseCommand(message)
if config.OUTPUT then if config.OUTPUT then
print(message.user.name .. " has told the bot to start playing music.") print(message.user.name .. " has told the bot to start playing music.")
end end
piepan.me.channel:play("song.ogg")
else else
message.user:send(config.NO_PERMISSION_MSG) message.user:send(config.NO_PERMISSION_MSG)
end end
@ -59,6 +60,9 @@ function parseCommand(message)
if has_permission then if has_permission then
if config.OUTPUT then if config.OUTPUT then
print(message.user.name .. " has told the bot to add the following URL to the queue: " .. argument .. ".") print(message.user.name .. " has told the bot to add the following URL to the queue: " .. argument .. ".")
if not song_queue.addSong(argument) then
message.user:send(config.INVALID_URL_MSG)
end
end end
else else
message.user:send(config.NO_PERMISSION_MSG) message.user:send(config.NO_PERMISSION_MSG)
@ -73,25 +77,13 @@ function parseCommand(message)
else else
message.user:send(config.NO_PERMISSION_MSG) message.user:send(config.NO_PERMISSION_MSG)
end end
elseif command == "volumeup" then elseif command == "volume" then
local has_permission = checkPermissions(config.ADMIN_VOLUMEUP, message.user.name) local has_permission = checkPermissions(config.ADMIN_VOLUME, message.user.name)
if has_permission then if has_permission then
if config.OUTPUT then if config.OUTPUT then
print(message.user.name .. " has told the bot to raise the playback volume.") print(message.user.name .. " has changed the volume to the following: " .. argument .. ".")
end end
else
message.user:send(config.NO_PERMISSION_MSG)
end
elseif command == "volumedown" then
local has_permission = checkPermissions(config.ADMIN_VOLUMEDOWN, message.user.name)
if has_permission then
if config.OUTPUT then
print(message.user.name .. " has told the bot to lower the playback volume.")
end
else
message.user:send(config.NO_PERMISSION_MSG)
end end
elseif command == "move" then elseif command == "move" then
local has_permission = checkPermissions(config.ADMIN_MOVE, message.user.name) local has_permission = checkPermissions(config.ADMIN_MOVE, message.user.name)
@ -99,9 +91,9 @@ function parseCommand(message)
if has_permission then if has_permission then
if config.OUTPUT then if config.OUTPUT then
print(message.user.name .. " has told the bot to move to the following channel: " .. argument .. ".") print(message.user.name .. " has told the bot to move to the following channel: " .. argument .. ".")
if not move(argument) then end
message.user:send(config.CHANNEL_DOES_NOT_EXIST_MSG) if not move(argument) then
end message.user:send(config.CHANNEL_DOES_NOT_EXIST_MSG)
end end
else else
message.user:send(config.NO_PERMISSION_MSG) message.user:send(config.NO_PERMISSION_MSG)
@ -116,35 +108,17 @@ function parseCommand(message)
else else
message.user:send(config.NO_PERMISSION_MSG) message.user:send(config.NO_PERMISSION_MSG)
end end
elseif command == "python" then
os.execute("python test.py")
else else
message.user:send("The command you have entered is not valid.") message.user:send("The command you have entered is not valid.")
end end
end end
function play()
return
end
function pause()
return
end
function add()
return
end
function skip() function skip()
return return
end end
function volumeup()
return
end
function volumedown()
return
end
function move(chan) function move(chan)
local user = piepan.users["MumbleDJ"] local user = piepan.users["MumbleDJ"]
local channel = user.channel("../" .. chan) local channel = user.channel("../" .. chan)