コード例 #1
0
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)
}
コード例 #2
0
ファイル: help_test.go プロジェクト: matthieugrieger/mumbledj
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)
}
コード例 #3
0
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)
}
コード例 #4
0
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"
}
コード例 #5
0
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)
}
コード例 #6
0
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)
}
コード例 #7
0
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)
}
コード例 #8
0
ファイル: main.go プロジェクト: GabrielPlassard/mumbledj
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)
}