Answer the question
In order to leave comments, you need to log in
Send response only to certain users?
How to allow only certain users to use a command?
vk.updates.hear(/^(?:rcon)\s?([^]+)?/i, async (message) => {
await rcon.connect();
const response = await rcon.send(`${message.$match[1]}`);
return Promise.all([
message.send(` Ответ от сервера:`),
message.send(response),
rcon.disconnect()
]);
});
Answer the question
In order to leave comments, you need to log in
let users = [1, 2, 3, 4, 5]; // определённые пользователи
vk.updates.hear(/^(?:rcon)\s?([^]+)?/i, async (message) => {
if (!users.includes(message.senderId))
return;
await rcon.connect();
const response = await rcon.send(`${message.$match[1]}`);
return Promise.all([
message.send(` Ответ от сервера:`),
message.send(response),
rcon.disconnect()
]);
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question