1
0
mirror of https://github.com/eternnoir/pyTelegramBotAPI.git synced 2023-08-10 21:12:57 +03:00

Set escape=True by default.

This commit is contained in:
coder2020official
2022-05-14 20:32:28 +05:00
parent 03a567ea93
commit 42efb8488c
3 changed files with 39 additions and 39 deletions

View File

@ -10,11 +10,11 @@ async def start_message(message):
message.chat.id,
# function which connects all strings
formatting.format_text(
formatting.mbold(message.from_user.first_name, escape=True), # pass escape=True to escape special characters
formatting.mitalic(message.from_user.first_name, escape=True),
formatting.munderline(message.from_user.first_name, escape=True),
formatting.mstrikethrough(message.from_user.first_name, escape=True),
formatting.mcode(message.from_user.first_name, escape=True),
formatting.mbold(message.from_user.first_name),
formatting.mitalic(message.from_user.first_name),
formatting.munderline(message.from_user.first_name),
formatting.mstrikethrough(message.from_user.first_name),
formatting.mcode(message.from_user.first_name),
separator=" " # separator separates all strings
),
parse_mode='MarkdownV2'
@ -23,7 +23,7 @@ async def start_message(message):
# just a bold text using markdownv2
await bot.send_message(
message.chat.id,
formatting.mbold(message.from_user.first_name, escape=True),
formatting.mbold(message.from_user.first_name),
parse_mode='MarkdownV2'
)
@ -31,11 +31,11 @@ async def start_message(message):
await bot.send_message(
message.chat.id,
formatting.format_text(
formatting.hbold(message.from_user.first_name, escape=True),
formatting.hitalic(message.from_user.first_name, escape=True),
formatting.hunderline(message.from_user.first_name, escape=True),
formatting.hstrikethrough(message.from_user.first_name, escape=True),
formatting.hcode(message.from_user.first_name, escape=True),
formatting.hbold(message.from_user.first_name),
formatting.hitalic(message.from_user.first_name),
formatting.hunderline(message.from_user.first_name),
formatting.hstrikethrough(message.from_user.first_name),
formatting.hcode(message.from_user.first_name),
separator=" "
),
parse_mode='HTML'
@ -44,7 +44,7 @@ async def start_message(message):
# just a bold text in html
await bot.send_message(
message.chat.id,
formatting.hbold(message.from_user.first_name, escape=True),
formatting.hbold(message.from_user.first_name),
parse_mode='HTML'
)

View File

@ -10,11 +10,11 @@ def start_message(message):
message.chat.id,
# function which connects all strings
formatting.format_text(
formatting.mbold(message.from_user.first_name, escape=True), # pass escape=True to escape special characters
formatting.mitalic(message.from_user.first_name, escape=True),
formatting.munderline(message.from_user.first_name, escape=True),
formatting.mstrikethrough(message.from_user.first_name, escape=True),
formatting.mcode(message.from_user.first_name, escape=True),
formatting.mbold(message.from_user.first_name),
formatting.mitalic(message.from_user.first_name),
formatting.munderline(message.from_user.first_name),
formatting.mstrikethrough(message.from_user.first_name),
formatting.mcode(message.from_user.first_name),
separator=" " # separator separates all strings
),
parse_mode='MarkdownV2'
@ -23,7 +23,7 @@ def start_message(message):
# just a bold text using markdownv2
bot.send_message(
message.chat.id,
formatting.mbold(message.from_user.first_name, escape=True),
formatting.mbold(message.from_user.first_name),
parse_mode='MarkdownV2'
)
@ -31,11 +31,11 @@ def start_message(message):
bot.send_message(
message.chat.id,
formatting.format_text(
formatting.hbold(message.from_user.first_name, escape=True),
formatting.hitalic(message.from_user.first_name, escape=True),
formatting.hunderline(message.from_user.first_name, escape=True),
formatting.hstrikethrough(message.from_user.first_name, escape=True),
formatting.hcode(message.from_user.first_name, escape=True),
formatting.hbold(message.from_user.first_name),
formatting.hitalic(message.from_user.first_name),
formatting.hunderline(message.from_user.first_name),
formatting.hstrikethrough(message.from_user.first_name),
formatting.hcode(message.from_user.first_name),
separator=" "
),
parse_mode='HTML'
@ -44,7 +44,7 @@ def start_message(message):
# just a bold text in html
bot.send_message(
message.chat.id,
formatting.hbold(message.from_user.first_name, escape=True),
formatting.hbold(message.from_user.first_name),
parse_mode='HTML'
)