InNovAqua
InNovAqua

Reputation: 43

Discord.JS Replying into Embed

I am trying to make when they write in a specific channel, it deletes their comment, and the bot will take this and reply inside the embed, but I am very struggling.

client.on("message", message => {

  const args = message.content.slice(prefix.length).split(/ +/);
  const command = args.shift().toLowerCase();

  if (message.channel.id == `635991288971326568`) {
    if (message.author.bot) return;
    message.delete();
    //message.channel.send(`**${message.author}**`);

    const newEmbed = new Discord.MessageEmbed()
      .setColor("#ff0000")
      .setTitle("Αποθήκη ΕΚΑΒ")
      .setURL("")
      .setDescription(`**Doctor:** ${message.author}\n**Current Date:** ${new Date().toLocaleString()}\n**Removed:** ${(message.reply())}`)
      .setThumbnail("")
      .setImage("")
      .setFooter("Created and Developed by InNovAqua#0666 ❤️");

    message.channel.send(newEmbed);

    message.channel.send(message.content);
  }
});

Upvotes: 1

Views: 246

Answers (1)

Brayden
Brayden

Reputation: 60

This will remove the message a user sends in a channel that you have chosen and send it in the embed:

client.on("message", message => {
  
    const args = message.content.slice(prefix.length).split(/ +/);
    const command = args.shift().toLowerCase();
    const messagesent = message.content
  
    if(message.channel.id == `808453136817324084`){
    if(message.author.bot)return;
  message.delete();
  //message.channel.send(`**${message.author}**`);
  
  const newEmbed = new Discord.MessageEmbed()
          .setColor("#ff0000")
          .setTitle("Αποθήκη ΕΚΑΒ")
          .setURL("")
          .setDescription(`**Doctor:** ${message.author}\n**Current Date:** ${new Date().toLocaleString()}\n**Removed:** ${(messagesent)}`)
          .setThumbnail("")
          .setImage("")
          .setFooter("Created and Developed by InNovAqua#0666 ❤️");
          
          message.channel.send(newEmbed);
  }
  });

If you want you can make the bot also send the message with out having it in the embed you can do that with:

client.on("message", message => {
  
    const args = message.content.slice(prefix.length).split(/ +/);
    const command = args.shift().toLowerCase();
    const messagesent = message.content
  
    if(message.channel.id == `808453136817324084`){
    if(message.author.bot)return;
  message.delete();
  //message.channel.send(`**${message.author}**`);
  
  const newEmbed = new Discord.MessageEmbed()
          .setColor("#ff0000")
          .setTitle("Αποθήκη ΕΚΑΒ")
          .setURL("")
          .setDescription(`**Doctor:** ${message.author}\n**Current Date:** ${new Date().toLocaleString()}\n**Removed:** ${(messagesent)}`)
          .setThumbnail("")
          .setImage("")
          .setFooter("Created and Developed by InNovAqua#0666 ❤️");
          
          message.channel.send(newEmbed);
  
  message.channel.send(message.content);
  }
  });

This here I have it set up to send the message in the embed and as a regular message.

Upvotes: 1

Related Questions