-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.js
More file actions
196 lines (171 loc) · 6.7 KB
/
main.js
File metadata and controls
196 lines (171 loc) · 6.7 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
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
const Discord = require('discord.js');
const client = new Discord.Client();
var index = 0; //0: welcome, 1: food choice, 2: eat the bread?, 3: are you sure you want bread?, 4: what did you say?
var iteration = 0;
client.once('ready',()=>{
console.log('Bread Waiter is here.');
});
client.on('message', message => {
function eatingchoice(){
if(iteration==0){
message.channel.send(" ",{
files: [
"breaddefault.png"
]
});
}
generalMsg.send("What would you like to eat today?");
generalMsg.send({embed: {
description: "Ice cream\nHotpot\nChocolate\nBread\nAsk the bread waiter how it’s doing today",
}
});
}
function eatingchoice2(){
generalMsg.send("Anything else you'd like today?");
generalMsg.send({embed: {
description: "Ice cream\nHotpot\nChocolate\nBread\nAsk the bread waiter how it’s doing today",
}
});
if(iteration==0){
message.channel.send(" ",{
files: [
"concerned.png"
]
});
}
if(iteration==1){
message.channel.send(" ",{
files: [
"eat2.png"
]
});
}
if(iteration==2){
message.channel.send(" ",{
files: [
"eat5.png"
]
});
}
}
if(message.author.bot) return;
var generalMsg = message.guild.channels.cache.find(i => i.name === 'general');
if((message.content=== "Hello" || message.content === "Hi" || message.content === "hi" || message.content === "hello" || message.content === "yes" || message.content === "no") && index === 0){
generalMsg.send("Welcome to Loving Loaves, where every loaf of bread is baked with love!");
generalMsg.send({embed: {
description: "You smell an overwhelming scent of yeasty aroma.",
}
});
setTimeout(function(){
message.channel.send(" ",{
files: [
"tempbread.jpg"
]
});
}, 0);
generalMsg.send("Hello! I'll be your waiter for today (✿◠‿◠) 🍞");
setTimeout(eatingchoice, 500);
index++;
} else if (index == 1) {
switch(message.content.toLowerCase()) {
case "bread":
if (iteration === 0) {
generalMsg.send({embed: {
description: "Your bread waiter gives you bread. You don’t know where it got it from.",
}
});
generalMsg.send({embed: {
description: "Eat the bread? (Yes/No)",
}
});
index++;
}
if (iteration === 1) {
generalMsg.send("Are you sure you want bread?");
generalMsg.send({embed: {
description: "Yes\nNo",
}
});
index = 3;
}
if (iteration === 2) {
generalMsg.send({embed: {
description: "Your bread waiter goes to the back. After a couple minutes, you notice a piece of bread in front of you. You don’t know where it came from.",
}
});
generalMsg.send({embed: {
description: "Eat the bread? (Yes/No)",
}
});
index = 2;
}
break;
case "ask the bread waiter how it's doing today":
var msg = "";
if (iteration === 0) {
msg = "I’m feeling really toasty today!";
} else if (iteration === 1) {
msg = "I feel a little fuzzy inside!";
} else {
msg = "I’ve never felt lighter!";
}
generalMsg.send(msg);
eatingchoice();
break;
default:
generalMsg.send("Sorry, we don’t have any of that.");
generalMsg.send("Why don't you pick something else?");
eatingchoice();
break;
}
} else if (index === 2) {
if (message.content.toLowerCase() === "yes") {
generalMsg.send({embed: {
description: "The bread is soft and warm. It melts in your mouth.",
}
});
generalMsg.send({embed: {
description: "You still feel hungry.",
}
});
} else if (message.content.toLowerCase() === "no") {
generalMsg.send({embed: {
description: "You pocket the bread and feel hungry",
}
});
}
if (message.content.toLowerCase() === "no" || message.content.toLowerCase() === "yes") {
if (iteration != 2)
eatingchoice2();
index = 1;
iteration++;
}
if (iteration === 2) {
generalMsg.send({embed: {
description: "You hear the ringing of an oven timer come from the back of the restaurant.",
}
});
iteration = 0;
index = 0;
}
} else if (index === 3) {
if (message.content.toLowerCase() === "yes") {
generalMsg.send({embed: {
description: "Your bread waiter gives you bread. You don’t know where it came from.",
}
});
generalMsg.send({embed: {
description: "Eat the bread? (Yes/No)",
}
});
index = 2;
} else if (message.content.toLowerCase() === "no") {
eatingchoice2();
index = 1;
}
} else if (index === 4) {
if (message.content.toLowerCase() === "bread") {
}
}
});
client.login('ODQwNjk0MjIyMTg5MzYzMjQx.YJb7gQ.Q68LgpJOAUzeAokiceB24e6XtTs') //outdated of course