From 076ff7b96624768052aa9becbf2459e5b66340f7 Mon Sep 17 00:00:00 2001 From: ChomeNS Date: Sun, 6 Nov 2022 18:11:41 +0700 Subject: [PATCH] beautify --- commands/myuser.js | 25 ++++++++++++++++++++++- commands/uuid.js | 50 ++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 72 insertions(+), 3 deletions(-) diff --git a/commands/myuser.js b/commands/myuser.js index 40900de..fe0532b 100644 --- a/commands/myuser.js +++ b/commands/myuser.js @@ -6,6 +6,29 @@ module.exports = { usage: '', trusted: 0, execute: function(bot, username, usernameraw, sender, prefix, args) { - bot.core.run('minecraft:tellraw @a ' + JSON.stringify(['', {text: 'Your username is: ', color: 'white'}, {text: `${bot.getplayerusername[sender]}`, color: 'gold', clickEvent: {action: 'copy_to_clipboard', value: `${bot.getplayerusername[sender]}`}, hoverEvent: {action: 'show_text', contents: [{text: 'Click here to copy the username to your clipboard', color: 'green'}]}}] )); + bot.core.run('minecraft:tellraw @a ' + JSON.stringify( + [ + { + text: 'Your username is: ', + color: 'white', + }, + { + text: bot.getplayerusername[sender], + color: 'gold', + clickEvent: { + action: 'copy_to_clipboard', + value: bot.getplayerusername[sender], + }, + hoverEvent: { + action: 'show_text', + contents: [ + { + text: 'Click here to copy the username to your clipboard', + color: 'green', + }, + ], + }, + }, + ])); }, }; diff --git a/commands/uuid.js b/commands/uuid.js index 0282745..b27090a 100644 --- a/commands/uuid.js +++ b/commands/uuid.js @@ -11,9 +11,55 @@ module.exports = { const playername = args.join(' '); const player = bot.playersAddedPlayers[playername]; if (player === undefined) throw new SyntaxError('Invalid Username'); - bot.core.run('minecraft:tellraw @a ' + JSON.stringify(['', {text: `${playername}'s uuid: `, color: 'green'}, {text: `${player}`, color: 'aqua', clickEvent: {action: 'copy_to_clipboard', value: `${player}`}, hoverEvent: {action: 'show_text', contents: [{text: 'Click here to copy the uuid to your clipboard', color: 'green'}]}}])); + bot.core.run('minecraft:tellraw @a ' + JSON.stringify( + [ + { + text: `${playername}'s uuid: `, + color: 'green', + }, + { + text: player, + color: 'aqua', + clickEvent: { + action: 'copy_to_clipboard', + value: player, + }, + hoverEvent: { + action: 'show_text', + contents: [ + { + text: 'Click here to copy the uuid to your clipboard', + color: 'green', + }, + ], + }, + }, + ])); } else { - bot.core.run('minecraft:tellraw @a ' + JSON.stringify(['', {text: `Your uuid: `, color: 'green'}, {text: `${sender}`, color: 'aqua', clickEvent: {action: 'copy_to_clipboard', value: `${sender}`}, hoverEvent: {action: 'show_text', contents: [{text: 'Click here to copy the uuid to your clipboard', color: 'green'}]}}])); + bot.core.run('minecraft:tellraw @a ' + JSON.stringify( + [ + { + text: `Your uuid: `, + color: 'green', + }, + { + text: `${sender}`, + color: 'aqua', + clickEvent: { + action: 'copy_to_clipboard', + value: sender, + }, + hoverEvent: { + action: 'show_text', + contents: [ + { + text: 'Click here to copy the uuid to your clipboard', + color: 'green', + }, + ], + }, + }, + ])); } }, discordExecute: function(bot, username, usernameraw, sender, prefix, args, channeldc, message) {