Wednesday, 31 May 2017

discord.js Send message as code block?

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?



via Mad_ Questionnaire

No comments:

Post a Comment