err
This commit is contained in:
parent
15859aeb18
commit
eb392a7e6a
15
main.go
15
main.go
@ -107,13 +107,19 @@ func ListenCW(c *tdlib.Client) {
|
|||||||
return false
|
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()
|
defer conn.Close()
|
||||||
|
|
||||||
ch, _ := conn.Channel()
|
ch, err := conn.Channel()
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal(err)
|
||||||
|
}
|
||||||
defer ch.Close()
|
defer ch.Close()
|
||||||
|
|
||||||
q, _ := ch.QueueDeclare(
|
q, err := ch.QueueDeclare(
|
||||||
"msg", // name
|
"msg", // name
|
||||||
false, // durable
|
false, // durable
|
||||||
false, // delete when unused
|
false, // delete when unused
|
||||||
@ -121,6 +127,9 @@ func ListenCW(c *tdlib.Client) {
|
|||||||
false, // no-wait
|
false, // no-wait
|
||||||
nil, // arguments
|
nil, // arguments
|
||||||
)
|
)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
receiver := c.AddEventReceiver(&tdlib.UpdateNewMessage{}, eventFilter, 100)
|
receiver := c.AddEventReceiver(&tdlib.UpdateNewMessage{}, eventFilter, 100)
|
||||||
for newMsg := range receiver.Chan {
|
for newMsg := range receiver.Chan {
|
||||||
|
Loading…
Reference in New Issue
Block a user