Files
dsabot/commands/Skill.js
TobenderZephyr 23418bbc60 Add Skillchecks for Magical Talents (#25)
* initial implementation of spells

* added return list of spells. Moved them into seperate json

* added _some_ chants, restructuring data from spells

* added more chants, added command for getting info

* added related messages, added skillcheck for spells (cast)

* better error handling, added chant command

* (fix) Chants were referring to spells

* cleanup testing variables and code

* updated README

* fixed storage location issues and minor bugs

* removed db storage location

* rc1

* (fix) chants_title

* (fix) Uncaught ReferenceError: Discord is not defined

* (fix) more reference errors

Co-authored-by: Marcus Netz <marcus.netz@godyo.com>
2021-04-28 19:33:30 +02:00

25 lines
866 B
JavaScript

const globals = require('../globals');
const db = globals.db;
const { findMessage } = require('@dsabot/findMessage');
const { getSkill } = require('@dsabot/getSkill');
module.exports = {
name: 'skill',
description: 'Zeigt dir deinen Fertigkeitswert im jeweiligen Talent.',
aliases: [],
usage: '<Fertigkeit>',
needs_args: true,
async exec(message, args) {
db.find({ user: message.author.tag }, (err, docs) => {
if (docs.length === 0) {
return message.reply(findMessage('NOENTRY'));
}
const Skill = getSkill({ Character: docs[0].character, args: args });
if (!Skill) {
return message.reply(findMessage('TALENT_UNKNOWN'));
}
return message.reply(`Du hast folgenden Wert in **${Skill.Name}**: ${Skill.Level}`);
});
},
};