-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
69 lines (47 loc) · 2.47 KB
/
app.js
File metadata and controls
69 lines (47 loc) · 2.47 KB
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
// Load up the discord.js library
const Discord = require("discord.js");
// This is your client. Some people call it `bot`, some people call it `self`,
// some might call it `cootchie`. Either way, when you see `client.something`, or `bot.something`,
// this is what we're refering to. Your client.
const client = new Discord.Client();
// 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
// config.prefix contains the message prefix.
client.on("ready", () => {
// This event will run if the bot starts, and logs in, successfully.
console.log(`Bot has started, with ${client.users.size} users, in ${client.channels.size} channels of ${client.guilds.size} guilds.`);
// Example of changing the bot's playing game to something useful. `client.user` is what the
// docs refer to as the "ClientUser".
client.user.setGame(`Brainlet time!`);
});
var saidAlready = false;
client.on("message", message => {
// This event will run on every single message received, from any channel or DM.
console.log(saidAlready);
// It's good practice to ignore other bots. This also makes your bot ignore itself
// and not get into a spam loop (we call that "botception").
if(!message.author.bot && !saidAlready){ message.channel.send('Ready to brainlet!'); saidAlready = true;}
if(message.content === "What size is Lobster's brain?")
{
message.channel.send("Calculating...");
setTimeout(function() {message.channel.send("It's tiny!")}, 3000);}
console.log(message.author.username);
if (Math.random() < 0.001) message.react("🤔");
// if(message.author.username == 'EpicBoX') {
// var cantun = client.emojis.find("name", "cantunbox");
// var brainlet = client.emojis.find("name", "brainlet");
// if (Math.random() < 0.3) setTimeout(function() {message.react(cantun.id)}, 5000);
// if (Math.random() < 0.4) setTimeout(function() {message.react(brainlet.id)}, 7000);
// if (Math.random() < 0.05) message.react("🤐");
// }
var brainlet = client.emojis.find("name", "brainlet");
if(message.author.username == 'Irak_Løbster') {
if (Math.random() < 0.3) message.react("🤢");
if (Math.random() < 0.99) message.react(brainlet.id);
}
console.log(saidAlready);
// Also good practice to ignore any message that does not start with our prefix,
// which is set in the configuration file.
});
client.login(config.token);