Reduced the messages on the console

This commit is contained in:
Chris Sexton 2012-08-25 00:49:48 -04:00
parent 9c721a0f58
commit 3e7f8d4248
9 changed files with 21 additions and 19 deletions

View File

@ -87,7 +87,7 @@ func (b *Bot) isCmd(message string) (bool, string) {
}
// Builds our internal message type out of a Conn & Line from irc
func (b *Bot)buildMessage(conn *irc.Conn, line *irc.Line) Message {
func (b *Bot) buildMessage(conn *irc.Conn, line *irc.Line) Message {
// Check for the user
user := b.checkuser(line.Nick)
@ -125,7 +125,7 @@ func (b *Bot)buildMessage(conn *irc.Conn, line *irc.Line) Message {
func (b *Bot) MsgRecieved(conn *irc.Conn, line *irc.Line) {
msg := b.buildMessage(conn, line)
if strings.HasPrefix(msg.Body, "help") && msg.Command{
if strings.HasPrefix(msg.Body, "help") && msg.Command {
parts := strings.Fields(strings.ToLower(msg.Body))
b.checkHelp(msg.Channel, parts)
return

View File

@ -34,5 +34,8 @@ func Readconfig(version, cfile string) *Config {
panic(err)
}
c.Version = version
fmt.Printf("godeepintir version %s running.\n")
return &c
}

View File

@ -21,7 +21,6 @@ func main() {
flag.Parse() // parses the logging flags.
config := config.Readconfig(Version, *cfile)
fmt.Println(config)
c := irc.SimpleClient(config.Nick)
// Optionally, enable SSL
@ -33,6 +32,7 @@ func main() {
func(conn *irc.Conn, line *irc.Line) {
for _, channel := range config.Channels {
conn.Join(channel)
fmt.Printf("Now talking in %s.\n", channel)
}
})
// And a signal on disconnect

View File

@ -5,10 +5,10 @@ import (
"fmt"
"labix.org/v2/mgo"
"labix.org/v2/mgo/bson"
"math/rand"
"strconv"
"strings"
"time"
"math/rand"
)
// This is a skeleton plugin to serve as an example and quick copy/paste for new plugins.

View File

@ -94,4 +94,3 @@ func (fp FalsePlugin) LoadData() {
func (p *FalsePlugin) Event(kind string, message bot.Message) bool {
return false
}

View File

@ -64,7 +64,7 @@ func (p *RememberPlugin) Message(message bot.Message) bool {
return true
}
for i := len(p.Log[message.Channel])-1; i >= 0; i-- {
for i := len(p.Log[message.Channel]) - 1; i >= 0; i-- {
entry := p.Log[message.Channel][i]
// find the entry we want
fmt.Printf("Comparing '%s' to '%s'\n", entry.Raw, snip)

View File

@ -2,8 +2,8 @@ package plugins
import (
"bitbucket.org/phlyingpenguin/godeepintir/bot"
"strings"
"fmt"
"strings"
)
type TalkerPlugin struct {