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 = {}) => {
|
||||
|
Reference in New Issue
Block a user