-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
48 lines (34 loc) 路 1.18 KB
/
Copy pathmain.py
File metadata and controls
48 lines (34 loc) 路 1.18 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
"""
@Author: HunTon
@contact: https://x.com/huntoncrypto 馃
@info: V1.0 - 08.09.2024
"""
import logging
import asyncio
import app.core
from app.core.bot import bot, dp
from app.core.menu import set_menu
import app.core.config
import app.handlers
# Configuration de base des logs
logging.basicConfig(
level=logging.INFO, # Niveau de log
format="%(asctime)s [%(levelname)s] %(message)s", # Format du message
handlers=[
logging.FileHandler("bot.log"), # Enregistrement dans un fichier
logging.StreamHandler() # Affichage dans la console
]
)
logger = logging.getLogger(__name__)
if not app.core.config.DEBUG:
logging.getLogger('aiogram').setLevel(logging.WARNING) # Ne montre que les WARNING et plus graves
# Optionnel : d茅sactiver d'autres biblioth猫ques tierces
logging.getLogger('aiohttp').setLevel(logging.WARNING)
logging.getLogger('asyncio').setLevel(logging.ERROR)
async def main():
logger.info("Bot starting")
#await bot.send_message(app.core.config.TEACHER_GROUP_ID, "Bot Online: 馃煝")
await set_menu(bot)
await asyncio.gather(dp.start_polling(bot))
if __name__ == '__main__':
asyncio.run(main())