-
Notifications
You must be signed in to change notification settings - Fork 9
/
index.js
25 lines (21 loc) · 639 Bytes
/
index.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
require('dotenv').config();
const getTasks = require('./getTasks');
const clearTask = require('./clearTask');
const USER_ID = process.env.TOKEN.split('-')[0];
const MY_BEARER = process.env.TOKEN;
(async () => {
try {
const tasksToClear = await getTasks(USER_ID, MY_BEARER);
for (const taskId of tasksToClear) {
await clearTask(USER_ID, taskId, MY_BEARER);
}
console.log(
'All tasks have been cleared, congrats! Subscribe: https://t.me/HappyCuanAirdrop'
);
} catch (error) {
console.log(
'Error in Clear Tasks: ' +
(error.response?.data?.message || error.response)
);
}
})();