diff --git a/main.go b/main.go index 95ef728..cfa1535 100644 --- a/main.go +++ b/main.go @@ -51,7 +51,8 @@ var ( db *sql.DB - cfg Config + cfg Config + MQCWMsgQueue chan ChatWarsMessage ) func PrintText(m *tb.Message) { @@ -94,7 +95,11 @@ func main() { } go StartBot() - go MQMainReceive() + + MQCWMsgQueue = make(chan ChatWarsMessage, 100) + for w := 1; w <= 3; w++ { + go MQGetMsg(w, MQCWMsgQueue) + } fmt.Println("Started !") diff --git a/mq.go b/mq.go index 2de4ea2..379fd20 100644 --- a/mq.go +++ b/mq.go @@ -3,6 +3,7 @@ package main import ( "encoding/json" "log" + "strconv" "github.com/streadway/amqp" )