Fixed a crash related to default channels

This commit is contained in:
Matthieu Grieger 2014-10-18 17:20:02 -07:00
parent 1c64bb07a0
commit 0dcbd28036
2 changed files with 6 additions and 0 deletions

View file

@ -3,6 +3,8 @@ MumbleDJ Changelog
### October 18, 2014
* Fixed a crash when an error occurs during the audio downloading & encoding process.
* Fixed a crash that occurs when the bot tries to join a default channel that does not exist. If the default channel does not exist, the bot will just move itself
to the root of the server instead.
### October 13, 2014
* Added `SETUP.md` which contains a guide on how to configure MumbleDJ and install its dependencies.

View file

@ -16,6 +16,10 @@ function piepan.onConnect()
print(piepan.me.name .. " has connected to the server!")
local user = piepan.users[piepan.me.name]
local channel = user.channel(config.DEFAULT_CHANNEL)
if channel == nil then
print("The channel '" .. config.DEFAULT_CHANNEL .. "' does not exist. Moving bot to root of server...")
channel = piepan.channels[0]
end
piepan.me:moveTo(channel)
end