From 16016776c992c92f19102dcec2ea257041817e66 Mon Sep 17 00:00:00 2001 From: Arcensoth Date: Fri, 23 Feb 2018 15:49:26 -0500 Subject: Change the in-game message format --- index.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'index.js') 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) { -- cgit 1.4.1