Professional Documents
Culture Documents
let tokens_to_sell = 1;
let contract;
(async () => {
await client.start({
phoneNumber: async () => await "+36301953442", // SAJÁT TELEFONSZÁM
password: async () => await "almafa2", //SAJÁT TELEGRAMOS JELSZÓ
phoneCode: async () => await input.text("Code?"),
onError: (err) => console.log(err),
});
console.log("You should now be connected.");
console.log(client.session.save()); // Save this string to avoid logging in again
client.addEventHandler(onNewMessage, new NewMessage({}));
// console.log((message.peerId.channelId.value).toString());
if (channelId.includes(message.peerId.channelId.value.toString())) {
if (regex.test(message.message)) {
if ((await onCheckMessCount(address))) {
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
await sleep(1000);
tg2.push()
console.log(tg2)
tg2.forEach(tg3 => {
run(tg3);
});
async function run(tg3) {
try {
} catch (err) {
console.error(err.message);
return
}
try {
channelObj.push({'id':newId,'name':chat.username});
/*
for (let i = 0; i < result.chats.length ; i++) {
if(result.chats[i].length != 0)
{
array2.push(result.chats[i].username);
}
let array3 = (result.chats[i].id.value)
//console.log(xd);
//array4.push()
//array2.push()
//console.log(array4)
//console.log(array2)
run(chat.username);
/*
array2.forEach(channel => {
run(channel);
});
*/
);
// console.log(result); // prints the result
})();
}
}
})
/*
console.log(path.resolve(__dirname, 'channels.json'), channelId);
fs.writeFile(path.resolve(__dirname, 'channels.json'),
JSON.stringify(channelId), (err) => {
if (err)
console.log(err);
else {
console.log("ID File written successfully\n");
}
});
console.log(path.resolve(__dirname, 'channeluser.json'),
channelUser);
fs.writeFile(path.resolve(__dirname, 'channeluser.json'),
JSON.stringify(channelUser), (err) => {
if (err)
console.log(err);
else {
console.log("USER File written successfully\n");
}
});
*/
console.log(path.resolve(__dirname, 'channeluser.json'),
channelUser);
fs.writeFile(path.resolve(__dirname, 'channeluser.json'),
JSON.stringify(channelUser), (err) => {
if (err)
console.log(err);
else {
console.log("USER File written successfully\n");
}
});
channelObj.forEach(peer => {
console.log(peer)
run(peer.name);
});
console.log(nowtimeStamp - messagedate)
/*
chanellObj.filter((item)=>{
if(item.name == peer)
{
}
})
*/
})();
};
})();
})();
} catch (err) {
console.error(err.message);
try {
console.log(address);
addresses.contractAddress = address;
tokenOut = address;
contract = new ethers.Contract(addresses.contractAddress, tokenAbi2,
account);
} catch (err) {
console.error(err.message);
}
}
}
}
}
})();
let pancakeSwapContract =
"0x10ED43C718714eb63d5aA57B78B54704E256024E".toLowerCase();
if (!amountOut) return 0;
return amountOut;
}