-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
30 lines (24 loc) · 1009 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
const Discord = require('discord.js');
const client = new Discord.Client();
const config = require("./config.json");
const getJutsu = require("./src/sheet");
const util = require("./src/Util");
client.on('ready', () => {
console.log(`Connexion établie`);
});
client.on('message', message => {
if(!message.content.startsWith(config.prefix) || message.author.bot) return;
const args = message.content.slice(config.prefix.length).trim().split(/ +/g);
let command = args.shift().toLowerCase();
if (command === "ping") {
message.reply(new Discord.RichEmbed().setColor("#088da5").setTitle(`Pong !`));
}
if (util.natures.includes(command)) {
if(command === "impacte") command = "impact";
if(command === "normale") command = "normal";
if(command === "manipulate") command = "manipulation";
console.log(`${message.author.tag} a demander les jutsu de type ${command}`);
getJutsu(message, command);
}
});
client.login(config.token);