forked from Widiskel/initia-daily-bot
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathschedule.js
40 lines (37 loc) · 857 Bytes
/
schedule.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import { Twisters } from "twisters";
import { CronJob } from "cron";
import { doQuest } from "./index.js";
(async () => {
try {
const twisters = new Twisters();
twisters.put("title", {
active: false,
text: `
Initia Task Runner !
`,
});
const job = new CronJob(
"38 * * * *",
() => {
twisters.put("title", {
active: false,
text: `
Retrying ...
`,
});
account.forEach(async (account) => {
var walletAddress = account[0];
var privateKey = account[1];
await doQuest(walletAddress, privateKey).catch((error) =>
console.error(error)
);
});
},
null,
true
);
job.start();
} catch (error) {
console.error("Error During executing bot", error);
}
})();