R
R
re-incarnation2021-06-12 07:15:52
API
re-incarnation, 2021-06-12 07:15:52

Vk api message, how to send content in one message with variable?

How can I send multiple values ​​from a variable in one message?

The structure of my code:
1 - Connecting to the
database 2 - Selecting data by condition
3 - Sending a message

The problem is in the latter, when I display a message, several of them are sent.

test, err := vk.MessagesSend(api.Params{
      	"peer_id": 2000000001,
        "random_id": 0,
        "message": "Reports:\r\n" + thread.Title,
      })
      if err != nil {
      	log.Fatal(err)
      }
      spew.Dump(test)

A few in the plan - it displays the first record from the database in one message, then the next one in the next, and so on.
//новое сообщение
Reports:
test
//новое сообщение
Reports:
Test
//новое сообщение
Reports:
еуые
//новое сообщение
Reports:
f

Answer the question

In order to leave comments, you need to log in

1 answer(s)
W
WolfInChains, 2021-06-12
@re-incarnation

Combine them into 1 line and only then send?
https://m.habr.com/ru/post/417479/
https://coderoad.ru/1760757/%D0%9A%D0%B0%D0%BA-%D1...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question