-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbot.py
More file actions
34 lines (30 loc) · 1.01 KB
/
bot.py
File metadata and controls
34 lines (30 loc) · 1.01 KB
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
import sys
import asyncio
from datetime import datetime
# Import necessary components from the new package structure
from bot_package.bot_instance import bot
from bot_package.config import AUTH_USERS # Import AUTH_USERS if needed directly here
# Handlers are automatically registered because they use the @bot decorator
import bot_package.handlers
import bot_package.helpers
import bot_package.downloader
# --- Main Execution ---
if __name__ == "__main__":
now = datetime.now()
print("-" * 30)
print(f"BOT STARTING")
print(f"{now:%A, %d %B %Y} - {now:%H:%M:%S}")
print(f"Python: {sys.version.split()[0]}")
# You can add Pyrogram version here if needed:
import pyrogram
print(f"Pyrogram: {pyrogram.__version__}")
print("-" * 30)
try:
bot.run()
except Exception as e:
print(f"FATAL ERROR: Bot crashed with exception: {e}")
# Consider adding more robust error logging here
finally:
print("-" * 30)
print("BOT STOPPED")
print("-" * 30)