diff options
| -rw-r--r-- | config.example.yml | 3 | ||||
| -rw-r--r-- | munch.go | 25 |
2 files changed, 18 insertions, 10 deletions
diff --git a/config.example.yml b/config.example.yml index 907638f..07c4ded 100644 --- a/config.example.yml +++ b/config.example.yml @@ -1,4 +1,6 @@ worlds: + enable: false + server: # These shouldn't change ip: 209.240.84.122 port: 6650 @@ -9,5 +11,6 @@ worlds: avatar: Vamp.mov discord: + enable: false token: SoMetOKen22 prefix: m~ @@ -7,6 +7,7 @@ import ( "github.com/Whirlsplash/munch/pkg/config" "github.com/Whirlsplash/munch/pkg/discord" "github.com/Whirlsplash/munch/pkg/server" + "github.com/spf13/viper" "sync" ) @@ -16,18 +17,22 @@ func main() { var wg sync.WaitGroup // Discord bot - wg.Add(1) - go func() { - discord.Do() - wg.Done() - }() - wg.Add(1) + if viper.GetBool("discord.enable") { + wg.Add(1) + go func() { + discord.Do() + wg.Done() + }() + } // Worlds bot - go func() { - server.Do() - wg.Done() - }() + if viper.GetBool("worlds.enable") { + wg.Add(1) + go func() { + server.Do() + wg.Done() + }() + } wg.Wait() } |