Skip to content

Commit

Permalink
📴 v0.4.3 Small fixes
Browse files Browse the repository at this point in the history
- Fixed termux install
- Fixed error message
  • Loading branch information
NightStrang6r committed Nov 22, 2022
1 parent dedb641 commit c1637c6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 deletions.
10 changes: 2 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down Expand Up @@ -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"
}
14 changes: 8 additions & 6 deletions src/chat.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand All @@ -171,9 +176,6 @@ async function sendMessage(node, message, customNode = false) {
log(json);
result = false;
}

tries++;
delay += 10000;
} catch (err) {
log(`Ошибка при отправке сообщения: ${err}`, 'r');
}
Expand Down

0 comments on commit c1637c6

Please sign in to comment.