gpt4 book ai didi

python - Telegram Bot 如何在 curl 中设置解析模式?

转载 作者:太空宇宙 更新时间:2023-11-04 11:49:42 25 4
gpt4 key购买 nike

我正在为 Telegram Bot 编辑一些脚本,我只想添加解析模式 html,所以它允许我使用粗体、斜体等。

我似乎找不到采用 parse_mode: "HTML"to curl line 的方法

 if [ -n "${TOKEN}" ];
then
echo "Sending telegram...";
#Telegram notification
curl -s -X POST https://api.telegram.org/bot${TOKEN}/sendMessage -d chat_id=${CHAT_ID} -d text="${1}" >> /dev/null
fi

最佳答案

parse_mode 只是另一个参数,如 textchat_id。你可以使用-d!

curl -s -X POST https://api.telegram.org/bot${TOKEN}/sendMessage -d chat_id=${CHAT_ID} -d text="${1}" -d "parse_mode='HTML'" >> /dev/null

Documentation

关于python - Telegram Bot 如何在 curl 中设置解析模式?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56405169/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com