S
S
ShamiLLL2020-11-25 18:33:40
Python
ShamiLLL, 2020-11-25 18:33:40

What do "offset", "count" and "filter" mean in the VK bot code?

What do "offset", "count" and "filter" mean in the VK bot code?
The code looks like:

messages = vk_session.method("messages.getConversations", {"offset": 0, "count": 20, "filter": "unanswered"})

And also what does [0] mean in this code:
id = messages["items"][0]["last_message"]["from_id"]

What will change if these values ​​are changed?
Please explain in simple terms

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Karbivnichy, 2020-11-25
@ShamiLLL

offset - offset, that is, from which id to start doing something;
count - number;
filter - filter. Filter something by the given parameters;
Example (pseudocode):
We have 100 messages, id of which is from 1 to 100.
print(messages({"offset":10,"count":20})) - Print 20 messages, starting from id 10.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question