0

Could someone help me add such a thing so that when someone executes this command, it will send to another Discord server on a specific channel, Embed which is already in the code log_embed it's almost at the end of the code

Node: 14.16.0 Discord.js: 12.5.3

const { MessageEmbed } = require("discord.js");
const { LOCALE } = require("../util/EvobotUtil");
const i18n = require("i18n");
i18n.setLocale(LOCALE);

module.exports = {
  name: "help",
  aliases: ["h"],
  description: i18n.__("help.description"),
  execute(message) {
    let commands = message.client.commands.array();

    let helpEmbed = new MessageEmbed()
      .setTitle(i18n.__mf("help.embedTitle", { botname: message.client.user.username }))
      .setDescription(i18n.__("help.embedDescription"))
      .setColor("#F8AA2A");

    commands.forEach((cmd) => {
      helpEmbed.addField(
        `**${message.client.prefix}${cmd.name} ${cmd.aliases ? `(${cmd.aliases})` : ""}**`,
        `${cmd.description}`,
        true
      );
    });

    helpEmbed.setTimestamp();
    return message.channel.send(helpEmbed).catch(console.error);
    
    const log_embed = new Discord.MessageEmbed()
    .setTitle(`LOG`)
    .setColor('36393F')
    .setDescription(`1`)
    .setTimestamp()
    .setFooter('####')
    
  }
};
LuisBoon
  • 1
  • 1
  • 1
    Does this answer your question? [Discord.js sending a message to a specific channel](https://stackoverflow.com/questions/52258064/discord-js-sending-a-message-to-a-specific-channel) – theusaf Jun 02 '21 at 22:10
  • No, because I need the bot to send a message to another server and a specific channel there – LuisBoon Jun 02 '21 at 22:15
  • I believe that is exactly what the answers to that question do. Each channel has a unique id, and to get a specific channel, no matter what server it is in, you can do `message.client.channels.cache.get('').send(log_embed);` – theusaf Jun 02 '21 at 22:19
  • It actually works, thought I still need an ID server, thanks so much for the answer – LuisBoon Jun 02 '21 at 22:24
  • You can get the id of a server same way you can get the id of a channel, easiest way being enabling "Developer Mode" in Advanced setting and then right click on the server (aka guild) – Ant Jun 02 '21 at 22:46

0 Answers0