@@ -457,28 +457,36 @@ async def show_projects(update, context):
457
457
await update .message .reply_text (msg_text , link_preview_options = LinkPreviewOptions (is_disabled = True ))
458
458
459
459
msg_text = ""
460
+ PROJECT_FIELDS = [
461
+ '*{}*' ,
462
+ 'Owner: @{}' ,
463
+ 'Temática: {}' ,
464
+ 'Nivel: {}' ,
465
+ 'Repositorio: {}' ,
466
+ 'Grupo de Telegram: {}' ,
467
+ ]
460
468
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 ) ,
465
473
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)' ) ,
468
476
)
469
477
participants_count = Vote .select ().where (
470
478
(Vote .project == project ) & (Vote .interest )).count ()
471
479
if participants_count > 0 :
472
- project_text += "\n Interesades : {}" .format (participants_count )
480
+ project_text += "\n Interesades : {}" .format (participants_count )
473
481
474
482
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' )
476
484
msg_text = ""
477
485
478
486
msg_text += "\n \n " + project_text
479
487
480
488
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' )
482
490
483
491
484
492
async def show_participants (update , context ):
0 commit comments