toxicity-detector
This commit is contained in:
@@ -27,10 +27,9 @@ async def show_announce(msg):
|
||||
newcomer_message = get_newcomer_message(msg)
|
||||
|
||||
userphotos_response = await telegram_api("getUserphotos", user_id=from_id)
|
||||
logger.debug(userphotos_response)
|
||||
|
||||
file_id = ""
|
||||
if userphotos_response["ok"] and userphotos_response["result"]["total_count"] > 0:
|
||||
if isinstance(userphotos_response, dict) and userphotos_response["ok"] and userphotos_response["result"]["total_count"] > 0:
|
||||
logger.info("showing button with photo")
|
||||
file_id = userphotos_response["result"]["photos"][0][0]["file_id"]
|
||||
|
||||
|
Reference in New Issue
Block a user