F
F
falsescam2020-05-14 13:30:42
JavaScript
falsescam, 2020-05-14 13:30:42

How to make the command kick by forwarded message or by nickname (id)?

vk.updates.hear(/^-kick/i, async (context) => {
    var args = context.message.text.split(' ');
    if(admins.indexOf(context.senderId) === -1) {
        return false;
    }
    if(args[1]) {
        const response2 = vk.api.messages.delete({
            message_ids: context.id,
            delete_for_all: 1
        })
    }
            const response = vk.api.messages.removeChatUser({
                chat_id: context.chatId,
                user_id: args[1]
            })
                const response3 = vk.api.messages.send({
                    chat_id: context.chatId,
                    message: '@id' + context.senderId + ' Пользователь @id'  + args[1] + ' Успешно кикнут из беседы!'
                })
        });

There is such a script, it kicks the current by id123
It is necessary to make it to kick the forwarded message and id in the form of a nickname

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