merge dev branch (more tests) (#47)
* more tests and bugfixes on spells * linting
This commit is contained in:
@ -88,16 +88,16 @@ module.exports = {
|
||||
}
|
||||
const Characters = []; //?+
|
||||
Promise.all(
|
||||
args.map(arg => {
|
||||
return findUser(arg).then(user => {
|
||||
args
|
||||
.map(arg => findUser(arg))
|
||||
.then(user => {
|
||||
if (!isEmpty(user)) {
|
||||
Characters.push({
|
||||
Name: user.character.name,
|
||||
Attributes: getStats(user),
|
||||
});
|
||||
}
|
||||
});
|
||||
})
|
||||
})
|
||||
).then(() => returnResult(message, Characters));
|
||||
return null;
|
||||
},
|
||||
|
@ -20,8 +20,8 @@ module.exports = {
|
||||
const result = roll(numberOfDice, diceValues, message.author.tag);
|
||||
const total = Bonus ? Bonus + result.sum : result.sum;
|
||||
message.reply(
|
||||
`${findMessage('ROLL')} ${result.dice.join(', ')} ` +
|
||||
`(Gesamt: ${result.sum}${Bonus ? `+${Bonus}=${total}` : ``})`
|
||||
`${findMessage('ROLL')} \` ${result.dice.join(' `, ` ')} \`` +
|
||||
` (Gesamt: ${result.sum}${Bonus ? `+${Bonus}=${total}` : ``})`
|
||||
);
|
||||
}
|
||||
},
|
||||
|
@ -2,14 +2,15 @@ const Discord = require('discord.js');
|
||||
const { findMessage } = require('@dsabot/findMessage');
|
||||
const { getSpell } = require('@dsabot/getSpell');
|
||||
const { db } = require('../globals');
|
||||
const { isEmpty } = require('@dsabot/isEmpty');
|
||||
|
||||
const ReplySpellList = (SpellList = []) => {
|
||||
if (!SpellList) return findMessage('NO_SPELLS');
|
||||
if (isEmpty(SpellList)) return findMessage('NO_SPELLS');
|
||||
return `${SpellList.map(s => `${s.Name} (${s.Level})`).join('\n')}`;
|
||||
};
|
||||
|
||||
const ReplySpell = (Spell = {}) => {
|
||||
if (!Spell) return null;
|
||||
if (isEmpty(Spell)) return null;
|
||||
return `Deine Werte für ${Spell.Name} (${Spell.Level}) sind:
|
||||
|
||||
${Spell.Attributes.map(attribute => `${attribute.Name}: ${attribute.Level}`).join(' ')}
|
||||
|
Reference in New Issue
Block a user