Enable/Disable services based on API key existence

This commit is contained in:
MichaelOultram 2015-08-15 19:30:15 +01:00
parent c4a32a0ff6
commit 098c12dfda
2 changed files with 2 additions and 10 deletions

View file

@ -140,7 +140,7 @@ func CheckAPIKeys() {
fmt.Printf("The youtube service has been disabled as you do not have a YouTube API key defined in your environment variables.\n" + fmt.Printf("The youtube service has been disabled as you do not have a YouTube API key defined in your environment variables.\n" +
"Please see the following link for info on how to fix this: https://github.com/matthieugrieger/mumbledj#youtube-api-keys\n") "Please see the following link for info on how to fix this: https://github.com/matthieugrieger/mumbledj#youtube-api-keys\n")
} else { } else {
AddService(YouTube{}) services = append(services, YouTube{})
} }
// Checks Soundcloud API key // Checks Soundcloud API key
@ -148,7 +148,7 @@ func CheckAPIKeys() {
fmt.Printf("The soundcloud service has been disabled as you do not have a Soundcloud API key defined in your environment variables.\n" + fmt.Printf("The soundcloud service has been disabled as you do not have a Soundcloud API key defined in your environment variables.\n" +
"Please see the following link for info on how to fix this: https://github.com/matthieugrieger/mumbledj#soundcloud-api-keys\n") "Please see the following link for info on how to fix this: https://github.com/matthieugrieger/mumbledj#soundcloud-api-keys\n")
} else { } else {
AddService(SoundCloud{}) services = append(services, SoundCloud{})
} }
} }

View file

@ -54,14 +54,6 @@ type Playlist interface {
var services []Service var services []Service
func AddService(service Service) {
if services == nil {
service = Service{service}
} else {
service = append(service, services)
}
}
func findServiceAndAdd(user *gumble.User, url string) error { func findServiceAndAdd(user *gumble.User, url string) error {
var urlService Service var urlService Service