diff options
author | Arcensoth <arcensoth@gmail.com> | 2018-02-23 15:49:26 -0500 |
---|---|---|
committer | Arcensoth <arcensoth@gmail.com> | 2018-02-23 15:49:26 -0500 |
commit | 16016776c992c92f19102dcec2ea257041817e66 (patch) | |
tree | d80d1efbe72f180cba9ddc66f7fd0923b591e0bf | |
parent | Merge pull request #21 from destruc7i0n/remove-ci (diff) | |
download | shulker-16016776c992c92f19102dcec2ea257041817e66.tar.gz shulker-16016776c992c92f19102dcec2ea257041817e66.zip |
Change the in-game message format
-rw-r--r-- | index.js | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/index.js b/index.js index 2c21524..9f22887 100644 --- a/index.js +++ b/index.js @@ -48,9 +48,10 @@ shulker.on("ready", function() { shulker.on("message", function(message) { if (message.channel.id === shulker.channels.get(c.DISCORD_CHANNEL_ID).id) { if (message.author.id !== shulker.user.id) { - var data = { - text: "<" + message.author.username + "> " + message.cleanContent - }; + var data = [ + {color: "gray", text: "[" + message.author.username + "#" + message.author.discriminator + "] "}, + {color: "white", text: message.cleanContent} + ]; var client = new Rcon(c.MINECRAFT_SERVER_RCON_IP, c.MINECRAFT_SERVER_RCON_PORT); // create rcon client client.auth(c.MINECRAFT_SERVER_RCON_PASSWORD, function(err){ // only authenticate when needed client.command('tellraw @a ["",' + JSON.stringify(data) + ']', function(err, resp) { |