diff --git a/.gitignore b/.gitignore index b5e58d8..11fc459 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,6 @@ node_modules .eslintrc.js .eslintrc.json .vscode +data/dsabot.db +data/data diff --git a/__tests__/functions/CountOccurences.js b/__tests__/functions/CountOccurences.js new file mode 100644 index 0000000..80dcf7d --- /dev/null +++ b/__tests__/functions/CountOccurences.js @@ -0,0 +1,4 @@ +const CountOccurrences = require('@dsabot/CountOccurences'); +test('Counting Occurences', () => { + expect(CountOccurrences([1, 2, 3, 4, 1],1)).toBe(2); + }); \ No newline at end of file diff --git a/__tests__/functions/Roll.js b/__tests__/functions/Roll.js new file mode 100644 index 0000000..350dd6d --- /dev/null +++ b/__tests__/functions/Roll.js @@ -0,0 +1,10 @@ +const Roll = require('@dsabot/Roll'); + +describe('Beware of a misunderstanding! A sequence of dice rolls', () => { + const expected = [1,2,3,4,5,6]; + it('matches even with an unexpected number 7', () => { + expect(Roll(1,6)).not.toEqual( + expect.arrayContaining(expected), + ); + }); +}); \ No newline at end of file diff --git a/commands/Attack.js b/commands/Attack.js index 72fff61..3ce6102 100644 --- a/commands/Attack.js +++ b/commands/Attack.js @@ -1,6 +1,8 @@ const globals = require('../globals'); const db = globals.db; const Random = require('random'); +//const { roll } = require('@dsabot/Roll'); +const { findMessage }= require('@dsabot/findMessage'); module.exports = { name: 'attack', @@ -15,7 +17,7 @@ module.exports = { user: message.author.tag, }, function(err, docs) { if (docs.length === 0) { - return message.reply(globals.Replies.find(r => r.id === 'NOENTRY').string); + return message.reply(findMessage('NOENTRY')); } else { diff --git a/commands/Attribute.js b/commands/Attribute.js index 68ca4c5..2cc433c 100644 --- a/commands/Attribute.js +++ b/commands/Attribute.js @@ -1,4 +1,10 @@ const globals = require('../globals'); +const { + CountOccurences +} = require('@dsabot/CountOccurences'); +const { + findMessage +} = require('@dsabot/findMessage'); const Random = require('random'); const db = globals.db; @@ -15,47 +21,26 @@ module.exports = { await db.find({ user: message.author.tag, - }, async function(err, docs) { + }, async function (err, docs) { // user calls with text. need to gather info from database if (isNaN(args[0])) { - if (docs.length === 0) { - message.reply(globals.Replies.find(r => r.id === 'NOENTRY').string); - return; - } - else { - // try to get id of short formatted attributes. - if (args[0].length == 2) { - for (const i in globals.Werte) { - if (globals.Werte[i].kuerzel == args[0].toUpperCase()) { - attributename = globals.Werte[i].id; - } - } - } - else { - attributename = args[0].toLowerCase(); - } - for (const i in docs[0].character.attributes) { - if (docs[0].character.attributes[i].id == attributename) level = docs[0].character.attributes[i].level; - } - } - } - else { + HandleNamedAttributes(); + } else { level = args[0]; } Random.use(message.author.tag); - const countOccurrences = (arr, val) => arr.reduce((a, v) => (v === val ? a + 1 : a), 0); + const dice = []; dice.push(Random.int(1, 20)); if (dice[0] == 1 || dice[0] == 20) { dice.push(Random.int(1, 20)); } // handle crits - if (countOccurrences(dice, 1) == 2) { + if (CountOccurences(dice, 1) == 2) { message.reply('Du hast einen kritischen Erfolg erzielt (' + dice.join(', ') + ')! 🎉🥳🎆'); return; - } - else if (countOccurrences(dice, 20) == 2) { + } else if (CountOccurences(dice, 20) == 2) { message.reply('Du hast einen Patzer (' + dice.join(', ') + ')! 😭 Viel Erfolg beim nächsten mal!'); return; } @@ -63,24 +48,47 @@ module.exports = { if (attributename) { message.reply('Du hast die Probe auf ' + attributename + ' (Stufe ' + level + ') bestanden.\n' + 'Deine 🎲: ' + dice.join(', ')); - } - else { + } else { message.reply('Du hast die Probe (Stufe ' + level + ') bestanden.\n' + 'Deine 🎲: ' + dice.join(', ')); } - } - else if (attributename) { + } else if (attributename) { message.reply('Du hast die Probe auf ' + attributename + ' (Stufe ' + level + ') leider nicht bestanden 😢.\n' + 'Deine 🎲: ' + dice.join(', ')); - } - else { + } else { message.reply('Du hast die Probe (Stufe ' + level + ') leider nicht bestanden 😢.\n' + 'Deine 🎲: ' + dice.join(', ')); } }); - } - catch (e) { + } catch (e) { throw e; } }, -}; \ No newline at end of file +}; + +const HandleCrits = (dice) => { + +}; + +const HandleNamedAttributes = () => { + if (docs.length === 0) { + message.reply(findMessage('NOENTRY')); + return; + } else { + // try to get id of short formatted attributes. + if (args[0].length == 2) { + for (const i in globals.Werte) { + if (globals.Werte[i].kuerzel == args[0].toUpperCase()) { + attributename = globals.Werte[i].id; + } + } + } else { + attributename = args[0].toLowerCase(); + } + for (const i in docs[0].character.attributes) { + if (docs[0].character.attributes[i].id == attributename) level = docs[0].character.attributes[i].level; + } + } +}; +//const docs = []; +//console.log(HandleNamedAttributes()) \ No newline at end of file diff --git a/commands/HeadsOrTails.js b/commands/HeadsOrTails.js index 7bba87f..898792e 100644 --- a/commands/HeadsOrTails.js +++ b/commands/HeadsOrTails.js @@ -1,6 +1,7 @@ const globals = require('../globals'); -const Random = require('random'); - +//const Random = require('random'); +const { roll } = require('@dsabot/Roll'); +const { findMessage }= require('@dsabot/findMessage'); module.exports = { name: 'kopf', @@ -10,8 +11,9 @@ module.exports = { needs_args: false, async exec(message, args) { - Random.use(message.author.tag); - const coin = Random.int(0, 1); - message.reply('Die Münze bleibt auf **' + globals.Coin[coin] + '** liegen.'); + //Random.use(message.author.tag); + const coin = roll(1,2,message.author.tag).dice; //Random.int(0, 1); +// message.reply('Die Münze bleibt auf **' + globals.Coin[coin] + '** liegen.'); + message.reply(`${findMessage('HEADS_OR_TAILS')} **${globals.Coin[(coin-1)]}**.`); }, }; \ No newline at end of file diff --git a/commands/Remove.js b/commands/Remove.js index 3043070..1eb06ed 100644 --- a/commands/Remove.js +++ b/commands/Remove.js @@ -1,3 +1,4 @@ +const { findMessage }= require('@dsabot/findMessage'); const globals = require('../globals'); const db = globals.db; module.exports = { @@ -10,7 +11,7 @@ module.exports = { db.remove({ user: message.author.tag, }, {}, function(err, numRemoved) { - message.reply(globals.Replies.find(x => x.id === 'DELETED_DATA').string); + return message.reply(findMessage('DELETED_DATA')); }); }, }; \ No newline at end of file diff --git a/commands/Roll.js b/commands/Roll.js index 9491f9b..c2dfec0 100644 --- a/commands/Roll.js +++ b/commands/Roll.js @@ -1,7 +1,7 @@ // eslint-disable-next-line no-unused-vars const globals = require('../globals'); -const Random = require('random'); - +const { roll } = require('@dsabot/Roll'); +const { findMessage }= require('@dsabot/findMessage'); module.exports = { name: 'roll', @@ -10,30 +10,17 @@ module.exports = { usage: ' w ', needs_args: true, async exec(message, args) { - - Random.use(message.author.tag); - let msg; - let arguments = args.join('').split(globals.DiceRegex); - if (arguments.length >= 2) { + let params = args.join('').split(globals.DiceRegex); + if ( params.length >= 2 ) { let bonus = 0; - const numberOfDice = parseInt(arguments[0]); - const diceValues = parseInt(arguments[1]); - if (arguments.length==3) { bonus = parseInt(arguments[2]); } - let sum = bonus; - const roll = []; - for (let i = 0; i < numberOfDice; i++) { - const a = Random.int(1, diceValues); - roll.push(a); - sum += a; + const numberOfDice = parseInt( params[0] ); + const diceValues = parseInt( params[1] ); + if ( params.length == 3 ) { + bonus = parseInt( params[2] ); } - if (numberOfDice == 1) { - msg = 'n'; - } - else { - msg = ' ' + numberOfDice; - } - //message.reply('Das sind deine Ergebnisse für deine' + msg + ' ' + diceValues + '-seitigen 🎲: ' + roll.join(', ') + '. (Gesamt: ' + roll.reduce((pv, cv) => pv + cv, 0) + ' + ' + bonus[1] + ' = ' + sum + ')'); - message.reply(`Das sind die Ergebnisse für deine${msg} ${diceValues}-seitigen 🎲: ${roll.join(', ')}. (Gesamt: ${roll.reduce((pv, cv) => pv + cv, 0)} + ${bonus} = ${sum})`); + + const result = roll( numberOfDice, diceValues, message.author.tag ); + message.reply(`${findMessage('ROLL')} ${result.dice.join(', ')} (Gesamt: ${result.sum} + ${bonus} = ${result.sum + bonus})` ); } }, }; \ No newline at end of file diff --git a/commands/Show.js b/commands/Show.js index 71b2155..aa2c2a0 100644 --- a/commands/Show.js +++ b/commands/Show.js @@ -2,6 +2,7 @@ const globals = require('../globals'); const Discord = require('discord.js'); const db = globals.db; +const { findMessage }= require('@dsabot/findMessage'); module.exports = { name: 'show', @@ -16,7 +17,7 @@ module.exports = { user: message.author.tag, }, function(err, docs) { if (docs.length === 0) { - return message.reply(globals.Replies.find(r => r.id === 'NOENTRY').string); + return message.reply(findMessage('NOENTRY')); } else { let gender; diff --git a/commands/Skill.js b/commands/Skill.js index 389ce7e..8030f8b 100644 --- a/commands/Skill.js +++ b/commands/Skill.js @@ -1,5 +1,6 @@ const globals = require('../globals'); const db = globals.db; +const { findMessage }= require('@dsabot/findMessage'); module.exports = { name: 'skill', description: 'Zeigt dir deinen Fertigkeitswert im jeweiligen Talent.', @@ -13,13 +14,18 @@ module.exports = { user: message.author.tag, }, function(err, docs) { if (docs.length === 0) { - return message.reply(globals.Replies.find(r => r.id === 'NOENTRY').string); + return message.reply(findMessage('NOENTRY')); } else { let level = 0; + /* for (let i in docs[0].character.skills) { - if (docs[0].character.skills[i].id == args[0]) level = docs[0].character.skills[i].level; + if (docs[0].character.skills[i].id == args[0]) { + level = docs[0].character.skills[i].level; + } } + */ + level = docs[0].character.skills.find(skill => skill.id === args[0]).level; message.reply('Du hast folgenden Talentwert in ' + args[0] + ': ' + level); } }); diff --git a/commands/Talent.js b/commands/Talent.js index 1ac973c..26b6980 100644 --- a/commands/Talent.js +++ b/commands/Talent.js @@ -1,13 +1,18 @@ const globals = require('../globals'); -const Random = require('random'); const Discord = require('discord.js'); const db = globals.db; +const { + roll +} = require('@dsabot/Roll'); +const { + findMessage +} = require('@dsabot/findMessage'); module.exports = { name: 'talent', description: ' Du machst eine Fertigkeitsprobe.\n' + - ' Es werden drei Würfel auf deine Eigenschaftswerte geworfen. Hast du Boni auf dein Talent und/oder' + - ' ist der Wurf erleichtert oder erschwert, wird dies in die Berechnung einbezogen.', + ' Es werden drei Würfel auf deine Eigenschaftswerte geworfen. Hast du Boni auf dein Talent und/oder' + + ' ist der Wurf erleichtert oder erschwert, wird dies in die Berechnung einbezogen.', aliases: ['t'], usage: ' [<-Erschwernis> / <+Erleichterung>]', needs_args: true, @@ -15,108 +20,91 @@ module.exports = { try { db.find({ user: message.author.tag, - }, function(err, docs) { + }, function (err, docs) { if (docs.length === 0) { - return message.reply(globals.Replies.find(r => r.id === 'NOENTRY').string); + return message.reply(findMessage('NOENTRY')); } - if(!isNaN(args[0])) { - return message.reply(globals.Replies.find(x => x.id === 'WRONG_ARGUMENTS').string); - } - else { - Random.use(message.author.tag); + if (!isNaN(args[0])) { + return message.reply(findMessage('WRONG_ARGUMENTS')); + } else { + const Character = docs[0].character; const values = []; - const roll = []; - let found = false; - let talent; - let bonus = 0; + + const erschwernis = parseInt(args[1]) || 0; + const talent = globals.Talente.find(talent => talent.id.toLocaleLowerCase() === args[0].toLowerCase()); + + if (!talent) { + return message.reply(findMessage('TALENT_UNKNOWN')); + } + + let bonus = Character.skills.find(skill => skill.id === talent.id).level || 0; + const bonus_orig = bonus; + + talent.values.forEach(v => { + let abbr = globals.Werte.find(wert => wert.kuerzel === v); + values.push((Character.attributes.find(attr => attr.id === abbr.id)).level); + }); + const dice = roll(3, 20, message.author.tag).dice; + let ok = 0; let patzer = 0; let crit = 0; - let erschwernis = 0; - if (args[1]) { - erschwernis = parseInt(args[1]); - } - - for (let i in globals.Talente) { - if (globals.Talente[i].id.toLowerCase() == args[0].toLowerCase() || globals.Talente[i].name.toLowerCase() == args[0].toLowerCase()) { - found = true; - talent = globals.Talente[i].id; - break; - } - } - if (!found) { - message.reply(globals.Replies.find(x => x.id === 'TALENT_UNKNOWN').string); - return; - } - for (let i in docs[0].character.skills) { - if (docs[0].character.skills[i].id == talent) { - bonus = docs[0].character.skills[i].level; - found = true; - } - } - - const bonus_orig = bonus; - const result = globals.Talente.find(t => t.id === talent); - - result.values.forEach(value => { - let kuerzel = globals.Werte.find(wert => wert.kuerzel === value); - docs[0].character.attributes.forEach(attr => { - if (attr == kuerzel.id) { values.push(attr.level);} - }); - }); - - for (let i = 1; i <= 3; i++) { - roll.push(Random.int(1, 20)); - } // compare results - for (let i = 0; i < 3; i++) { - if (Math.floor(values[i] + parseInt(erschwernis)) >= roll[i]) { + for (let i = 0; i < dice.length; i++) { + if (Math.floor(values[i] + erschwernis) >= dice[i]) { ok++; - } - else if ((Math.floor(values[i]) + parseInt(bonus) + parseInt(erschwernis)) >= roll[i]) { + } else if (Math.floor(values[i] + bonus + erschwernis) >= dice[i]) { ok++; - bonus = bonus - (roll[i] - parseInt(erschwernis) - values[i]); + bonus -= (dice[i] - erschwernis - values[i]); + } + if (dice[i] == 1) { + crit++; + } + if (dice[i] == 20) { + patzer++; } - if (roll[i] == 1) crit++; - if (roll[i] == 20) patzer++; } const Reply = new Discord.MessageEmbed(); - Reply.setTitle('Du würfelst auf das Talent ' + result.name + '.'); - Reply.setDescription('Deine Werte für ' + result.values.join(', ') + ' sind ' + values.join(', ') + '. (Bonus: ' + bonus_orig + ')'); + Reply.setTitle('Du würfelst auf das Talent ' + talent.name + '. (v2)'); + Reply.setDescription('Deine Werte für ' + talent.values.join(', ') + ' sind ' + values.join(', ') + '. (Bonus: ' + bonus_orig + ')'); Reply.addFields({ - name: 'Deine 🎲: ' + roll.join(', ') + '.', - value: '\u200B', inline: false}); + name: 'Deine 🎲: ' + dice.join(', ') + '.', + value: '\u200B', + inline: false + }); if (patzer >= 2) { Reply.setColor('#900c3f'); Reply.addFields({ - name: globals.Replies.find(x => x.id === 'TITLE_CRIT_FAILURE').string, - value: globals.Replies.find(x => x.id === 'MSG_CRIT_FAILURE').string, - inline: false}); - } - else if (crit >= 2) { + name: findMessage('TITLE_CRIT_FAILURE'), + value: findMessage('MSG_CRIT_FAILURE'), + inline: false + }); + } else if (crit >= 2) { Reply.setColor('#1E8449'); Reply.addFields({ - name: globals.Replies.find(x => x.id === 'TITLE_CRIT_SUCCESS').string, - value:globals.Replies.find(x => x.id === 'MSG_CRIT_SUCCESS').string, - inline: false}); - } - else if (ok < 3) { - Reply.addFields({name: globals.Replies.find(x => x.id === 'TITLE_FAILURE').string, - value: 'nur ' + ok + '/3 Proben erfolgreich. 😪', - inline: false}); - } - else { - Reply.addFields({name: globals.Replies.find(x => x.id === 'TITLE_SUCCESS').string, - value: ok + '/3 Proben erfolgreich. Dein Bonus: ' + bonus + '/' + bonus_orig + '.', - inline: false}); + name: findMessage('TITLE_CRIT_SUCCESS'), + value: findMessage('MSG_CRIT_SUCCESS'), + inline: false + }); + } else if (ok < 3) { + Reply.addFields({ + name: findMessage('TITLE_FAILURE'), + value: 'nur ' + ok + '/3 Proben erfolgreich. 😪', + inline: false + }); + } else { + Reply.addFields({ + name: findMessage('TITLE_SUCCESS'), + value: ok + '/3 Proben erfolgreich. Dein Bonus: ' + bonus + '/' + bonus_orig + '.', + inline: false + }); } message.reply(Reply); } }); - } - catch (e) { + } catch (e) { throw e; } }, diff --git a/commands/Tp.js b/commands/Tp.js index 05b374f..80438fe 100644 --- a/commands/Tp.js +++ b/commands/Tp.js @@ -2,7 +2,8 @@ const Random = require('random'); const globals = require('../globals'); const Discord = require('discord.js'); - +const { roll } = require('@dsabot/Roll'); +const { findMessage }= require('@dsabot/findMessage'); module.exports = { name: 'tp', description: 'Du machst eine Fertigkeitsprobe.\n' + @@ -15,11 +16,11 @@ module.exports = { async exec(message, args) { if(isNaN(args[0])) { - return message.reply(globals.Replies.find(x => x.id === 'WRONG_ARGUMENTS').string); + return message.reply(findMessage('WRONG_ARGUMENTS')); } - Random.use(message.author.tag); - const roll = []; + //Random.use(message.author.tag); + //const dice = []; let bonus = 0; let bonus_orig = 0; let erschwernis = 0; @@ -30,50 +31,51 @@ module.exports = { if (args[4]) { erschwernis = parseInt(args[4]); } - for (let i = 1; i <= 3; i++) { + /*for (let i = 1; i <= 3; i++) { roll.push(Random.int(1, 20)); - } + }*/ + const dice = roll(3,20,message.author.tag).dice; + let ok = 0; let patzer = 0; let crit = 0; for (let i = 0; i < 3; i++) { - if (Math.floor(parseInt(args[i]) + parseInt(erschwernis)) >= roll[i]) { + if (Math.floor(parseInt(args[i]) + parseInt(erschwernis)) >= dice[i]) { ok++; } else if ( - Math.floor(parseInt(args[i]) + parseInt(bonus) + parseInt(erschwernis)) >= roll[i]) { + Math.floor(parseInt(args[i]) + parseInt(bonus) + parseInt(erschwernis)) >= dice[i]) { ok++; - bonus = bonus - (roll[i] - parseInt(erschwernis) - parseInt(args[i])); + bonus = bonus - (dice[i] - parseInt(erschwernis) - parseInt(args[i])); } - if (roll[i] == 1) crit++; - if (roll[i] == 20) patzer++; + if (dice[i] == 1) {crit++;} + if (dice[i] == 20) {patzer++;} } const Reply = new Discord.MessageEmbed(); - //Reply.setTitle('Du würfelst auf ' + args[0] + ' ' + args[1] + ' ' + args[2] + ' (Bonus: ' + bonus_orig + ')') - Reply.setTitle('Deine 🎲: ' + roll.join(', ') + '.'); + Reply.setTitle(`${findMessage('ROLL')} ${dice.join(', ')}.`); if (patzer >= 2) { Reply.setColor('#900c3f'); Reply.addFields({ - name: globals.Replies.find(x => x.id === 'TITLE_CRIT_FAILURE').string, - value: globals.Replies.find(x => x.id === 'MSG_CRIT_FAILURE').string, + name: findMessage('TITLE_CRIT_FAILURE'), + value: findMessage('MSG_CRIT_FAILURE'), inline: false }); } else if (crit >= 2) { Reply.setColor('#1E8449'); Reply.addFields({ - name: globals.Replies.find(x => x.id === 'TITLE_CRIT_SUCCESS').string, - value: globals.Replies.find(x => x.id === 'MSG_CRIT_SUCCESS').string, + name: findMessage('TITLE_CRIT_SUCCESS'), + value: findMessage('MSG_CRIT_SUCCESS'), inline: false }); } else if (ok < 3) { Reply.addFields({ - name: globals.Replies.find(x => x.id === 'TITLE_FAILURE').string, + name: findMessage('TITLE_FAILURE'), value: 'Nur ' + ok + '/3 Proben erfolgreich. 😪', inline: false }); } else { Reply.addFields({ - name: globals.Replies.find(x => x.id === 'TITLE_SUCCESS').string, + name: findMessage('TITLE_SUCCESS'), value: ok + '/3 Proben erfolgreich. Dein Bonus: ' + bonus + '/' + bonus_orig + '.', inline: false }); diff --git a/functions/Compare.js b/functions/Compare.js new file mode 100644 index 0000000..d07365e --- /dev/null +++ b/functions/Compare.js @@ -0,0 +1,6 @@ +const Compare = () => { + + return { result }; +}; + +module.exports = { Compare }; \ No newline at end of file diff --git a/functions/CountOccurences.js b/functions/CountOccurences.js new file mode 100644 index 0000000..1f7833f --- /dev/null +++ b/functions/CountOccurences.js @@ -0,0 +1,7 @@ +const CountOccurences = (arr, value) => { + return arr.filter((v) => (v === value)).length; +}; + +module.exports = { CountOccurences }; + +//console.log(countOccurrences([1,2,3,4,3,2,3,3,2],2)); diff --git a/functions/Roll.js b/functions/Roll.js new file mode 100644 index 0000000..d840375 --- /dev/null +++ b/functions/Roll.js @@ -0,0 +1,15 @@ +const Random = require('random'); +const roll = (numberOfDice, numberOfEyes, tag) => { + let dice = []; + let sum = 0; + if(tag) { + Random.use(tag); + } + for (let i = 0; i { + return globals.Replies.find(r => r.id === value).string; +}; + +module.exports = { findMessage }; \ No newline at end of file diff --git a/globals.js b/globals.js index 7a897a5..80b3931 100644 --- a/globals.js +++ b/globals.js @@ -138,7 +138,9 @@ const Replies = [ { id: 'PARRY_FAIL', string: 'Deine Parade schlägt fehl.'}, { id: 'PARRY_CRIT_FAIL', string: 'Kritischer Fehlschlag! Du erleidest zusätzlich 1W6+2 Schadenspunkte!'}, { id: 'PARRY_SUCCESS', string: 'Parade erfolgreich.'}, - { id: 'PARRY_CRIT_SUCCESS', string: 'Kritischer Erfolg! Du darfst einen Passierschlag ausführen!'} + { id: 'PARRY_CRIT_SUCCESS', string: 'Kritischer Erfolg! Du darfst einen Passierschlag ausführen!'}, + { id: 'ROLL', string: 'Du würfelst:'}, + { id: 'HEADS_OR_TAILS', string: 'Die Münze landet auf '} ]; const Declination = ['dem', 'der', 'dem', '']; // Maskulinum, Feminimum, Neutrum, None const Articles = ['Der','Die','Das','']; diff --git a/jest.config.js b/jest.config.js new file mode 100644 index 0000000..0691e30 --- /dev/null +++ b/jest.config.js @@ -0,0 +1,3 @@ +module.exports = { + testEnvironment: 'node' +}; \ No newline at end of file diff --git a/jsconfig.json b/jsconfig.json new file mode 100644 index 0000000..c967d43 --- /dev/null +++ b/jsconfig.json @@ -0,0 +1,9 @@ +{ + "compilerOptions": { + "baseUrl": "./", + "paths": { + "@dsabot/*": ["functions/*"], + "@globals": ["./globals"] + } + } +} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index c376e4a..019d696 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,6 +7,7 @@ "": { "name": "dsabot", "version": "1.0.0", + "hasInstallScript": true, "license": "ISC", "dependencies": { "discord.js": "^12.5.0", diff --git a/package.json b/package.json index 6392ac7..793d2b8 100644 --- a/package.json +++ b/package.json @@ -1,11 +1,15 @@ { "name": "dsabot", - "version": "1.0.0", + "version": "1.1.0", "description": "", "main": "index.js", "scripts": { "lint": "eslint commands/", - "start": "node index.js" + "start": "node index.js", + "test": "jest" + }, + "_moduleAliases": { + "@dsabot": "functions" }, "author": "", "license": "ISC",