@@ -457,28 +457,36 @@ async def show_projects(update, context):
457457 await update .message .reply_text (msg_text , link_preview_options = LinkPreviewOptions (is_disabled = True ))
458458
459459 msg_text = ""
460+ PROJECT_FIELDS = [
461+ '*{}*' ,
462+ 'Owner: @{}' ,
463+ 'Temática: {}' ,
464+ 'Nivel: {}' ,
465+ 'Repositorio: {}' ,
466+ 'Grupo de Telegram: {}' ,
467+ ]
460468 for project in projects :
461- project_text = "{} \n Owner: @{} \n Temática: {} \n Nivel: {} \n Repositorio: {} \n Grupo de Telegram: {}" .format (
462- project .name ,
463- project .owner .username ,
464- project .topic ,
469+ project_text = ' \n ' . join ( PROJECT_FIELDS ) .format (
470+ escape_markdown ( project .name ) ,
471+ escape_markdown ( project .owner .username ) ,
472+ escape_markdown ( project .topic ) ,
465473 DIFFICULTY_LEVEL_NAMES [project .difficult_level ],
466- project .repository_url or '(ninguno)' ,
467- project .group_url or '(ninguno)' ,
474+ escape_markdown ( project .repository_url or '(ninguno)' ) ,
475+ escape_markdown ( project .group_url or '(ninguno)' ) ,
468476 )
469477 participants_count = Vote .select ().where (
470478 (Vote .project == project ) & (Vote .interest )).count ()
471479 if participants_count > 0 :
472- project_text += "\n Interesades : {}" .format (participants_count )
480+ project_text += "\n Interesades : {}" .format (participants_count )
473481
474482 if len (msg_text ) + len (project_text ) > 4096 :
475- await update .message .reply_text (msg_text , link_preview_options = LinkPreviewOptions (is_disabled = True ))
483+ await update .message .reply_text (msg_text , link_preview_options = LinkPreviewOptions (is_disabled = True ), parse_mode = 'MarkdownV2' )
476484 msg_text = ""
477485
478486 msg_text += "\n \n " + project_text
479487
480488 if msg_text :
481- await update .message .reply_text (msg_text , link_preview_options = LinkPreviewOptions (is_disabled = True ))
489+ await update .message .reply_text (msg_text , link_preview_options = LinkPreviewOptions (is_disabled = True ), parse_mode = 'MarkdownV2' )
482490
483491
484492async def show_participants (update , context ):
0 commit comments