fixed storage location issues and minor bugs
This commit is contained in:
@ -11,7 +11,6 @@ module.exports = {
|
||||
needs_args: false,
|
||||
|
||||
async exec(message, args) {
|
||||
console.log(message.author.tag);
|
||||
db.find({ user: message.author.tag }, (err, docs) => {
|
||||
if (docs.length === 0) {
|
||||
return message.reply(findMessage('NOENTRY'));
|
||||
@ -19,7 +18,7 @@ module.exports = {
|
||||
Character = docs[0].character;
|
||||
if (!Character.hasOwnProperty('chants')) return message.reply(findMessage('NO_CHANTS'));
|
||||
if (args.length === 0) {
|
||||
return message.reply(ReplyChantList(createChantList(Character))); //?+
|
||||
return message.reply(ReplyChantList(createChantList(Character)));
|
||||
}
|
||||
const Chant = getChant({
|
||||
Character: Character,
|
||||
@ -38,17 +37,13 @@ const createChantList = (Character = {}) => {
|
||||
let ChantList = [];
|
||||
|
||||
// todo: send 'chant' to getChant() so we can filter out blessings.
|
||||
Character.chants.forEach(chant =>
|
||||
ChantList.push(getChant({ Character: Character, chant_name: chant.id }))
|
||||
);
|
||||
return ChantList.filter(value => value !== undefined); //?+
|
||||
Character.chants.forEach(chant => ChantList.push(getChant({ Character: Character, chant_name: chant.id })));
|
||||
return ChantList.filter(value => value !== undefined);
|
||||
};
|
||||
|
||||
const ReplyChantList = (ChantList = []) => {
|
||||
if (!ChantList) return;
|
||||
return `${ChantList.map(chant => `${chant.Name} ${chant.Level ? `(${chant.Level})` : ''}`).join(
|
||||
'\n'
|
||||
)}`;
|
||||
return `${ChantList.map(chant => `${chant.Name} ${chant.Level ? `(${chant.Level})` : ''}`).join('\n')}`;
|
||||
};
|
||||
|
||||
const ReplyChant = (Chant = {}) => {
|
||||
|
@ -8,7 +8,7 @@ module.exports = {
|
||||
description: 'Zeigt dir deinen Fertigkeitswert im jeweiligen Magietalent.',
|
||||
aliases: ['spell', 'zauber'],
|
||||
usage: '<Zauber>',
|
||||
needs_args: true,
|
||||
needs_args: false,
|
||||
|
||||
async exec(message, args) {
|
||||
db.find({ user: message.author.tag }, (err, docs) => {
|
||||
@ -46,8 +46,6 @@ const ReplySpell = (Spell = {}) => {
|
||||
const createSpellList = (Character = {}) => {
|
||||
if (!Character || !Character.hasOwnProperty('spells')) return;
|
||||
let SpellList = [];
|
||||
Character.spells.forEach(spell =>
|
||||
SpellList.push(getSpell({ Character: Character, spell_name: spell.id }))
|
||||
);
|
||||
Character.spells.forEach(spell => SpellList.push(getSpell({ Character: Character, spell_name: spell.id })));
|
||||
return SpellList.filter(value => value !== undefined); //?+
|
||||
};
|
||||
|
Reference in New Issue
Block a user