-
Notifications
You must be signed in to change notification settings - Fork 6
/
mcbot.js
203 lines (192 loc) · 7.93 KB
/
mcbot.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
require("dotenv").config();
const fetch = require("node-fetch");
const { Client, GatewayIntentBits } = require("discord.js");
const client = new Client({
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMembers,
GatewayIntentBits.GuildMessages,
],
});
client.login(process.env.MCBOTTOKEN);
async function gotMcMessage(msg) {
console.log(msg);
if (msg.channel.id == "822710399152553994") {
let tokens = msg.content.split(" ");
if (msg.content == "mc") {
msg.channel.send("मैं एम.सी बॉट आपके खिदमत में हाजिर हूं 🙏");
} else if (msg.content == "apshabd ka oopyog kare") {
// const koibhi = Math.floor(Math.random() * replies.length);
// msg.channel.send(replies[koibhi]);
client.send("मैं एम.सी बॉट अब अच्छा बालक बन गया हूं");
} else if (tokens[0] == "!gif") {
let search = "dog";
if (tokens.length > 1) {
search = tokens.slice(1, tokens.length).join(" ");
}
let url = `https://g.tenor.com/v1/search?q=${search}&key=${process.env.TENORKEY}&contentfilter=high`;
let response = await fetch(url);
let json = await response.json();
console.log(json);
const indexno = Math.floor(Math.random() * json.results.length);
msg.channel.send(json.results[indexno].url);
}
}
}
function automsg() {
let day = new Date();
let utcDay = day.getUTCDay();
let utchours = day.getUTCHours();
let utcMinutes = day.getUTCMinutes();
let changeDay = "";
if (utchours >= 17 && utcMinutes >= 29) {
changeDay = utcDay + 1;
}
if (utchours >= 00 && utcMinutes >= 00) {
changeDay = utcDay - 1;
}
// Moday Table--------------
if (changeDay == 1) {
if (utchours == 3 && utcMinutes == 20) {
client.send(
"राम राम जी 🙏\n\nMr.Saurabh Gupta (OS)\nMeet: https://meet.google.com/lookup/ctv6kwrdcp?authuser=1&hs=179"
);
} else if (utchours == 4 && utcMinutes == 30) {
client.send(
"Mr.Tanuj Kumar (PQT)\nMeet: https://meet.google.com/lookup/c2eauseakw?authuser=1&hs=179"
);
} else if (utchours == 4 && utcMinutes == 36) {
console.log("plz");
client.send("test pass");
} else if (utchours == 5 && utcMinutes == 30) {
client.send(
"Mr. Amit (CC)\nMeet: https://meet.google.com/lookup/eglcp4njhs?authuser=1&hs=179"
);
} else if (utchours == 8 && utcMinutes == 10) {
client.send(
"Kanika Garg (SEPM)\nMeet: https://meet.google.com/lookup/ef4rgsip3e?authuser=1&hs=179"
);
} else if (utchours == 9 && utcMinutes == 00) {
client.send(
"Batch 1\nMr. Abhishek Chauhan (CC Lab)\nMeet: https://meet.google.com/lookup/eglcp4njhs?authuser=1&hs=179 \n\nBatch 2\nMr Anurag Singh/ Rajiv Ranjan\nMeet: https://meet.google.com/lookup/gkmtyn7lwr"
);
}
}
// Tuesday Table------------
if (changeDay == 2) {
if (utchours == 3 && utcMinutes == 20) {
client.send(
"राम राम जी 🙏\n\nMr.Tanuj Kumar (PQT)\nMeet: https://meet.google.com/lookup/c2eauseakw?authuser=1&hs=179"
);
} else if (utchours == 4 && utcMinutes == 30) {
client.send(
"Arti Sharma (CPS -1)\nMeet: https://meet.google.com/lookup/e6obb4y2fu?authuser=1&hs=179"
);
} else if (utchours == 5 && utcMinutes == 30) {
client.send(
"Rajiva Ranjan (APP)\nMeet: https://meet.google.com/lookup/fw3ddngntg"
);
} else if (utchours == 6 && utcMinutes == 30) {
client.send(
"Mr. Jay Prakash Chaubey (Social)\nMeet: https://meet.google.com/lookup/bokoyk4c4v"
);
} else if (utchours == 8 && utcMinutes == 10) {
client.send(
"Kanika Garg (SEPM)\nMeet: https://meet.google.com/lookup/ef4rgsip3e?authuser=1&hs=179"
);
} else if (utchours == 9 && utcMinutes == 00) {
client.send(
"Batch 1:\nMr.Himanshu/ Jeetu (DAA)\nMeet: https://meet.google.com/lookup/b7oecgbbyn \n\nBatch 2\nSaurabh/ Sachi Pandey (OS Lab)\nMeet: https://meet.google.com/lookup/ctv6kwrdcp"
);
}
}
//Wednesday Table----------
if (changeDay == 3) {
if (utchours == 3 && utcMinutes == 20) {
client.send(
"राम राम जी 🙏\n\nMr.Saurabh Gupta (OS)\nMeet: https://meet.google.com/lookup/ctv6kwrdcp?authuser=1&hs=179"
);
} else if (utchours == 4 && utcMinutes == 30) {
client.send(
"Mr.Tanuj Kumar (PQT)\nMeet: https://meet.google.com/lookup/c2eauseakw?authuser=1&hs=179"
);
} else if (utchours == 5 && utcMinutes == 30) {
client.send(
"Rajiva Ranjan (APP)\nMeet: https://meet.google.com/lookup/fw3ddngntg\n\nBatch 2\nMr.Anurag Singh\nMeet: https://meet.google.com/lookup/gkmtyn7lwr"
);
} else if (utchours == 6 && utcMinutes == 30) {
client.send(
"Mr.Himanshu Sekhara (DAA)\nMeet: https://meet.google.com/lookup/b7oecgbbyn"
);
} else if (utchours == 8 && utcMinutes == 10) {
client.send(
"Mr. Amit (CC)\nMeet: https://meet.google.com/lookup/eglcp4njhs?authuser=1&hs=179"
);
} else if (utchours == 9 && utcMinutes == 00) {
client.send(
"Batch 1\nSaurabh Gupta/ Kanika Garg (OS)\nMeet: https://meet.google.com/lookup/ctv6kwrdcp \n\nBatch 2\nKanika Garg/ Ruby Singh (SEPM)\nMeet: https://meet.google.com/lookup/ef4rgsip3e"
);
}
}
//Thursday Table------------
if (changeDay == 4) {
if (utchours == 3 && utcMinutes == 20) {
client.send(
"राम राम जी 🙏\n\nMr.Tanuj Kumar (PQT)\nMeet: https://meet.google.com/lookup/c2eauseakw?authuser=1&hs=179"
);
} else if (utchours == 4 && utcMinutes == 30) {
client.send(
"Mr.Vinay Kumar Sharma (Critical Thinking)\nMeet: https://meet.google.com/lookup/gfzoqdepre"
);
} else if (utchours == 5 && utcMinutes == 30) {
client.send(
"Rajiva Ranjan (APP)\nMeet: https://meet.google.com/lookup/fw3ddngntg\n\nBatch 2\nMr.Anurag Singh\nMeet: https://meet.google.com/lookup/gkmtyn7lwr"
);
} else if (utchours == 6 && utcMinutes == 30) {
client.send(
"Mr.Himanshu Sekhara (DAA)\nMeet: https://meet.google.com/lookup/b7oecgbbyn"
);
} else if (utchours == 8 && utcMinutes == 10) {
client.send(
"Mr.Saurabh Gupta (OS)\nMeet: https://meet.google.com/lookup/ctv6kwrdcp?authuser=1&hs=179"
);
} else if (utchours == 9 && utcMinutes == 00) {
client.send(
"Batch 1\nKanika Garg/ Ruby Singh (SEPM)\nMeet: https://meet.google.com/lookup/ef4rgsip3e \n\nBatch 2\nHimanshu/ Jeetu (DAA)\nMeet: https://meet.google.com/lookup/b7oecgbbyn"
);
}
}
//Friday Table---------------
if (changeDay == 5) {
if (utchours == 3 && utcMinutes == 20) {
client.send(
"राम राम जी 🙏\n\nKanika Garg (SEPM)\nMeet: https://meet.google.com/lookup/ef4rgsip3e?authuser=1&hs=179"
);
} else if (utchours == 4 && utcMinutes == 30) {
client.send(
"Mr.Tanuj Kumar (PQT)\nMeet: https://meet.google.com/lookup/c2eauseakw?authuser=1&hs=179"
);
} else if (utchours == 5 && utcMinutes == 30) {
client.send(
"Arti Sharma (CPS -1)\nMeet: https://meet.google.com/lookup/e6obb4y2fu?authuser=1&hs=179"
);
} else if (utchours == 6 && utcMinutes == 30) {
client.send(
"Kalpana Patel (EVS)\nMeet: https://meet.google.com/lookup/dxynmk724s"
);
} else if (utchours == 8 && utcMinutes == 10) {
client.send(
"Mr.Himanshu Sekhara (DAA)\nMeet: https://meet.google.com/lookup/b7oecgbbyn"
);
} else if (utchours == 9 && utcMinutes == 00) {
client.send(
"Batch 1\nAnurag Singh/ Rajiv Ranjan (APP Lab)\nMeet: https://meet.google.com/lookup/gkmtyn7lwr \n\nBatch 2\nSatya Sai/ Abhishek Chauhan (CC Lab)\nMeet: https://meet.google.com/lookup/ep53rbrwtf"
);
}
}
}
client.on("ready", () => {
console.log("success");
automsg;
});
client.on("message", gotMcMessage);