-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
116 lines (89 loc) · 3.26 KB
/
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
// Load up the discord.js library
const Discord = require("discord.js");
// This is your client. Some people call it `bot`
const client = new Discord.Client();
const fs = require("fs");
//Here we load the config.json file that contains our token and our prefix values.
const config = require("./config.json");
// config.token contains the bot's token
//congig.prefix contains the prefix
const keywords = require("./keywords.json");
//keywords.list contains array of keywords
// client.on("message", message => {
// if(message.author.bot) return;
// var args = false;
// var str = "abcd";
// keywords.list.forEach(str => {
// if(message.content.includes(str))
// args = true;
// });
// if(args)
// {
// //creates the REEE string with random number of Es
// var ree= 'R';
// num_e=Math.floor(Math.random()*10 + 5);
// for(var i=0; i<=num_e; i++){
// ree += 'E';
// }
// message.channel.send(ree);
// }
// });
function shuffle(a) {
for (let i = a.length - 1; i > 0; i--) {
const j = Math.floor(Math.random() * (i + 1));
[a[i], a[j]] = [a[j], a[i]];
}
return a;
}
// client.on('ready', () => {
// console.log(`Logged in as ${client.user.tag}!`);
// setInterval(function () {
// var e = 'e'.repeat(Math.floor(Math.random() * 10) + 2);
// var name = 'R' + e + 'tardo';
// client.guilds.get(config.tudcse18).members.get(config.reecardo).setNickname(name);
// }, 5000);
// });
client.on('ready', () => {
setInterval(function () {
var order = [0, 1, 2, 3]
shuffle(order)
var name = "dxts"
var name = name[order[0]] + name[order[1]] + name[order[2]] + name[order[3]]
client.guilds.get(config.tudcse18).members.get(config.dxts).setNickname(name)
}, 10000)
})
// client.on("message", message => {
// if (message.author.bot) return;
// if (message.content.indexOf(config.prefix) !== 0) return;
// const args = message.content.slice(config.prefix.length).trim().split(/ +/g);
// //.slice removes the prefix, ie '!',
// //trim removes any extra spaces,
// //split splits the string by the spaces
// const command = args.shift().toLowerCase();
// //shift returns the first element from the array, ie the command
// //tolowercase ensures !command !Command !COMMAND all work
// if (command === "ree") {
// //let member = message.mentions.members.first();
// message.delete();
// //creates the REEE string with random number of Es
// var ree = 'R';
// num_e = Math.floor(Math.random() * 10 + 3);
// for (var i = 0; i <= num_e; i++) {
// ree += 'E';
// }
// message.channel.send(ree);
// }
// else if (command === "flip") {
// message.delete();
// message.channel.send("(╯°□°)╯︵ ┻━┻");
// }
// else if (command === "flipall") {
// message.delete();
// message.channel.send("┻━┻︵ \(°□°)/ ︵\n\t ┻━┻");
// }
// else if (command === "tabledown") {
// message.delete();
// message.channel.send("┬─┬ ノ( ゜-゜ノ)");
// }
// });
client.login(config.token);