-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJokeBot.js
46 lines (40 loc) · 1.54 KB
/
JokeBot.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
const Discord = require("discord.js");
const client = new Discord.Client();
var jokes = ["Joke1", "Joke2", "Joke3"];
client.on("ready", () => {
console.log("I am ready!");
});
client.on("message", (message) => {
if (message.content.startsWith("give me a joke")) {
//var value = jOkE();
message.channel.send(jOkE());
}
});
client.login("token was here. Removed for privacy!");
// Set the prefix
const prefix = "~";
client.on("message", (message) => {
// Exit and stop if it's not there
if (!message.content.startsWith(prefix)) return;
if (message.content.startsWith(prefix + "joke")) {
message.channel.send("potato!");
} else
if (message.content.startsWith(prefix + "foo")) {
message.channel.send("bar!");
}
});
function jOkE() {
var test = "Why did the scarecrow win the Nobel Prize? A: He was out standing in his field.";
var go = "YoUr LiFe";
var here = "Omar and his tacos";
var was = "What would George Washington do if he were alive today? Scream and scratch at the top of his coffin.";
var Rayyan = "Where is the worst place to play hide and seek in a hospital ? In the I.C.U.";
var a = "just shut up already";
var b = "wake up your idea";
var c = "Get your lazy body off that bed";
var d = "Your mama so fat, she needs two watches for the different time zones";
var values = [test, go, here, was, Rayyan, a, b, c, d];
valueToUse = values[Math.floor(Math.random() * values.length)];
// do something with the selected value
return valueToUse;
}