Reformat and translate

This commit is contained in:
Pijus Kamandulis
2025-01-19 22:03:57 +02:00
parent beadf36b51
commit 3390e6f093
23 changed files with 2820 additions and 2224 deletions

View File

@@ -5,28 +5,26 @@ module.exports = function (RED) {
RED.nodes.createNode(this, config);
this.config = RED.nodes.getNode(config.config);
var node = this;
const client = this.config.client;
const client = this.config.client;
const ignore = config.ignore.split(/\n/);
try {
client.addEventHandler((update) => {
if(update.message.fromId != null && !ignore.includes(update.message.fromId.userId.toString())){
if (
update.message.fromId != null &&
!ignore.includes(update.message.fromId.userId.toString())
) {
node.send({
payload:{
update
}
} )
payload: {
update,
},
});
}
}, new NewMessage());
} catch (err) {
node.error('Ошибка авторизации: ' + err.message);
node.error("Authorization error: " + err.message);
}
}
RED.nodes.registerType('receiver', Receiver);
RED.nodes.registerType("receiver", Receiver);
};