* fixing typos * merge Dynamic commands (#3) * Update README.md * Update README.md * fixing typos * dynamically read new commands inside folder. * eslint, update package.json due to moving files Co-authored-by: Marcus Netz <marcus.netz@godyo.com> * fix talent checking on empty arguments list * Origin/message embed (#4) * add first embedded message on tp.js * move db from message commands * fix missing arguments list, add need_args * add global Message Replies. * add more global Message Replies. * more embedded messages. fixing string * missing comma * adding a few more strings on talents. Co-authored-by: Marcus Netz <marcus.netz@godyo.com> * fixing creating from json file * bugfix: db not defined * possible fix for nonworking talent? * fix double msg * fix: aliases are now being used * change: show command displays now some character attributes * added various aliases to commands, added global strings. * added melee combat rolling. * removed purse from creation of character * added attack command to bring some combat features. * added weapons command, renamed some command files. * updated README for new commands Co-authored-by: Marcus Netz <marcus.netz@godyo.com>
36 lines
1.0 KiB
JavaScript
36 lines
1.0 KiB
JavaScript
const globals = require('../globals');
|
|
const Discord = require('discord.js');
|
|
|
|
|
|
module.exports = {
|
|
name: 'weapons',
|
|
description: 'Listet eine Übersicht, welche für einen Angriff genutzt werden können.',
|
|
aliases: ['waffen'],
|
|
usage: '',
|
|
needs_args: false,
|
|
|
|
async exec(message, args) {
|
|
let fields = [];
|
|
for (let CombatTechnique in globals.CombatTechniques) {
|
|
let Weapons = [];
|
|
for (let Weapon in globals.Weapons) {
|
|
if (globals.Weapons[Weapon].combattechnique == globals.CombatTechniques[CombatTechnique].id) {
|
|
Weapons.push(globals.Weapons[Weapon].id.charAt(0).toUpperCase() + globals.Weapons[Weapon].id.slice(1));
|
|
}
|
|
}
|
|
Weapons.sort();
|
|
fields.push(Weapons);
|
|
}
|
|
|
|
const Embed = new Discord.MessageEmbed()
|
|
.setColor('#0099ff')
|
|
.setTitle('Waffenübersicht')
|
|
.setDescription('Folgende Waffen können für einen Angriff genutzt werden:');
|
|
for (let i in fields) {
|
|
Embed.addField(globals.CombatTechniques[i].name, fields[i].join('\n'), true);
|
|
}
|
|
message.author.send(
|
|
Embed,
|
|
);
|
|
},
|
|
}; |