简体   繁体   English

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

[英]How can I make a discord embeded link

I tried coding a Clickhere in my code but it doesn't work and instead it always sends [Clickhere] (link).我尝试在我的代码中编写 Clickhere,但它不起作用,而是总是发送 [Clickhere](链接)。 I also tried the message embed.我也试过消息嵌入。 but it says that "discord is not defined".但它说“不和谐没有定义”。 Here's my code:这是我的代码:

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);
        

Right now, hyperlinks are only available in embed messages, only in description and field values.目前,超链接仅在嵌入消息中可用,仅在描述和字段值中可用。


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);

or you can do或者你可以做

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);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM