簡體   English   中英

discord.js 以粗體文本發送 api 響應

[英]discord.js sending the api response as a bold text

如何將 api 響應解析為粗體文本消息到 discord 頻道?

let channel = guild.channels.cache.get('ChannelID')
channel.send('Price is: ' + price.toFixed(2).bold(), { "parse_mode": "HTML" });

此代碼將返回消息Price is: <b>1.33</b>並且不會將文本解析為粗體。

您可以像發送帶有兩個 * 的普通 Discord 消息一樣發送它。 所以它看起來像

let channel = guild.channels.cache.get(`ChannelID`);
channel.send(`Price is **${price.toFixed(2)}**`);

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM