chipmunkbot3/commands/seen.js
2024-02-11 21:23:41 -05:00

24 lines
804 B
JavaScript

const name = 'seen'
const description = 'Shows when a player was first and last seen'
const usages = []
const aliases = ['seen']
const enabled = true
const permLevel = 0
function execute (bot, cmd, player, args, handler) {
const username = args.join(' ')
if (bot.seen[username] != null) {
const { first, last } = bot.seen[username]
bot.core.run('tellraw @a ' + JSON.stringify([
{ text: '', color: bot.colors.primary },
{ text: username, color: bot.colors.secondary },
' was first seen on ',
{ text: first, color: bot.colors.secondary },
' and last seen on ',
{ text: last, color: bot.colors.secondary }
]))
} else throw new Error(username + ' was never seen')
}
module.exports = { name, description, usages, aliases, enabled, execute, permLevel }