Answer the question
In order to leave comments, you need to log in
How to exclude characters from the response?
I receive a response from the server and send it to VKontakte, sometimes the response comes with color codes:
§6 - the color code itself.
There are several color codes (§1-9, ax), you must send a response without them
vk.updates.hear(/^(?:rcon)\s?([^]+)?/i, async (message) => {
if (users.includes(message.senderId)) {
await rcon.connect();
const response = await rcon.send(`${message.$match[1]}`);
return Promise.all([
message.send(` Ответ от сервера:`),
message.send(response),
rcon.disconnect()
]);
} else {
message.send('⚠ У вас нет прав!');
}
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question