diff --git a/commands/calc.js b/commands/calc.js new file mode 100644 index 0000000..fd62f52 --- /dev/null +++ b/commands/calc.js @@ -0,0 +1,17 @@ +var libFlayer = require("../libFlayer.js"); + +module.exports = { + name: 'calc', + description: 'Calc', + execute(message, args) { + try { + if (args.length < 3) { + + } + //var stringArgs = evaluate(args.join(" ")); + //message.reply(`Answer: ${stringArgs}`); + } catch (err) { + message.reply(err.toString()); + } + } +}; \ No newline at end of file diff --git a/commands/find.js b/commands/find.js index e12715d..cc53eda 100644 --- a/commands/find.js +++ b/commands/find.js @@ -44,7 +44,7 @@ module.exports = { message.reply("Error in search"); return; } else { - message.reply(searchString); + message.reply('-' + searchString); } if (count == 1) { diff --git a/commands/help.js b/commands/help.js index 31b7f71..88b77b5 100644 --- a/commands/help.js +++ b/commands/help.js @@ -22,6 +22,7 @@ module.exports = { **!answer** - Answers for a question above: *!answer 1* **!npm** - Gets NPM info from repository: *!npm axios* **!alert** - Gets weather alerts for an area: *!alert TX* + **!calc** - Do math: *!calc 2 + 2* ` ); } diff --git a/index.js b/index.js index e2e300c..1aab76b 100644 --- a/index.js +++ b/index.js @@ -112,7 +112,7 @@ client.on('interactionCreate', async interaction => { } }); -client.on('message', message => { +client.on('messageCreate', message => { if (!message.content.startsWith(prefix) || message.author.bot) return; const args = message.content.slice(prefix.length).trim().split(/ +/);