diff --git a/main.go b/main.go index bff2673..507bb09 100644 --- a/main.go +++ b/main.go @@ -107,13 +107,19 @@ func ListenCW(c *tdlib.Client) { return false } - conn, _ := amqp.Dial("amqp://shoopea:UmDd5g4WRa2MzqOHsG2T@localhost:5672/chatwars/" + strconv.FormatInt(ownUserID64, 10)) + conn, err := amqp.Dial("amqp://shoopea:UmDd5g4WRa2MzqOHsG2T@localhost:5672/chatwars/" + strconv.FormatInt(ownUserID64, 10)) + if err != nil { + log.Fatal(err) + } defer conn.Close() - ch, _ := conn.Channel() + ch, err := conn.Channel() + if err != nil { + log.Fatal(err) + } defer ch.Close() - q, _ := ch.QueueDeclare( + q, err := ch.QueueDeclare( "msg", // name false, // durable false, // delete when unused @@ -121,6 +127,9 @@ func ListenCW(c *tdlib.Client) { false, // no-wait nil, // arguments ) + if err != nil { + log.Fatal(err) + } receiver := c.AddEventReceiver(&tdlib.UpdateNewMessage{}, eventFilter, 100) for newMsg := range receiver.Chan {