func (suite *ToggleShuffleCommandTestSuite) SetupSuite() { DJ = bot.NewMumbleDJ() viper.Set("commands.toggleshuffle.aliases", []string{"toggleshuffle", "ts"}) viper.Set("commands.toggleshuffle.description", "toggleshuffle") viper.Set("commands.toggleshuffle.is_admin", true) }
func (suite *HelpCommandTestSuite) SetupSuite() { DJ = bot.NewMumbleDJ() viper.Set("commands.help.aliases", []string{"help", "h"}) viper.Set("commands.help.description", "help") viper.Set("commands.help.is_admin", false) }
func (suite *CacheSizeCommandTestSuite) SetupSuite() { DJ = bot.NewMumbleDJ() viper.Set("commands.cachesize.aliases", []string{"cachesize", "cs"}) viper.Set("commands.cachesize.description", "cachesize") viper.Set("commands.cachesize.is_admin", true) }
func (suite *VersionCommandTestSuite) SetupSuite() { DJ = bot.NewMumbleDJ() viper.Set("commands.version.aliases", []string{"version", "v"}) viper.Set("commands.version.description", "version") viper.Set("commands.version.is_admin", false) DJ.Version = "test" }
func (suite *VolumeCommandTestSuite) SetupSuite() { DJ = bot.NewMumbleDJ() viper.Set("commands.volume.aliases", []string{"volume", "vol"}) viper.Set("commands.volume.description", "volume") viper.Set("commands.volume.is_admin", false) viper.Set("volume.lowest", 0.2) viper.Set("volume.highest", 1) viper.Set("volume.default", 0.4) }
func (suite *CurrentTrackCommandTestSuite) SetupSuite() { DJ = bot.NewMumbleDJ() // Trick the tests into thinking audio is already playing to avoid // attempting to play tracks that don't exist. DJ.AudioStream = new(gumbleffmpeg.Stream) viper.Set("commands.currenttrack.aliases", []string{"currenttrack", "current"}) viper.Set("commands.currenttrack.description", "currenttrack") viper.Set("commands.currenttrack.is_admin", false) }
func (suite *NumTracksCommandTestSuite) SetupSuite() { DJ = bot.NewMumbleDJ() bot.DJ = DJ // Trick the tests into thinking audio is already playing to avoid // attempting to play tracks that don't exist. DJ.AudioStream = new(gumbleffmpeg.Stream) viper.Set("commands.numtracks.aliases", []string{"numtracks", "num"}) viper.Set("commands.numtracks.description", "numtracks") viper.Set("commands.numtracks.is_admin", false) }
import ( "io/ioutil" "os" "strings" "github.com/Sirupsen/logrus" "github.com/matthieugrieger/mumbledj/bot" "github.com/matthieugrieger/mumbledj/commands" "github.com/matthieugrieger/mumbledj/services" "github.com/spf13/viper" "github.com/urfave/cli" ) // DJ is a global variable that holds various details about the bot's state. var DJ = bot.NewMumbleDJ() func init() { DJ.Commands = commands.Commands DJ.AvailableServices = services.Services // Injection into sub-packages. commands.DJ = DJ services.DJ = DJ bot.DJ = DJ DJ.Version = "v3.0.7" logrus.SetLevel(logrus.WarnLevel) }