File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import asyncio
22import os
33import logging
4+ import traceback
45from telegram .ext import Application
6+ from tg_ids import ROZEN_CHATID
57from bot_logic import _update_groups , felizdia , actualizarRiver
68
79def main ():
@@ -14,9 +16,28 @@ def main():
1416 application = Application .builder ().token (os .environ ["TELEGRAM_BOT_TOKEN" ]).build ()
1517
1618 async def run_update ():
17- await _update_groups (application )
18- await felizdia (application )
19- await actualizarRiver (application )
19+ try :
20+ await application .bot .send_message (chat_id = ROZEN_CHATID , text = "Arrancando cron job..." )
21+ except Exception :
22+ pass
23+
24+ try :
25+ await felizdia (application )
26+ except Exception as e :
27+ error_msg = f"Error en felizdia:\n { traceback .format_exc ()} "
28+ await application .bot .send_message (chat_id = ROZEN_CHATID , text = error_msg [:4000 ])
29+
30+ try :
31+ await actualizarRiver (application )
32+ except Exception as e :
33+ error_msg = f"Error en actualizarRiver:\n { traceback .format_exc ()} "
34+ await application .bot .send_message (chat_id = ROZEN_CHATID , text = error_msg [:4000 ])
35+
36+ try :
37+ await _update_groups (application )
38+ except Exception as e :
39+ error_msg = f"Error en update_groups:\n { traceback .format_exc ()} "
40+ await application .bot .send_message (chat_id = ROZEN_CHATID , text = error_msg [:4000 ])
2041
2142 asyncio .run (run_update ())
2243
You can’t perform that action at this time.
0 commit comments