I'm trying to make a bot that will send a message to my channel, but in a code block because using RichEmbed doesn't work.
I looked some other bots and they send messages like this
```
Their title
Body text blah blah
```
I want to send something similar, however when I tried
var msg = ```
Their Title
Body text blah blah
```;
and
var msg = "```
Their Title
Body text blah blah
```";
These don't work.
const Discord = require("discord.js");
const bot = new Discord.Client();
const TOKEN = "MY_TOKEN_ID";
bot.on("message", function(message) {
console.log(message.content);
if ( message.author.equals(bot.user))
return;
message.channel.send(msg);
});
bot.login(TOKEN);
My code is above, any ideas how to send code blocks?
Have you tried using this?
var msg = "```Their Title\nBody text blah blah```";
\n is a new line, it's basically pressing ENTER when writing. You can send it as normal text message afterward.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With