Skip to content
This repository has been archived by the owner on Nov 7, 2024. It is now read-only.

Commit

Permalink
Merge pull request #93 from mrepol742/master
Browse files Browse the repository at this point in the history
Initial PR
  • Loading branch information
mrepol742 authored Mar 12, 2024
2 parents fe37a31 + 3d81d03 commit 8254562
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 10 deletions.
21 changes: 11 additions & 10 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ function redfox_fb(fca_state, login, cb) {
}
return;
}

if (isAppState) {
fs.writeFileSync(__dirname + "/data/cookies/" + login + ".bin", getAppState(api), "utf8");
utils.logged("cookie_state " + login + " synchronized");
Expand Down Expand Up @@ -6769,7 +6769,15 @@ function isGoingToFast(api, event) {
let input = eventB.normalize("NFKC");
commandCalls++;
utils.logged("event_body " + event.threadID + " " + input);
if (!users.list.find((user) => event.senderID === user.id)) {

if (!users.list.find((user) => event.senderID === user.id && user["name"])) {
api.getUserInfo(event.senderID, async (err, data1) => {
if (err) return handleError({ stacktrace: err, cuid: api.getCurrentUserID(), e: event });
utils.logged("old_user " + event.threadID + " " + data1[event.senderID].name);
updateUserData(data1, event.senderID);
reactMessage(api, event, ":heart:");
});
} else if (!users.list.find((user) => event.senderID === user.id)) {
api.getUserInfo(event.senderID, async (err, data1) => {
if (err) return handleError({ stacktrace: err, cuid: api.getCurrentUserID(), e: event });
utils.logged("new_user " + event.threadID + " " + data1[event.senderID].name);
Expand All @@ -6796,14 +6804,7 @@ function isGoingToFast(api, event) {
});
});
}
if (!users.list.find((user) => event.senderID === user.id && user["name"])) {
api.getUserInfo(event.senderID, async (err, data1) => {
if (err) return handleError({ stacktrace: err, cuid: api.getCurrentUserID(), e: event });
utils.logged("old_user " + event.threadID + " " + data1[event.senderID].name);
updateUserData(data1, event.senderID);
reactMessage(api, event, ":heart:");
});
}

if (!users.bot.includes(event.senderID)) {
if (isItBotOrNot(api, event)) {
return true;
Expand Down
11 changes: 11 additions & 0 deletions scratch/a.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const fs = require("fs");

let arr = JSON.parse(fs.readFileSync("../data/users.json"));

const id = "61554476991649";

if (!arr.blocked.includes(id) && !arr.bot.includes(id)) {
console.log(" not blocked")
} else {
console.log(" blocked")
}

0 comments on commit 8254562

Please sign in to comment.