File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -280,12 +280,18 @@ def lambda_handler(event: dict, context: Any) -> dict:
280280 'administrator' ,
281281 ):
282282 chat_id = member_update .chat .id
283- is_ok , error_msg = asyncio .run (
284- _check_forum_requirements (bot , chat_id )
285- )
286- if not is_ok :
287- asyncio .run (bot .send_message (chat_id = chat_id , text = error_msg ))
288- _send_metric ('TopicPrecheck.Failed' )
283+
284+ async def _run_topic_precheck ():
285+ is_ok , error_msg = await _check_forum_requirements (bot , chat_id )
286+ if not is_ok :
287+ await bot .send_message (chat_id = chat_id , text = error_msg )
288+ logger .warning (
289+ "Forum requirements check failed" ,
290+ extra = {'chat_id' : chat_id , 'error_msg' : error_msg },
291+ )
292+ _send_metric ('TopicPrecheck.Failed' )
293+
294+ asyncio .run (_run_topic_precheck ())
289295 return {'statusCode' : 200 }
290296
291297 message = update .message or update .edited_message
You can’t perform that action at this time.
0 commit comments