相关疑难解决方法(0)

如何在Python中打印粗体文本?

如何在Python中打印粗体文本?

例如:

print "hello"
Run Code Online (Sandbox Code Playgroud)

我应该怎么做才能使文本"hello"以粗体显示?

python

125
推荐指数
10
解决办法
25万
查看次数

如何在 Telepot Telegram bot 中加粗文本?

我试过这个

elif command == 'bold':
    telegram_bot.sendMessage (chat_id, str("*bold*"), reply_markup=markup)
Run Code Online (Sandbox Code Playgroud)

但它是回复*bold*而不是粗体

python python-3.x telegram-bot telepot

8
推荐指数
1
解决办法
2万
查看次数

如何使用 Native API 发送 Telegram Bold 消息?

我想使用本机 Python 请求发送Telegram消息,以便在使用BOLD时收到“名字” 。我尝试过 HTML 和 Markdown 语法,但没有显示。

import json
import requests

# Telegram bot configurations
TELE_TOKEN='TOKEN'
URL = "https://api.telegram.org/bot{}/".format(TELE_TOKEN)

def send_message(text, chat_id):
    url = URL + "sendMessage?text={}&chat_id={}".format(text, chat_id)
    requests.get(url)

# AWS Lambda handler    
def lambda_handler(event, context):
    
    message = json.loads(event['body'])
    chat_id = message['message']['chat']['id']
    first_name = message['message']['chat']['first_name']
    text = message['message']['text']

    # How can the first name be in BOLD?
    reply = "Hello " + first_name + "! You have said:" + text
    
    send_message(reply, chat_id)
    

    return {
        'statusCode': 200 …
Run Code Online (Sandbox Code Playgroud)

python telegram-bot

2
推荐指数
1
解决办法
5006
查看次数

标签 统计

python ×3

telegram-bot ×2

python-3.x ×1

telepot ×1