autofish's colorable output for windows

and non color output for daze
This commit is contained in:
Tnze
2019-07-28 19:31:51 +08:00
parent cc3789ff22
commit 708097608c
4 changed files with 12 additions and 2 deletions

View File

@ -3,6 +3,7 @@ package main
import (
"github.com/Tnze/go-mc/bot"
"github.com/Tnze/go-mc/chat"
"github.com/mattn/go-colorable"
"log"
"time"
)
@ -15,6 +16,7 @@ var (
)
func main() {
log.SetOutput(colorable.NewColorableStdout())
c = bot.NewClient()
//Login

View File

@ -47,7 +47,7 @@ func onGameStart() error {
}
func onChatMsg(c chat.Message, pos byte) error {
log.Println("Chat:", c)
log.Println("Chat:", c.ClearString()) // output chat message without any format code (like color or bold)
return nil
}