This commit is contained in:
shoopea 2019-05-04 17:01:57 +08:00
parent 9806f14d61
commit 9f7e236ecd
2 changed files with 8 additions and 2 deletions

View File

@ -52,6 +52,7 @@ var (
db *sql.DB db *sql.DB
cfg Config cfg Config
MQCWMsgQueue chan ChatWarsMessage
) )
func PrintText(m *tb.Message) { func PrintText(m *tb.Message) {
@ -94,7 +95,11 @@ func main() {
} }
go StartBot() go StartBot()
go MQMainReceive()
MQCWMsgQueue = make(chan ChatWarsMessage, 100)
for w := 1; w <= 3; w++ {
go MQGetMsg(w, MQCWMsgQueue)
}
fmt.Println("Started !") fmt.Println("Started !")

1
mq.go
View File

@ -3,6 +3,7 @@ package main
import ( import (
"encoding/json" "encoding/json"
"log" "log"
"strconv"
"github.com/streadway/amqp" "github.com/streadway/amqp"
) )