Browse Source

nyk

master^2
gsd 1 year ago
parent
commit
a9ef7e0e4d
  1. 12
      tradebot.js

12
tradebot.js

@ -113,7 +113,11 @@ function setupClient() {
if (calculate(offer)) {
console.log(consoleTime(), `[${offer.id}] Try accept trade`);
offer.accept(false, function(error, status) {
if (error.message === "Not Logged In") {
if (error == null) {
console.log(consoleTime(), "Success accept trade");
return;
}
if ("message" in error && error.message === "Not Logged In") {
console.log(consoleTime(), "Need relog to accept");
client.relog();
} else {
@ -123,7 +127,11 @@ function setupClient() {
} else {
console.log(consoleTime(), `[${offer.id}] Try decline trade`);
offer.decline(function(error, status) {
if (error.message === "Not Logged In") {
if (error == null) {
console.log(consoleTime(), "Success decline trade");
return;
}
if ("message" in error && error.message === "Not Logged In") {
console.log(consoleTime(), "Need relog to decline");
client.relog();
} else {

Loading…
Cancel
Save