-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfunctions.js
executable file
·46 lines (39 loc) · 1.41 KB
/
functions.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
function triggerRandomly() {
const intervalInMinutes = 60 / 2; // 5 times per hour
const intervalInMilliseconds = intervalInMinutes * 60 * 1000; // convert to milliseconds
setInterval(() => {
const randomNumber = Math.random();
const channel = client.channels.cache.get("419977920249987097");
const members = channel.members;
// trigger something randomly based on the random number
if (members.size > 1) {
if (randomNumber < 0.4) {
random_members = members;
random_members.delete(botDiscId);
const member = random_members.random();
console.log(member.user.username);
console.log('Random trigger!');
chatgpt("Criador: Interage com o membro + " + member.user.username + " como se ele fosse um gato, em 10 palavras. Acaba a miar:", "False");
}
}
}, intervalInMilliseconds);
}
function getDateTime() {
var date = new Date();
var hour = date.getHours();
hour = (hour < 10 ? "0" : "") + hour;
var min = date.getMinutes();
min = (min < 10 ? "0" : "") + min;
var sec = date.getSeconds();
sec = (sec < 10 ? "0" : "") + sec;
var year = date.getFullYear();
var month = date.getMonth() + 1;
month = (month < 10 ? "0" : "") + month;
var day = date.getDate();
day = (day < 10 ? "0" : "") + day;
return day + "/" + month + "/" + year + " " + hour + ":" + min + ":" + sec;
}
module.exports = {
triggerRandomly,
getDateTime
};