Answer the question
In order to leave comments, you need to log in
How to kick all participants in a conversation using the vk api?
Hello, how to kick all participants from a conversation? VK API, PYTHON
Answer the question
In order to leave comments, you need to log in
import vk_api
vk_session = vk_api.VkApi(token='токен от стр')
vk = vk_session.get_api()
peer_id = # тут чат айди + 2000000000. Пример - 2000002203, где 2203 - чат айди
my_id = # айди страницы, которая будет кикать
users = vk.messages.getConversationMembers(peer_id=peer_id)['items']
for user in users:
if user['member_id'] != my_id:
vk.messages.removeChatUser(chat_id=peer_id - 2000000000, member_id=user['member_id'])
In js, strings in memory are stored in UTF16-LE encoding (2-4 bytes per character, in most cases 2) and the library works with the bytes of the string in it
. The C ++ library accepts std:: vector as input when simply converting the string into which you get a vector of bytes in the user's current encoding, most likely a single byte
Encode the C++ string in UTF16-LE before encoding - then get the same result
Libraries add different endings if the string is not a multiple of eight characters.
In JS:
if (block.length < 8) {
var count = 8 - block.length;
while (0 < count--) {
block += "\0";
}
size_t padding_length = dst.size() % sizeof(uint64_t);
if (padding_length == 0) {
padding_length = sizeof(uint64_t);
} else {
padding_length = sizeof(uint64_t) - padding_length;
}
for (size_t i = 0; i < padding_length; ++i) {
dst.push_back(static_cast<char>(padding_length));
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question