Browse Source

Removed debugging output

Mathew Medoff 3 years ago
parent
commit
f10b32c72d
3 changed files with 1 additions and 13 deletions
  1. 1 4
      bot.go
  2. 0 4
      bot/event/mux/message.go
  3. 0 5
      bot/event/mux/router.go

+ 1 - 4
bot.go

@@ -9,7 +9,6 @@ import (
 
 	"git.mgmcomp.net/thisnthat/discord/bot/event/mux"
 	"git.mgmcomp.net/thisnthat/discordgo"
-	"github.com/sirupsen/logrus"
 )
 
 type Bot struct {
@@ -41,7 +40,7 @@ func (bot *Bot) Start(wg *sync.WaitGroup) error {
 	if err != nil {
 		return err
 	}
-	logrus.Info("Discord bot has connected")
+
 	bot.running = make(chan os.Signal, 1)
 	bot.online = true
 	signal.Notify(bot.running, syscall.SIGINT, os.Kill)
@@ -49,14 +48,12 @@ func (bot *Bot) Start(wg *sync.WaitGroup) error {
 
 	bot.session.Close()
 	bot.online = false
-	logrus.Info("Discord bot has been disconnected")
 
 	return nil
 }
 
 func (bot *Bot) Stop() {
 	if bot.online {
-		logrus.Infof("Shutting down Bot")
 		bot.running <- syscall.SIGINT
 	}
 }

+ 0 - 4
bot/event/mux/message.go

@@ -6,7 +6,6 @@ import (
 	"strings"
 
 	"git.mgmcomp.net/thisnthat/discordgo"
-	"github.com/sirupsen/logrus"
 )
 
 // OnMessageCreate is a DiscordGo Event Handler function.  This must be
@@ -14,7 +13,6 @@ import (
 // will receive all Discord messages and parse them for matches to registered
 // routes.
 func (r *Router) OnMessageCreate(s *discordgo.Session, m *discordgo.MessageCreate) {
-	logrus.Info("Got message")
 	var err error
 
 	// Ignore all messages created by the Bot account itself
@@ -32,11 +30,9 @@ func (r *Router) OnMessageCreate(s *discordgo.Session, m *discordgo.MessageCreat
 	if err != nil {
 		channel, err = s.Channel(m.ChannelID)
 		if err != nil {
-			logrus.Warnf("Failed to get the channel for message: %s", err)
 		} else {
 			err = s.State.ChannelAdd(channel)
 			if err != nil {
-				logrus.Warnf("Failed to add the channel to the session state: %s", err)
 			}
 		}
 	}

+ 0 - 5
bot/event/mux/router.go

@@ -4,8 +4,6 @@ import (
 	"errors"
 	"strings"
 
-	"github.com/sirupsen/logrus"
-
 	"git.mgmcomp.net/thisnthat/discordgo"
 )
 
@@ -168,11 +166,9 @@ func isValidRouteType(routeType RouteType) bool {
 }
 
 func (r *Router) findRoute(searchString string, routeType RouteType) (*route, []string, []string) {
-	logrus.Printf("Find Route: %s", searchString)
 	fields := strings.Fields(searchString)
 
 	if len(fields) == 0 {
-		logrus.Printf("No route Found")
 		return nil, nil, nil
 	}
 
@@ -184,7 +180,6 @@ func (r *Router) findRoute(searchString string, routeType RouteType) (*route, []
 		}
 
 		if strings.ToLower(commandKey) == strings.ToLower(route.Name) {
-			logrus.Printf("Route Found: %s", route.Name)
 			return route, fields[0:], fields[1:]
 		}
 	}