-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.js
221 lines (189 loc) · 8.6 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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
require('./dota')
const axios = require('axios');
const axiosInstance = axios.create({
baseURL: 'https://api.opendota.com/api/',
});
require('dotenv').config({ path: __dirname + '/.env' })
const Discord = require('discord.js');
const client = new Discord.Client();
const dota = require('./dota');
const users = require('./retards.config');
const ranks = require('./ranks.config');
const openDotaKey = process.env.OPEN_DOTA_KEY;
const myAvatar = "https://cdn.discordapp.com/avatars/486578152454488065/37d3bd769b74dc4f6c89542a98eba4ad.webp";
const myName = "Family Friendly Bot";
const admins = ['240542597540610048', '310860262624460801', '202035944260370441', '202744505114296331'];
const dishas = ['O/o CCA Odisha Telecom Circle, 4th Floor, C P M G Building, Bhubaneswar - 751 001, Odisha', '7C42+W2 Santarapur, Odisha', '597M+W3 Sanapadar, Odisha', '643R+83 Tentuliapalli, Odisha', '858W+88 Padia Bhanga, Odisha'];
const simps = ['./raj.png', './raja.png', './shubham.png'];
const bitchs = ['./raj_bitch.png',];
var delQueenTxt = false;
client.on('ready', () => {
console.log(`Logged in as ${client.user.tag}!`);
});
client.on('message', async msg => {
if (delQueenTxt) {
if (msg.member.roles.cache.some(role => role.name === 'Q U E E N S'))
msg.delete({ timeout: 2000 })
.then(m => {
console.log(`Deleted message from ${m.author.username} after 5 seconds`)
// msg.channel.send('Power to <@&753249814350790776>!');
})
.catch(console.error);
}
if (msg.content.charAt(0) != '>') {
return
}
const rand = Math.floor((Math.random() * 100) + 1) == 100;
const content = msg.content.substring(1, msg.content.length)
if (content === 'patriarchy') {
if (!admins.includes(msg.author.id)) {
msg.reply("Sorry, you are not admin.")
return
} else {
delQueenTxt = true;
msg.reply("Roger that Sir!");
}
}
if (content === 'feminism') {
if (!admins.includes(msg.author.id)) {
msg.reply("Sorry, you are not admin.")
return
} else {
delQueenTxt = false;
msg.reply("Chalo theek hai!");
}
}
if (content === "mute") {
if (!admins.includes(msg.author.id)) {
msg.reply("Sorry, you are not admin.")
return
} else {
// msg.member.voice.setDeaf(true, "Game starting");
// msg.member.voice.setMute(true, "Game starting");
msg.member.voice.channel.members.forEach((m) => {
if (m.roles.cache.some(role => role.name === 'Groovy'))
return;
m.voice.setMute(true, "Game Starting");
});
// msg.member.guild.voiceStates.cache.forEach((c) => {
// if (msg.member.voice.channelID === c.channelID)
// c.setMute(true, "Game Starting");
// });
}
}
if (content === "unmute") {
if (!admins.includes(msg.author.id)) {
msg.reply("Sorry, you are not admin.")
return
} else {
// msg.member.voice.setDeaf(false, "Voting round");
// msg.member.voice.setMute(false, "Voting round");
msg.member.voice.channel.members.forEach((m) => {
if (m.roles.cache.some(role => role.name === 'Groovy'))
return;
m.voice.setMute(false, "Voting round");
});
}
}
if (content === 'dishakidisha') {
msg.reply(dishas[Math.floor(Math.random() * dishas.length)]);
}
// if (content === 'ping') {
// msg.reply('pong');
// }
if (content.includes("password")) {
msg.reply("IT Cell will take it from here. Thank you.");
}
if (content === 'ayesha') {
msg.react('👺')
msg.react(String.fromCodePoint("C".codePointAt(0) - 65 + 0x1f1e6))
msg.react(String.fromCodePoint("H".codePointAt(0) - 65 + 0x1f1e6))
msg.react(String.fromCodePoint("U".codePointAt(0) - 65 + 0x1f1e6))
msg.react(String.fromCodePoint("D".codePointAt(0) - 65 + 0x1f1e6))
msg.react(String.fromCodePoint("A".codePointAt(0) - 65 + 0x1f1e6))
msg.react(String.fromCodePoint("I".codePointAt(0) - 65 + 0x1f1e6))
msg.react(String.fromCodePoint("L".codePointAt(0) - 65 + 0x1f1e6))
msg.react('👹')
msg.react('🇱🇰')
// msg.react(msg.guild.emojis.cache.find(emoji => emoji.name === 'regional_indicator_c'))
// msg.react(msg.guild.emojis.cache.find(emoji => emoji.name === 'regional_indicator_h'))
// msg.react(msg.guild.emojis.cache.find(emoji => emoji.name === 'regional_indicator_u'))
// msg.react(msg.guild.emojis.cache.find(emoji => emoji.name === 'regional_indicator_d'))
// msg.react(msg.guild.emojis.cache.find(emoji => emoji.name === 'regional_indicator_a'))
// msg.react(msg.guild.emojis.cache.find(emoji => emoji.name === 'regional_indicator_i'))
// msg.react(msg.guild.emojis.cache.find(emoji => emoji.name === 'regional_indicator_l'))
// msg.react(msg.guild.emojis.cache.find(emoji => emoji.name === 'japanese_ogre'))
// msg.react(msg.guild.emojis.cache.find(emoji => emoji.name === 'flag_lk'));
}
if (content === 'appy') {
msg.react(msg.guild.emojis.cache.find(emoji => emoji.name === 'appy'))
}
if (content.includes('asli')) {
msg.react(msg.guild.emojis.cache.find(emoji => emoji.name === 'pepehands'))
msg.react(msg.guild.emojis.cache.find(emoji => emoji.name === 'sadsli'));
}
if (content === 'myrank') {
if (users.hasOwnProperty(msg.author.id)) {
await axiosInstance.get(`/players/${users[msg.author.id].steam32}`).then((r) => {
msg.reply(`Your Dota Rank is ${tierToRank(r.data.rank_tier)}, step up your game pleb!`);
}).catch((e) => {
console.log(e);
})
} else {
msg.reply('Premium membership required!');
}
}
if (content === 'mymmr') {
if (users.hasOwnProperty(msg.author.id)) {
await axiosInstance.get(`/players/${users[msg.author.id].steam32}`).then((r) => {
r.data.competitive_rank ? msg.reply(`Your Party MMR is ${r.data.competitive_rank}, eww!`) : (r.data.mmr_estimate ? msg.reply(`Your Party MMR is ${r.data.mmr_estimate.estimate}, eww!`) : msg.reply("Valve doesn't have your data, lmao noob!"));
}).catch((e) => {
msg.reply("That nearly killed me wew!");
console.log(e);
})
} else {
msg.reply('Premium membership required!');
}
}
if (content.split(" ")[0] === "say") {
if (msg.mentions.users.first().id === "240542597540610048") {
msg.reply("Sorry, NO!");
return;
}
msg.delete({ timeout: 1000 })
.then(m => {
})
.catch(console.error);
msg.guild.members.cache.find(user => user.id === '486578152454488065').setNickname(msg.mentions.users.first().username).then(() => {
msg.channel.send(content.substring(content.lastIndexOf(content.split(" ")[2]), content.length)).then(() => {
// client.user.setAvatar(myAvatar);
msg.guild.members.cache.find(user => user.id === '486578152454488065').setNickname(myName);
}).catch(console.error);
}).catch(console.error);
// client.user.setAvatar(msg.mentions.users.first().avatarURL()).then(() => {
// client.user.setUsername(msg.mentions.users.first().username)
// msg.reply(content.substring(content.lastIndexOf(content.split(" ")[2]), content.length)).then(() => {
// client.user.setAvatar(myAvatar);
// client.user.setUsername(myName);
// }).catch(console.error);
// }).catch(console.error);
}
if (content === 'allranks') {
let ranks = await allRanks()
const ranksEmbed = new Discord.MessageEmbed()
.setColor('#0099ff')
.setTitle('Ranks of Retards')
.addFields(ranks);
msg.channel.send(ranksEmbed)
}
if (content === "gagan") {
msg.reply("KHELNA SEEKH NA SARDAR!");
}
if (content === "whosimp") {
msg.channel.send({ files: [{ attachment: simps[Math.floor(Math.random() * simps.length)], name: 'simp.png' }] })
}
if (content === "whobitch") {
msg.channel.send({ files: [{ attachment: bitchs[Math.floor(Math.random() * bitchs.length)], name: 'bitch.png' }] })
}
});
client.login(process.env.AUTH_TOKEN);