如何制作不和谐的嵌入式链接

时间:2020-09-28 06:18:31

标签: javascript node.js discord discord.js

我尝试在代码中编码Clickhere,但是它不起作用,而是总是发送[Clickhere](链接)。我还尝试了嵌入消息。但它说“未定义不一致”。这是我的代码:

module.exports = {
    name: 'name',
    description: "description",
    
    execute(message, args){const today = new Date().getDay();
        switch (today) {
          case 0:
             message.channel.send (
                'message');
      
            break;
          case 1:
               botInfo= '[Click here!](https://support.discord.com/hc/en-us/community/posts/360038398572-Hyperlink-Markdown)'
             message.channel.send (
                '[Click here!](https://support.discord.com/hc/en-us/community/posts/360038398572-Hyperlink-Markdown)');
             message.channel.send(botInfo);
        

2 个答案:

答案 0 :(得分:1)

现在,超链接仅在嵌入消息中可用,仅在描述和字段值中可用。


const Discord = require("discord.js");

const Embed = new Discord.MessageEmbed();
Embed.setDescription("[Click here!](https://support.discord.com/hc/en-us/community/posts/360038398572-Hyperlink-Markdown)");
message.channel.send(Embed);

答案 1 :(得分:0)

或者您可以

const {MessageEmbed} = require("discord.js");

const Embed = new MessageEmbed()
.setDescription("[Click here!](https://support.discord.com/hc/en-us/community/posts/360038398572-Hyperlink-Markdown)");
message.channel.send(Embed);