2022-12-24 00:59:52 -05:00
|
|
|
const { EmbedBuilder } = require('discord.js')
|
2022-08-14 05:51:45 -04:00
|
|
|
module.exports = {
|
|
|
|
name: 'uuid',
|
|
|
|
alias: [],
|
|
|
|
description: 'Gets the UUID of a player. If no player specified it will show your UUID instead',
|
2022-12-17 01:31:29 -05:00
|
|
|
usage: '[player (required on Discord)]',
|
2022-08-14 05:51:45 -04:00
|
|
|
trusted: 0,
|
2022-12-14 08:51:30 -05:00
|
|
|
execute (bot, username, sender, prefix, args, config, hash, ownerhash, selector) {
|
2022-10-14 04:46:41 -04:00
|
|
|
if (args[0]) {
|
2022-11-27 02:35:28 -05:00
|
|
|
const playername = args.join(' ')
|
2022-12-17 01:31:29 -05:00
|
|
|
const player = bot.players.list.find((user) => user.name === playername)
|
|
|
|
if (!player) throw new SyntaxError('Invalid username')
|
|
|
|
const playerUUID = player.UUID
|
2022-11-16 06:41:30 -05:00
|
|
|
bot.tellraw(selector,
|
2022-11-27 02:35:28 -05:00
|
|
|
[
|
|
|
|
{
|
|
|
|
text: `${playername}'s UUID: `,
|
|
|
|
color: 'green'
|
|
|
|
},
|
|
|
|
{
|
2022-12-17 01:31:29 -05:00
|
|
|
text: playerUUID,
|
2022-11-27 02:35:28 -05:00
|
|
|
color: 'aqua',
|
|
|
|
clickEvent: {
|
|
|
|
action: 'copy_to_clipboard',
|
2022-12-17 01:31:29 -05:00
|
|
|
value: playerUUID
|
2022-11-06 06:11:41 -05:00
|
|
|
},
|
2022-11-27 02:35:28 -05:00
|
|
|
hoverEvent: {
|
|
|
|
action: 'show_text',
|
|
|
|
contents: [
|
|
|
|
{
|
|
|
|
text: 'Click here to copy the UUID to your clipboard',
|
|
|
|
color: 'green'
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
])
|
2022-08-14 05:51:45 -04:00
|
|
|
} else {
|
2022-11-16 06:41:30 -05:00
|
|
|
bot.tellraw(selector,
|
2022-11-27 02:35:28 -05:00
|
|
|
[
|
|
|
|
{
|
|
|
|
text: 'Your UUID: ',
|
|
|
|
color: 'green'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
text: sender,
|
|
|
|
color: 'aqua',
|
|
|
|
clickEvent: {
|
|
|
|
action: 'copy_to_clipboard',
|
|
|
|
value: sender
|
2022-11-06 06:11:41 -05:00
|
|
|
},
|
2022-11-27 02:35:28 -05:00
|
|
|
hoverEvent: {
|
|
|
|
action: 'show_text',
|
|
|
|
contents: [
|
|
|
|
{
|
|
|
|
text: 'Click here to copy the uuid to your clipboard',
|
|
|
|
color: 'green'
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
])
|
2022-08-14 05:51:45 -04:00
|
|
|
}
|
|
|
|
},
|
2022-12-17 01:31:29 -05:00
|
|
|
discordExecute (bot, username, sender, prefix, args, channeldc, message, config) {
|
2022-10-14 04:46:41 -04:00
|
|
|
if (args[0]) {
|
2022-11-27 02:35:28 -05:00
|
|
|
const playername = args.join(' ')
|
2022-12-17 01:31:29 -05:00
|
|
|
const player = bot.players.list.find((user) => user.name === playername)
|
|
|
|
if (!player) throw new SyntaxError('Invalid username')
|
|
|
|
const playerUUID = player.UUID
|
2022-12-24 00:59:52 -05:00
|
|
|
const Embed = new EmbedBuilder()
|
2022-12-01 05:15:30 -05:00
|
|
|
.setColor(config.discord.embedsColors.normal)
|
2022-11-27 02:35:28 -05:00
|
|
|
.setTitle('UUID')
|
2022-12-17 01:31:29 -05:00
|
|
|
.setDescription(`${playername}'s UUID: ${playerUUID}`)
|
2022-11-27 02:35:28 -05:00
|
|
|
channeldc.send({ embeds: [Embed] })
|
2022-10-14 04:46:41 -04:00
|
|
|
} else {
|
2022-12-24 00:59:52 -05:00
|
|
|
const Embed = new EmbedBuilder()
|
2022-12-01 05:15:30 -05:00
|
|
|
.setColor(config.discord.embedsColors.error)
|
2022-11-27 02:35:28 -05:00
|
|
|
.setTitle('Error')
|
2022-12-17 01:31:29 -05:00
|
|
|
.setDescription('No player name specified')
|
2022-11-27 02:35:28 -05:00
|
|
|
channeldc.send({ embeds: [Embed] })
|
2022-10-14 04:46:41 -04:00
|
|
|
}
|
2022-11-27 02:35:28 -05:00
|
|
|
}
|
|
|
|
}
|