Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

248
Views
Connect to game server using Discord Embed

I am trying to send a message to a channel when a client executes a specific slash command. The command should send a embed that will contain a field. I want to make that field "clickable" so that people can join.

I want them to join a steam game server (CS:GO) that uses the protocol steam://connect/ip:port/password to connect.

I tried the following to send the message:

const { SlashCommandBuilder } = require('@discordjs/builders');
const { MessageEmbed } = require('discord.js');

module.exports = {
    data: new SlashCommandBuilder()
        .setName('stackoverflow')
        .setDescription('Question to stackoverflow'),

    async execute(interaction) {
        const embed = new MessageEmbed()
            .setColor('#ff0000')
            .setTitle('test')
            .setAuthor({ 
                name: 'Test'
            })
            .setDescription('Testing')
            .addField('Click below to join the server', '[Click here](steam://node1.spirtshop.cf:6002/TestesNexus!2022)')
            .addFields(
                { name: '\u200b', value: '[Join the server](steam://node1.spirtshop.cf:6002/TestesNexus!2022)'},
                { name: 'Connect through the console', value: 'connect node1.spirtshop.cf:6002; password TestesNexus!2022'}
            )
            .setTimestamp()
            .setFooter({
                 text: 'Just testing'
            });
        await interaction.reply({embeds: [embed]});
    },
};

Unfortunately, this doesn't work: (output) -> https://i.imgur.com/D4xCCVm.png

I've found some bots written in python, however, I couldn't take that into NodeJS. In my interpretation Discord just recognizes as a "clickable link" if I send it as the protocol(?).

The expected result is something like this: https://i.imgur.com/efAENqq.png

From that screen shot, I just want to replace the steam://.... with some text.

Any idea of how I can make this?

(using nodejs v17.4.0, discordjs v13.6.0)

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!