E
E
egorlisss2019-05-22 13:48:27
JavaScript
egorlisss, 2019-05-22 13:48:27

How to use regular expression?

I use

vk.updates.hear(/^(?:\/badge)\s([^]+):([^]+):([^]+)?/i, async (message) => {
    return message.send(`Значение для значка ${message.$match[1]} для [id${message.$match[2]}|Пользователя] установлено на ${message.$match[3]}`); 
});

But when sending /badge owner 1 false
Nothing happens, no errors either

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
egorlisss, 2019-05-22
@egorlisss

/^(?:\/badge)\s([^])\s([^])\s([^])?/i

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question