-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathquit.js
More file actions
32 lines (23 loc) · 915 Bytes
/
quit.js
File metadata and controls
32 lines (23 loc) · 915 Bytes
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
const Commands = require('./commands');
const DBConnector = require('./dbconnector');
module.exports = class Quit extends Commands {
static Match(message) {
return message.content.startsWith('/quit') || message.content.startsWith('/leave');
}
static Action(message) {
let args = message.content.split(' ');
if (args.length < 2) {
message.author.send('Mauvaise syntaxe : /quit EventId');
} else {
DBConnector.QuitEvent(args[1], message.author, function (id) {
let why = "";
for (let i = 2; i < args.length; i++) {
why += args[i] + " ";
}
let raison = ((why == "") ? "" : (" - raison : " + why));
message.channel.send(message.author.tag + " a quitté l'évènement " + id + raison );
//Commands.DisplayEvent(id,message.channel);
});
}
}
}