Spaces:
Runtime error
Runtime error
| import { config } from "./config"; | |
| import { startBot, client } from "./bot/client"; | |
| import { setupHandlers } from "./bot/handlers"; | |
| import { startServer } from "./server/streamer"; | |
| const init = async () => { | |
| try { | |
| console.log("Starting services..."); | |
| await startBot(); | |
| console.log("\n======================================================="); | |
| console.log("IMPORTANT: If you are running on Hugging Face Spaces, "); | |
| console.log("Copy the following string into a new HF Secret named SESSION_STRING"); | |
| console.log("to prevent Telegram FloodWait rate-limits on restarts:"); | |
| console.log(client.session.save()); | |
| console.log("=======================================================\n"); | |
| setupHandlers(); | |
| await startServer(); | |
| console.log("FileStreamBot (TypeScript Version) is now running."); | |
| } catch (error) { | |
| console.error("Critical error starting application:", error); | |
| process.exit(1); | |
| } | |
| }; | |
| init(); | |