@bithighlander/gary-bot
Version:
Gary Gensler AI Bot - A fun and interactive SEC chairman bot
35 lines (28 loc) ⢠881 B
JavaScript
// This line is needed to make the CLI executable
const path = require('path');
const { spawn } = require('child_process');
console.log('š¤ Starting Gary Bot...');
console.log('š¤ Gary Gensler is warming up his voice...');
// Get the path to the compiled index.js file
const botPath = path.join(__dirname, '../lib/index.js');
// Spawn the bot process
const bot = spawn('node', [botPath], {
stdio: 'inherit',
env: process.env
});
// Handle process events
bot.on('error', (err) => {
console.error('Failed to start Gary Bot:', err);
process.exit(1);
});
process.on('SIGINT', () => {
console.log('\nš Gary Gensler is going back to his office...');
bot.kill();
process.exit(0);
});
process.on('SIGTERM', () => {
console.log('\nš Gary Gensler is going back to his office...');
bot.kill();
process.exit(0);
});