Implemented move command. Can currently only move to sibling channels
This commit is contained in:
parent
4a84a956a7
commit
56643da3d4
|
@ -48,7 +48,7 @@ config.ENABLE_ADMINS = true
|
|||
-- commands.
|
||||
-- EXAMPLE:
|
||||
-- config.ADMINS = {"Matt", "Matthieu"}
|
||||
config.ADMINS = {"Blah"}
|
||||
config.ADMINS = {"Matt"}
|
||||
|
||||
-- Make play an admin command?
|
||||
-- DEFAULT VALUE: false
|
||||
|
@ -115,5 +115,9 @@ config.SHOW_THUMBNAILS = true
|
|||
-- DEFAULT VALUE: "You do not have permission to execute that command."
|
||||
config.NO_PERMISSION_MSG = "You do not have permission to execute that command."
|
||||
|
||||
-- Message shown to users when they try to move the bot to a non-existant channel.
|
||||
-- DEFAULT VALUE: "The channel you specified does not exist."
|
||||
config.CHANNEL_DOES_NOT_EXIST_MSG = "The channel you specified does not exist."
|
||||
|
||||
|
||||
return config
|
||||
|
|
|
@ -99,6 +99,9 @@ function parseCommand(message)
|
|||
if has_permission then
|
||||
if config.OUTPUT then
|
||||
print(message.user.name .. " has told the bot to move to the following channel: " .. argument .. ".")
|
||||
if not move(argument) then
|
||||
message.user:send(config.CHANNEL_DOES_NOT_EXIST_MSG)
|
||||
end
|
||||
end
|
||||
else
|
||||
message.user:send(config.NO_PERMISSION_MSG)
|
||||
|
@ -142,8 +145,15 @@ function volumedown()
|
|||
return
|
||||
end
|
||||
|
||||
function move()
|
||||
return
|
||||
function move(chan)
|
||||
local user = piepan.users["MumbleDJ"]
|
||||
local channel = user.channel("../" .. chan)
|
||||
if channel == nil then
|
||||
return false
|
||||
else
|
||||
piepan.me:moveTo(channel)
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
function kill()
|
||||
|
|
Reference in a new issue