forked from youngcoder45/Discord-bot-in-Python
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmain.py
More file actions
28 lines (24 loc) · 789 Bytes
/
main.py
File metadata and controls
28 lines (24 loc) · 789 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
#!/usr/bin/env python3
"""
Main entry point for CodeVerse Discord Bot
Optimized for bot-hosting.net deployment
"""
import sys
import os
import asyncio
# Add src directory to Python path
sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'src'))
# Import and run the bot
if __name__ == "__main__":
try:
from bot import main
print("Starting CodeVerse Bot...")
print(f"Platform: {os.getenv('HOSTING_PLATFORM', 'unknown')}")
print(f"Instance: {os.getenv('INSTANCE_ID', 'production')}")
asyncio.run(main())
except KeyboardInterrupt:
print("Bot shutdown requested by user")
except Exception as e:
print(f"Fatal error: {e}")
import traceback
traceback.print_exc()