-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtransferbot.mjs
More file actions
35 lines (28 loc) · 908 Bytes
/
transferbot.mjs
File metadata and controls
35 lines (28 loc) · 908 Bytes
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
import { runTransferBot } from './src/transferBot.js';
// Parse arguments and execute
async function main() {
const args = process.argv.slice(2);
try {
// Pass all arguments to the transfer bot
await runTransferBot(args);
console.log('\n🏁 TransferBot completed!');
process.exit(0);
} catch (error) {
console.log(`\n❌ TransferBot error: ${error.message}`);
console.log(`💡 Use 'npm run transferbot' without arguments to see usage`);
process.exit(1);
}
}
// Handle uncaught errors
process.on('uncaughtException', (error) => {
console.log(`\n❌ Fatal error: ${error.message}`);
process.exit(1);
});
process.on('unhandledRejection', (error) => {
console.log(`\n❌ Unhandled rejection: ${error.message}`);
process.exit(1);
});
// Only run main if this file is executed directly
if (process.argv[1].endsWith('transferbot.mjs')) {
main();
}