問題描述
今天我對超鏈接以及如何使用它們進行了大量研究.但是我發現的所有東西都不起作用,因為它們可能已經過時了……
Today I did a lot of research on hyperlinks and how to use them. But everything I found didn't work as they were probably outdated…
我的 Discord.js 機器人如何發送帶有超鏈接的消息?我知道我可以使用 .setTitle("Titel")
和 .setURL("https://...")
在嵌入中創建鏈接標題,但是我怎樣才能在嵌入的其他地方像在字段中一樣使用這些超鏈接?
How can my Discord.js bot send a message with a hyperlink? I know I can use .setTitle("Titel")
and .setURL("https://...")
to make a link in the embed title, but how can I use these hyperlinks elsewhere in the embed like in a field?
另外,普通用戶可以在公會頻道創建超鏈接嗎?
Also, it is possible to create a hyperlink just in a guild channel as a normal user?
有人可以幫助我提供超鏈接,或者提供有用的但不過時的文檔嗎?
Can someone help me in general with hyperlinks, or provide useful documentation which is not outdated?
推薦答案
Jakye 是對的.只有機器人才能做到這一點(但不是在字段標題中,請注意).只需執行 [link text here](url here)
.
Jakye is right. Only bots can achieve this (but not in field titles, beware). Just do [link text here](url here)
.
"Track cases globally, or in a country, by supplying 2-letter [country codes](https://countrycode.org/)."
這個嵌入描述導致:
這在嵌入.單擊它會將您定向到 countrycode.org.使用 .addField()
:
this in the embed. Clicking on it directs you to countrycode.org.
Using .addField()
:
yourEmbed.addField("Title here, no hyperlinks allowed", "Main text here, so you can put a hyperlink here [like so.](https://example.com)");
如果你想讓一個機器人的消息只是一個超鏈接,你需要做一個嵌入,并且只設置描述,超鏈接如上圖.(當然也可以設置嵌入顏色)
If you want a bot's message to just be a hyperlink, you need to make an embed, and only set the description, hyperlinking as shown above. (you can set the embed color if you want too of course)
這篇關于Discord 機器人如何在嵌入或一般情況下在 Discord 消息中創建超鏈接?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!