How can I bold text in telepot Telegram bot?
You need to provide a parse_mode
Parameter (parse_mode="Markdown").
Or else you will not see any markdown style.
sendMessage(chat_id, "*this text is bold*", parse_mode= 'Markdown')
See
https://telepot.readthedocs.io/en/latest/reference.html#telepot.Bot.sendMessage
How to send bold text using Telegram Python bot
You should use:
bot.send_message(chat_id=chat_id, text="*bold* Example message",
parse_mode=telegram.ParseMode.MARKDOWN)
Or:
bot.send_message(chat_id=chat_id, text='<b>Example message</b>',
parse_mode=telegram.ParseMode.HTML)
More info at:
https://github.com/python-telegram-bot/python-telegram-bot/wiki/Code-snippets#message-formatting-bold-italic-code-
How to send bold text on telegram bot
I resolved.
bot.sendPhoto(
'@XXXXXXXXXX',
getImage(soup),
parse_mode='Markdown',
caption = '*' + getTitle(soup)+ '*' + '*' + getDealPrice(soup) + '*',
disable_notification=True
)
Thanks
mo1ein
style inline keyboard in telepot
solved!
example code:
bot.sendMessage(chat_id, 'testing custom keyboard',reply_markup = InlineKeyboardMarkup(inline_keyboard=[
[InlineKeyboardButton(text="btn1",callback_data='I have Nothing To do'), InlineKeyboardButton(text="btn2",callback_data='0'),InlineKeyboardButton(text="btn3",callback_data='0'), InlineKeyboardButton(text="btn4",callback_data='0')],
[InlineKeyboardButton(text="btn1",callback_data='yep')]
]
))
result:
keyboard result
How to send a hyperlink in bot.sendMessage()
You can use formatting option to do this.
Related Topics
How to Select Last Row and Also How to Access Pyspark Dataframe by Index
How to Bold Text in Telepot Telegram Bot
Vscode Import Error for Python Module
How to Retrieve SQL Result Column Value Using Column Name in Python
How to Download the Latest File of an S3 Bucket Using Boto3
How to Update a Label Inside While Loop in Tkinter
Creating New Dataframes in Loop in Python
How to Test If an Enum Member With a Certain Name Exists
How to Merge 2 CSV Files Together by Multiple Columns in Python
Python: Pandas Pd.Read_Excel Giving Importerror: Install Xlrd >= 0.9.0 for Excel Support
How to Get All Possible Combinations of a List'S Elements
What Does Sqlite3.Operationalerror: Near "-": Syntax Error Mean
How to Read a Date in Excel Format in Python
How to Find Duration Between Two Time Difference in Python Dataframe
How to Stop Python Script Using Command Line
How to Fix the 403:Insufficient Authentication Scopes Error from Google Analytics User Deletion API
Deleting Rows from CSV Based on Cell Contents from Another Csv