-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.py
More file actions
28 lines (22 loc) · 680 Bytes
/
main.py
File metadata and controls
28 lines (22 loc) · 680 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
import asyncio
import logging
from dotenv import load_dotenv
from telegram_bot_support.app.bot import SupportBot
from config import load_config
logging.basicConfig(
level=logging.INFO, format="%(asctime)s - %(name)s - %(levelname)s - %(message)s"
)
logger = logging.getLogger(__name__)
async def main() -> None:
load_dotenv()
config = load_config()
bot = SupportBot(config)
try:
logger.info("Starting support bot")
await bot.start()
except (KeyboardInterrupt, SystemExit):
logger.info("Bot stopped")
except Exception as e:
logger.error(f"Error running bot: {e}")
if __name__ == "__main__":
asyncio.run(main())