-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommands.js
More file actions
52 lines (37 loc) · 1.37 KB
/
commands.js
File metadata and controls
52 lines (37 loc) · 1.37 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
const DBConnector = require('./dbconnector');
module.exports = class Commands {
static UseCommands(message) {
if (this.Match(message)) {
this.Action(message);
if (message.deletable) {
message.delete();
}
return true;
}
return false;
}
static Match(message) {
}
static Action(message) {
}
static DisplayEvent(eventId, channel) {
DBConnector.SeeEvent(eventId, function (event, players, unplayers) {
if (event) {
var res = "\nEvènement **" + event.id + "** : ";
let date = new Date(event.date*1);
res += "\n**" + event.name + "** le " + date.getDate().pad(2) + "/" + (date.getMonth() + 1).pad(2) + "/" + date.getFullYear() + " à " +
date.getHours().pad(2) + ":" + date.getMinutes().pad(2) + " crée par " + event.creator;
res += "\n*Participants* [**" + players.length + "**]: \n";
players.forEach((player) => {
res += "**- **" + player.name + ",\n";
});
res += "*Ne peut pas Participer* [**" + unplayers.length + "**]: ";
unplayers.forEach((player) => {
res += player.name + ",";
});
res += "\n";
channel.send(res);
}
});
}
}