-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathindex.js
45 lines (40 loc) · 1.31 KB
/
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
require('dotenv').config();
require('colors');
const readlineSync = require('readline-sync');
const getTask = require('./getTask');
const clearTask = require('./clearTask');
const getProfile = require('./getProfile');
async function processTasks() {
process.stdout.write('\x1Bc');
console.log('========================================'.cyan);
console.log('= Nyan Heroes Bot – Season 2 ='.cyan);
console.log('= Created by HappyCuanAirdrop ='.cyan);
console.log('= https://t.me/HappyCuanAirdrop ='.cyan);
console.log('========================================'.cyan);
console.log();
console.log('Select an option:');
console.log('1. Get Tasks and Clear');
console.log('2. Get Profile');
const choice = readlineSync.question('Enter your choice: ');
switch (choice) {
case '1':
try {
const tasks = await getTask();
await clearTask(tasks);
console.log('Tasks cleared successfully.'.green);
} catch (error) {
console.log('Error processing tasks: '.red + error);
}
break;
case '2':
try {
await getProfile();
} catch (error) {
console.log('Error getting profile: '.red + error);
}
break;
default:
console.log('Invalid choice. Please select 1 or 2.'.red);
}
}
processTasks();