T
T
TheBeJIIHiu2021-10-31 15:33:14
API
TheBeJIIHiu, 2021-10-31 15:33:14

A very strange error. Node JS / VK API?

Handle polling update error: TypeError: Cannot read property 'member_id' of undefined


It is not clear why it occurs, because member_id is taken from the method.

Here is the code:
vk.updates.on([ 'chat_invite_user', 'chat_invite_user_by_link' ], async (message, context, bot) => {
if(chats[message.chatId].users[message.payload.action.member_id].isBanned && chats[message.chatId].users[message.payload.action.member_id].permanently) {

vk.api.call("messages.removeChatUser", { chat_id: chatId, user_id: message.payload.action.member_id } );
return message.send('@id' + message.payload.action.member_id + ' - находится в бане, поэтому он был исключен из беседы.'); }
} )

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question