COdeingNinja
COdeingNinja

Reputation: 385

How to make a custom url show in discord js bot embed messages?

I am using v12.6 of discord js. I am trying to make a embed message which will look something like this .

Position

Game Developer Location

Chennai, Tamil Nadu, India

Apply Now

The problem is that when I am using setURL(applylink) it is making the url hyperlink on setTitle of the embed. I wish to make a seperate tag which looks like above. This is my code

 const embed = new MessageEmbed()
            .setColor('#ffdf00')
            .setTitle( companyName)
            .addFields(
                { name: 'Position', value: jobTitle ,inline:true},
                { name: 'Location', value: location+'\n'},
                { name: 'Experience', value: experienceLevel, inline: true },              
                { name: 'Salary Range', value: CTCRange, inline: true },
               
            )
            .addFields({name: 'Qualifications',value: qualificationRequired+'\n'})
            .setURL(linktoApply)

            const channel = client.channels.cache.get(channelID);
            channel.send(embed); 

here companyName and other tags in value are variables.

Upvotes: 0

Views: 505

Answers (1)

Palm
Palm

Reputation: 709

Use the hyperlink syntax for bots. (this does not work on normal messages, it only works for embeds)

const embed = new MessageEmbed()
    .addField('Title', 'Description, [Hyperlink](https://example.com)')

Upvotes: 1

Related Questions