Removed the verbose command
This commit is contained in:
parent
5fed70ca66
commit
29eec2d242
|
@ -29,7 +29,6 @@ All commandline parameters are optional. Below are descriptions of all the avail
|
|||
* `-key`: Path to user PEM key. Defaults to no key.
|
||||
* `-insecure`: If included, the bot will not check the certs for the server. Try using this commandline flag if you are having connection issues.
|
||||
* `-accesstokens`: List of access tokens for the bot separated by spaces. Defaults to no access tokens.
|
||||
* `-verbose`: Prints out song status into the console.
|
||||
|
||||
## FEATURES
|
||||
* Plays audio from both YouTube videos and YouTube playlists!
|
||||
|
|
13
main.go
13
main.go
|
@ -37,7 +37,6 @@ type mumbledj struct {
|
|||
homeDir string
|
||||
playlistSkips map[string][]string
|
||||
cache *SongCache
|
||||
verbose bool
|
||||
}
|
||||
|
||||
// OnConnect event. First moves MumbleDJ into the default channel specified
|
||||
|
@ -165,13 +164,6 @@ func CheckAPIKeys() {
|
|||
}
|
||||
}
|
||||
|
||||
// Verbose prints out messages only if verbose flag is true
|
||||
func Verbose(msg string) {
|
||||
if dj.verbose {
|
||||
fmt.Printf(msg + "\n")
|
||||
}
|
||||
}
|
||||
|
||||
// isNil checks to see if an object is nil
|
||||
func isNil(a interface{}) bool {
|
||||
defer func() { recover() }()
|
||||
|
@ -203,7 +195,7 @@ func main() {
|
|||
}
|
||||
|
||||
var address, port, username, password, channel, pemCert, pemKey, accesstokens string
|
||||
var insecure, verbose, testcode bool
|
||||
var insecure, testcode bool
|
||||
|
||||
flag.StringVar(&address, "server", "localhost", "address for Mumble server")
|
||||
flag.StringVar(&port, "port", "64738", "port for Mumble server")
|
||||
|
@ -214,7 +206,6 @@ func main() {
|
|||
flag.StringVar(&pemKey, "key", "", "path to user PEM key for MumbleDJ")
|
||||
flag.StringVar(&accesstokens, "accesstokens", "", "list of access tokens for channel auth")
|
||||
flag.BoolVar(&insecure, "insecure", false, "skip certificate checking")
|
||||
flag.BoolVar(&verbose, "verbose", false, "[debug] prints out debug messages to the console")
|
||||
flag.BoolVar(&testcode, "test", false, "[debug] tests the features of mumbledj")
|
||||
flag.Parse()
|
||||
|
||||
|
@ -242,7 +233,6 @@ func main() {
|
|||
}
|
||||
|
||||
dj.defaultChannel = strings.Split(channel, "/")
|
||||
dj.verbose = verbose
|
||||
|
||||
dj.client.Attach(gumbleutil.Listener{
|
||||
Connect: dj.OnConnect,
|
||||
|
@ -258,7 +248,6 @@ func main() {
|
|||
}
|
||||
|
||||
if testcode {
|
||||
Verbose("Testing is enabled")
|
||||
Test(password, address, port, strings.Split(accesstokens, " "))
|
||||
}
|
||||
<-dj.keepAlive
|
||||
|
|
|
@ -64,8 +64,7 @@ func FindServiceAndAdd(user *gumble.User, url string) error {
|
|||
}
|
||||
|
||||
if urlService == nil {
|
||||
Verbose("INVALID_URL")
|
||||
return errors.New("INVALID_URL")
|
||||
return errors.New(INVALID_URL_MSG)
|
||||
} else {
|
||||
oldLength := dj.queue.Len()
|
||||
var title string
|
||||
|
|
|
@ -39,9 +39,6 @@ func (sc SoundCloud) NewRequest(user *gumble.User, url string) (string, error) {
|
|||
if err == nil {
|
||||
// PLAYLIST
|
||||
if dj.HasPermission(user.Name, dj.conf.Permissions.AdminAddPlaylists) {
|
||||
// Check duration of playlist
|
||||
//duration, _ := apiResponse.Int("duration")
|
||||
|
||||
// Create playlist
|
||||
title, _ := apiResponse.String("title")
|
||||
permalink, _ := apiResponse.String("permalink_url")
|
||||
|
@ -57,7 +54,6 @@ func (sc SoundCloud) NewRequest(user *gumble.User, url string) (string, error) {
|
|||
if err == nil {
|
||||
return playlist.Title(), nil
|
||||
} else {
|
||||
Verbose("soundcloud.NewRequest: " + err.Error())
|
||||
return "", err
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -69,7 +69,6 @@ func (yt YouTube) NewRequest(user *gumble.User, url string) (string, error) {
|
|||
if !isNil(song) {
|
||||
return song.Title(), nil
|
||||
} else {
|
||||
Verbose("youtube.NewRequest: " + err.Error())
|
||||
return "", err
|
||||
}
|
||||
}
|
||||
|
@ -167,7 +166,6 @@ func (yt YouTube) NewSong(user *gumble.User, id, offset string, playlist Playlis
|
|||
dontSkip: false,
|
||||
}
|
||||
dj.queue.AddSong(song)
|
||||
Verbose(song.Submitter() + " added track " + song.Title())
|
||||
|
||||
return song, nil
|
||||
}
|
||||
|
|
|
@ -54,9 +54,7 @@ func (dl *YouTubeSong) Download() error {
|
|||
for s := range cmd.Args {
|
||||
args += cmd.Args[s] + " "
|
||||
}
|
||||
Verbose(args)
|
||||
Verbose(string(output))
|
||||
Verbose("youtube-dl: " + err.Error())
|
||||
fmt.Printf(args + "\n" + string(output) + "\n" + "youtube-dl: " + err.Error() + "\n")
|
||||
return errors.New("Song download failed.")
|
||||
}
|
||||
}
|
||||
|
@ -80,7 +78,6 @@ func (dl *YouTubeSong) Play() {
|
|||
message = fmt.Sprintf(message+`<tr><td align="center">From playlist "%s"</td></tr>`, dl.playlist.Title())
|
||||
}
|
||||
dj.client.Self.Channel.Send(message+`</table>`, false)
|
||||
Verbose("Now playing " + dl.title)
|
||||
|
||||
go func() {
|
||||
dj.audioStream.Wait()
|
||||
|
|
Reference in a new issue