Now gives an error message if you have an invalid API key, instead of simply saying "The Youtube URL you supplied did not contain a valid YouTube ID."

This commit is contained in:
fiveofeight 2015-05-14 10:52:58 -04:00
parent 5f1d84169b
commit 522bfa465b
2 changed files with 5 additions and 0 deletions

View file

@ -203,6 +203,8 @@ func add(user *gumble.User, username, url string) {
}
} else if fmt.Sprint(err) == "video exceeds the maximum allowed duration." {
dj.SendPrivateMessage(user, VIDEO_TOO_LONG_MSG)
} else if fmt.Sprint(err) == "Invalid API key supplied." {
dj.SendPrivateMessage(user, INVALID_API_KEY)
} else {
dj.SendPrivateMessage(user, INVALID_YOUTUBE_ID_MSG)
}

View file

@ -7,6 +7,9 @@
package main
// Message shown to users when the bot has an invalid YouTube API key.
const INVALID_API_KEY = "MumbleDJ does not have a valid YouTube API key."
// Message shown to users when they do not have permission to execute a command.
const NO_PERMISSION_MSG = "You do not have permission to execute that command."