+Commands{change name, help, read} better error catching.

This commit is contained in:
Julia Lange 2020-04-02 19:15:26 -07:00
parent 16fc473a2a
commit bd6374c1c7
6 changed files with 135 additions and 87 deletions

41
commands/read.ts Normal file
View file

@ -0,0 +1,41 @@
import { squirrel } from "../scripts/enums";
import { classText, COLOR, getPlayerData, raceText } from "../scripts/functions";
module.exports = {
name: "read",
description: "Read a description of your squirrel",
args: "",
execute(msg, args) {
const data: squirrel = getPlayerData(msg.author.id);
const squirrelEmbed: object = {
color: COLOR,
title: msg.author.username,
thumbnail: {
url: msg.author.avatarURL()
},
fields: [
{
name: 'Name',
value: data.name
},
{
name: 'Race',
value: raceText(data.race)
},
{
name: 'Class',
value: classText(data.class)
},
{
name: 'Nuts',
value: data.nuts
},
{
name: 'Level',
value: data.level
}
]
}
msg.channel.send({ embed: squirrelEmbed });
}
}