From c1637c64175c0bbfbb5543f2681732b3ad898829 Mon Sep 17 00:00:00 2001 From: NightStrang6r Date: Tue, 22 Nov 2022 19:09:23 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=B4=20v0.4.3=20Small=20fixes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Fixed termux install - Fixed error message --- package.json | 10 ++-------- src/chat.js | 14 ++++++++------ 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/package.json b/package.json index c4c3732..24cd039 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "funpayserver", - "version": "0.4.2", + "version": "0.4.3", "description": "CLI app for auto-managing your FunPay account", "main": "src/index.js", "dependencies": { @@ -28,11 +28,5 @@ "bugs": { "url": "https://github.com/NightStrang6r/FunPayServer/issues" }, - "homepage": "https://github.com/NightStrang6r/FunPayServer#readme", - "devDependencies": { - "@esbuild-plugins/node-resolve": "^0.1.4", - "@hyrious/esbuild-plugin-commonjs": "^0.2.1", - "esbuild": "^0.15.10", - "esbuild-node-externals": "^1.5.0" - } + "homepage": "https://github.com/NightStrang6r/FunPayServer#readme" } diff --git a/src/chat.js b/src/chat.js index 18e9765..9d892d7 100644 --- a/src/chat.js +++ b/src/chat.js @@ -29,11 +29,17 @@ async function autoResponse() { // Commands in file for(let i = 0; i < autoRespData.length; i++) { - if(chat.message == autoRespData[i].command) { + if(autoRespData[i].command && chat.message.toLowerCase() == autoRespData[i].command.toLowerCase()) { log(`Команда: ${c.yellowBright(autoRespData[i].command)} для пользователя ${c.yellowBright(chat.userName)}.`); await sendMessage(chat.node, autoRespData[i].response); break; } + + /*if(autoRespData[i].word && chat.message.toLowerCase().includes(autoRespData[i].word.toLowerCase())) { + log(`Ключевое слово: ${c.yellowBright(autoRespData[i].word)} для пользователя ${c.yellowBright(chat.userName)}.`); + await sendMessage(chat.node, autoRespData[i].response); + break; + }*/ } // Custom commands @@ -112,7 +118,6 @@ async function sendMessage(node, message, customNode = false) { if(!message || message == undefined || !node || node == undefined) return; let result = false; - let delay = 0; try { let newNode = node; @@ -157,7 +162,7 @@ async function sendMessage(node, message, customNode = false) { headers: headers }; - const resp = await fetch(url, options, delay); + const resp = await fetch(url, options); const json = await resp.json(); if(json.response && json.response.error == null) { @@ -171,9 +176,6 @@ async function sendMessage(node, message, customNode = false) { log(json); result = false; } - - tries++; - delay += 10000; } catch (err) { log(`Ошибка при отправке сообщения: ${err}`, 'r'); }