From 9badb543de456a69375114275d3659ce00a7ac77 Mon Sep 17 00:00:00 2001 From: ChomeNS Date: Fri, 28 Oct 2022 16:21:57 +0700 Subject: [PATCH] hoverEvent discord mc message --- index.js | 38 ++++++++++++++++++++++++++++---------- 1 file changed, 28 insertions(+), 10 deletions(-) diff --git a/index.js b/index.js index 8779fc0..62219ac 100644 --- a/index.js +++ b/index.js @@ -407,17 +407,35 @@ dcclient.on('messageCreate', async (message) => { } const component = [ {text: '[', color: 'dark_gray'}, - {text: 'ChomeNS ', color: 'yellow', clickEvent: { - action: 'open_url', - value: 'https://discord.gg/xdgCkUyaA4', - }}, - {text: 'Discord', color: 'blue', clickEvent: { - action: 'open_url', value: 'https://discord.gg/xdgCkUyaA4', - }}, + {text: 'ChomeNS ', color: 'yellow', + clickEvent: { + action: 'open_url', + value: 'https://discord.gg/xdgCkUyaA4', + }, + }, + {text: 'Discord', color: 'blue', + clickEvent: { + action: 'open_url', + value: 'https://discord.gg/xdgCkUyaA4', + }, + }, {text: '] ', color: 'dark_gray'}, - {text: `${message.member.displayName}`, color: 'red', clickEvent: { - action: 'copy_to_clipboard', value: `${message.author.username}#${message.author.discriminator}`, - }}, + {text: `${message.member.displayName}`, color: 'red', + clickEvent: { + action: 'copy_to_clipboard', + value: `${message.author.username}#${message.author.discriminator}`, + }, + hoverEvent: { + action: 'show_text', + value: [ + {text: message.author.username, color: 'white'}, + {text: '#', color: 'dark_gray'}, + {text: message.author.discriminator, color: 'gray'}, + '\n', + {text: 'Click here to copy the tag to your clipboard', color: 'green'}, + ], + }, + }, {text: ' › ', color: 'dark_gray'}, chatMessage.MessageBuilder.fromString('&7' + message.content), attachmentsComponent.length === 0 ? '' : attachmentsComponent,