-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhandlerMsg.js
More file actions
40 lines (26 loc) · 895 Bytes
/
handlerMsg.js
File metadata and controls
40 lines (26 loc) · 895 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
33
34
35
36
37
38
39
40
const ids = require("./ids");
// Prefix commands
const prefix = "!";
function analizar(message){
if (checkComm(message,"cuenta")){
limpiar(message);
}
}
function limpiar(message){
if(ids.mesas.some(x => x === message.channel.id)){
purge(message);
var total = (Math.random() * (3000.00 - 50.00) + 50.00).toFixed(2);
message.channel.send("<@" + message.author + "> el total es de: AR$" + total + " Dejame una propina rata! :mouse:")
.then(msg => msg.delete({timeout: 60000}));
}
}
async function purge(message){
message.delete();
let fetched = await message.channel.messages.fetch();
message.channel.bulkDelete(fetched, true)
.catch(error => message.channel.send("Error: " + error));
}
function checkComm(message,str){
return message.content.startsWith(prefix + str);
}
exports.analizar = analizar;