diff --git a/def.go b/def.go index 162ee92..498a0d5 100644 --- a/def.go +++ b/def.go @@ -29,7 +29,7 @@ type MQSession struct { MQConnection *amqp.Connection MQChannel *amqp.Channel MQQueue *amqp.Queue - MQDelivery <-chan *amqp.Delivery + MQDelivery <-chan *ampq.Delivery isConnected bool } diff --git a/mq.go b/mq.go index 6ab4ae2..c4247f2 100644 --- a/mq.go +++ b/mq.go @@ -8,13 +8,13 @@ import ( func (s MQSession) Open() error { if s.isConnected { - return errors.New("Session is already connected.") + return error.Error("Session is already connected.") } if SLL == false { s.MQConnection, err = amqp.Dial("amqp://" + Session.User + ":" + Session.Password + "@" + Session.Host + "/" + Session.Path) } else { - return errors.New("SSL connection not implemented") + return error.Error("SSL connection not implemented") } logOnError(err, "Open : Failed to connect to RabbitMQ") if err != nil { diff --git a/workers.go b/workers.go index 82a53ff..5388f7d 100644 --- a/workers.go +++ b/workers.go @@ -9,6 +9,7 @@ import ( "strings" "time" + "github.com/streadway/amqp" tb "gopkg.in/tucnak/telebot.v2" )