-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.js
2472 lines (2284 loc) · 152 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
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
//const CoinGecko = require('coingecko-api');
//const CoinGeckoClient = new CoinGecko();
const fetch = require("node-fetch")
const secrets = require("./secrets.json")
const priceService = require("./priceupdater.js")
var falcon9price = 30000
var flamethrowerprice = 10000
var nftprice = 100000
var teslaprice = 30000
var goldprice = 10000
var houseprice = 30000
var twitterprice = 20000
var prefix = "el ";
var prefixlength = prefix.length;
const discord = require('discord.js');
const Discord = discord;
const client = new discord.Client({ disableMentions: 'everyone' });
const { MongoClient } = require('mongodb')
const uri = secrets.mongodb;
const mongoclient = new MongoClient(uri, {useUnifiedTopology: true });
var commandPerSecond = 0;
var commandPerMinute = [];
const emojis = {
"dogecoin": "<:dogecoin:972591861065711646>",
"doge": "<:doge:972598149518590042>",
"bitcoin": "<:bitcoin:972599884073041930>",
"gold": "<:gold:972601920801874001>",
"twitter": "<:twitter:972602483589406750>",
"tesla": "<:tesla:972603325356843048>",
"roblox": "<:roblox:972604124787003402>",
"theboringcompany": "<:theboringcompany:972604995381907546>",
"elon": "<:elon:972605676847251457>",
"blackberry": "<:blackberry:972606431830376468>",
"ethereum": "<:ethereum:972607077233098762>",
"litecoin": "<:litecoin:972607917331214376>",
}
mongoclient.connect(async function (err, mongoclient) {
await priceService();
client.login(secrets.discordBotToken);
var cooldowns = {}
client.once('ready', () => {
console.log(`Logged in as ${client.user.username}. Ready on ${client.guilds.cache.size} servers, for a total of ${client.users.cache.size} users`);
client.user.setActivity("Tweeting and manipulating the stock market");
})
client.on("message", message => {
if (message.author.bot || message.channel.type === 'dm') return;
if (message.content.toLowerCase().includes("undefined") || message.content.toLowerCase().includes("'undefined'") || message.content.toLowerCase().includes('"undefined"')) return;
test3().catch(console.error);
async function test3() {
await main().catch(console.error);
}
async function main() {
try {
if (err) console.log(err);
// the reason we didn't add another key that was something like "serverId" was because this way, people can't spam with 100 different servers.
if (!cooldowns[message.author.id]) {
cooldowns[message.author.id] = {
launder: 0,
sue: 0,
jobs: 0,
work: 0,
trade: 0,
flame: 0,
uber: 0,
rent: 0,
hobby: 0,
}
}
let dbCooldowns = await checkCooldown(mongoclient, "all");
if (!dbCooldowns[message.author.id]) {
await updateCooldowns(mongoclient, "all", {
[message.author.id]: {
work: 0,
jobs: 0,
flame: 0,
hobby: 0,
steal: 0,
misc: {
passive: 0
}
}
})
}
const db = mongoclient.db("elonbot");
await preflight()
async function preflight() {
if (!message.content.toLowerCase().includes(prefix)) return;
commandPerSecond++;
await signup(mongoclient);
let userData = await checkStuff(mongoclient, message.author.id);
if (!userData.misc) {
await updateDocumentSet(mongoclient, message.author.id, {
["misc.passive"]: false
})
}
if (!dbCooldowns[message.author.id].steal) {
let path = message.author.id + ".steal"
await mongoclient.db("elonbot").collection("cooldowns")
.updateOne({ name: "all" }, { $set: { [path]: 0 } })
}
if (!dbCooldowns[message.author.id].misc) {
let path = message.author.id + ".misc"
await mongoclient.db("elonbot").collection("cooldowns")
.updateOne({ name: "all" }, { $set: { [path]: {} } })
}
if (!userData.server) {
await updateDocumentSet(mongoclient, message.author.id, {
server: {}
})
}
if (!userData.server[message.guild.id]) {
let dataPath = "server." + message.guild.id
await mongoclient.db("elonbot").collection("everything")
.updateOne({ name: message.author.id }, { $set: { [dataPath]: "i" } })
}
if (!userData.inventory.small) {
await mongoclient.db("elonbot").collection("everything")
.updateOne({ name: message.author.id }, { $set: { "inventory.small": 0 } })
}
if (userData.tag !== message.author.tag) {
await updateDocumentSet(mongoclient, message.author.id, { tag: message.author.tag })
}
let y = Math.floor(Math.random() * 1000);
if (y < 2 && message.content.toLowerCase().startsWith(prefix)) {
var editThis = await message.channel.send("Woah! 0.1% chance that this happened! Elon just signed his name onto your chubby face! \n Type `Thank you daddy Elon!` Before he spanks you for not being grateful. (This only applies to the person who typed the command)")
let response = await selOption();
if (response.content.toLowerCase() === "thank you daddy elon!") {
message.channel.send("Noice! Elon gives you 10k doge, and you also take that selfie and gain 3k twitter followers.")
await mongoclient.db("elonbot").collection("everything")
.updateOne({ name: message.author.id }, { $inc: { "inventory.twitter": 3 } })
await mongoclient.db("elonbot").collection("everything")
.updateOne({ name: message.author.id }, { $inc: { "currency.doge": 10000 } })
editThis.edit("Woah! 0.1% chance that this happened! Elon just signed his name onto your chubby face! \n Type `Thank you daddy Elon!` Before he spanks you for not being grateful. (This only applies to the person who typed the command) \n**(This event has ended. No more submissions allowed)**")
return;
} else {
editThis.edit("Woah! 0.1% chance that this happened! Elon just signed his name onto your chubby face! \n Type `Thank you daddy Elon!` Before he spanks you for not being grateful. (This only applies to the person who typed the command) \n**(This event has ended. No more submissions allowed)**")
await mongoclient.db("elonbot").collection("everything")
.updateOne({ name: message.author.id }, { $inc: { "currency.doge": -1000 } })
return message.channel.send("Uh oh... Elon isn't pleased. He takes away ~~your life~~ 1000 doge");
}
function selOption() {
return new Promise(resolve => {
message.channel.awaitMessages(m => m.author.id === message.author.id,
{ max: 1, time: 15000 }).then(collected => {
resolve(collected.first());
}).catch(() => {
resolve("no time")
});
});
}
} else if (y < 5 && message.content.toLowerCase().startsWith(prefix)) {
var editThis = await message.channel.send("Pog, Extra rare event time! Elon's new rocket just blew up! Be the first to take a picture of it!\n Type `Quick! take that rocket selfie! Click Click Click!`")
for (var x = 0; x < 5; x++) {
if (x === 3) {
editThis.edit("Pog, Extra rare event time! Elon's new rocket just blew up! Be the first to take a picture of it!\n Type `Quick! take that rocket selfie! Click Click Click!` \n**(This event has ended. No more submissions allowed)**")
return message.channel.send("Your time window expired! Try to take that selfie a bit quicker next time...");
}
let response = await selOption();
if (response.content.toLowerCase() === "quick! take that rocket selfie! click click click!") {
message.channel.send(response.author.tag + " was the first to take dat selfie and post it. You gained 1k twitter followers, and your fans also sent you " + y + " gold");
await mongoclient.db("elonbot").collection("everything")
.updateOne({ name: message.author.id }, { $inc: { "inventory.twitter": 1 } })
await mongoclient.db("elonbot").collection("everything")
.updateOne({ name: message.author.id }, { $inc: { "inventory.gold": y } })
editThis.edit("Pog, Extra rare event time! Elon's new rocket just blew up! Be the first to take a picture of it!\n Type `Quick! take that rocket selfie! Click Click Click!` \n**(This event has ended. No more submissions allowed)**")
return;
} else {
continue;
}
function selOption() {
return new Promise(resolve => {
message.channel.awaitMessages(m => m,
{ max: 1, time: 30000 }).then(collected => {
resolve(collected.first());
}).catch(() => {
resolve("bad")
});
});
}
}
} else if (y < 10 && message.content.toLowerCase().startsWith(prefix)) {
var editThis = await message.channel.send("Common event time! Quick! Elon just tweeted about a stock! Buy and sell it to make 10000 doge by typing: \n `buy buy buy buy sell sell sell`");
for (var x = 0; x < 30; x++) {
if (x === 28) {
editThis.edit("Common event time! Quick! Elon just tweeted about a stock! Buy and sell it to make 10000 doge by typing: \n `buy buy buy buy sell sell sell` \n**(This event has ended. No more submissions allowed)**")
return message.channel.send("No one got it. Ya'll way too slow.");
}
let response = await selOption();
if (response.content.toLowerCase() === "buy buy buy buy sell sell sell") {
message.channel.send(response.author.tag + " just played a ponzi scheme, and made 10000 doge!");
await mongoclient.db("elonbot").collection("everything")
.updateOne({ name: message.author.id }, { $inc: { "currency.doge": 10000 } })
editThis.edit("Common event time! Quick! Elon just tweeted about a stock! Buy and sell it to make 10000 doge by typing: \n `buy buy buy buy sell sell sell` \n**(This event has ended. No more submissions allowed)**")
return;
} else {
continue;
}
}
function selOption() {
return new Promise(resolve => {
message.channel.awaitMessages(m => m,
{ max: 1, time: 30000 }).then(collected => {
resolve(collected.first());
}).catch(() => {
resolve("bad")
});
});
}
}
return;
}
if (message.content.toLowerCase().startsWith(prefix + "launder") || message.content.toLowerCase() === prefix + "la") {
if (cooldowns[message.author.id].launder < Date.now()) {
var add = 0;
let user = await checkStuff(mongoclient, message.author.id);
if (user.hobby === "hacker") {
add = Math.floor(Math.random() * 200);
}
delete cooldowns[message.author.id].launder;
var minute = 60000;
var hour = minute * 24;
//Set cooldown
cooldowns[message.author.id].launder = Date.now() + 15000; //Set a 15 hour cooldown
let x = Math.floor(Math.random() * 300);
if (x < 50) {
message.channel.send("No money for you");
return;
} else {
message.channel.send("Your money laundering service produced you " + (x + add) + " dogecoin");
}
await mongoclient.db("elonbot").collection("everything")
.updateOne({ name: message.author.id }, { $inc: { "currency.doge": (x + add) } })
}
else return message.channel.send("Spams not cool. Especailly when dealing with money. You still have to wait: " + Math.round((cooldowns[message.author.id].launder - Date.now()) / 1000) + " seconds before you can use this command again")
}
if (message.content.toLowerCase().startsWith(prefix + "sue") || message.content.startsWith(prefix + "su")) {
if (cooldowns[message.author.id].sue < Date.now()) {
if (!message.mentions.users.first()) {
cooldowns[message.author.id].sue = 0;
return message.channel.send("You need to mention someone to sue!")
}
if (message.mentions.users.first().id === message.author.id) {
cooldowns[message.author.id].sue = 0;
return message.channel.send("You really want to sue yourself? Wow I always knew you were stupid, just not *this* stupid.")
}
let userData = await checkStuff(mongoclient, message.author.id);
let defendant = await checkStuff(mongoclient, message.mentions.users.first().id)
if (!defendant) { cooldowns[message.author.id].sue = 0; return message.channel.send("That user isn't alive yet. Go make them type *any* message and then I will create something *just* for them") }
if (userData.misc.passive === true) { cooldowns[message.author.id].sue = 0; return message.channel.send("You're on passive mode right now! To sue someone, take it off with `el set passive false`") };
if (!defendant.misc) { defendant.misc = {}; defendant.misc.passive = false; }
if (defendant.misc.passive === true) { cooldowns[message.author.id].sue = 0; return message.channel.send("What's wrong with you? The person you were trying to sue wants to be left alone right now.") }
var threshold = 400;
if (userData.hobby === "lawyer" && defendant.hobby === "lawyer") {
threshold = 400;
} else if (userData.hobby === "lawyer") {
threshold = 600;
} else if (defendant.hobby === "laywer") {
threshold = 200;
}
delete cooldowns[message.author.id].sue;
var minute = 60000;
//Set cooldown
cooldowns[message.author.id].sue = Date.now() + 60000; //Set a 60 sec cooldown
let x = Math.floor(Math.random() * 1000);
if (x < threshold) {
message.channel.send("You lost the case, and had to pay the defendent " + message.mentions.users.first().tag + " `300` doge coin for the time that they wasted with you");
await mongoclient.db("elonbot").collection("everything")
.updateOne({ name: message.author.id }, { $inc: { "currency.doge": -300 } })
let previousPerson = await checkStuff(mongoclient, message.mentions.users.first().id)
if (!previousPerson) return message.channel.send("The person you tried to sue doesn't have their acount set up yet! To make this work, spam ping them and make them type a message")
await mongoclient.db("elonbot").collection("everything")
.updateOne({ name: message.mentions.users.first().id }, { $inc: { "currency.doge": -300 } })
return;
} else {
await mongoclient.db("elonbot").collection("everything")
.updateOne({ name: message.author.id }, { $inc: { "currency.doge": x } })
let previousPerson = await checkStuff(mongoclient, message.mentions.users.first().id)
if (!previousPerson) return message.channel.send("The person you tried to sue doesn't have their acount set up yet! To make this work, spam ping them and make them type a message")
await mongoclient.db("elonbot").collection("everything")
.updateOne({ name: message.mentions.users.first().id }, { $inc: { "currency.doge": -x } })
message.channel.send("Nice! You won the case and got paid `" + x + "`doge coin!");
}
}
else return message.channel.send("Spams not cool. Especailly when dealing with money. You still have to wait: " + Math.round((cooldowns[message.author.id].sue - Date.now()) / 1000) + " seconds before you can use this command again")
}
if (message.content.toLowerCase().startsWith(prefix + "bal")) {
var balance;
var tag;
if (message.mentions.users.first()) { balance = await checkStuff(mongoclient, message.mentions.users.first().id); tag = message.mentions.users.first().tag }
else { balance = await checkStuff(mongoclient, message.author.id); tag = message.author.tag }
if (!balance) return message.channel.send("That user isn't alive yet. (Hasn't typed anything yet) If you need to know, they have 0 of everything.");
if (!balance.currency.ltc && tag === message.author.tag) {
await mongoclient.db("elonbot").collection("everything")
.updateOne({ name: message.author.id }, { $set: { "currency.ltc": 0 } })
balance.currency.ltc = 0;
} else if (!balance.currency.ltc && tag === message.mentions.users.first().tag) {
await mongoclient.db("elonbot").collection("everything")
.updateOne({ name: message.mentions.users.first().id }, { $set: { "currency.ltc": 0 } })
balance.currency.ltc = 0;
}
let prices = global.cryptoPrices
let dogePrice = Number(prices.dogecoin.usd)
let ethPrice = Number(prices.ethereum.usd)
let btcPrice = Number(prices.bitcoin.usd)
let ltcPrice = Number(prices.litecoin.usd)
let totalUSD = Math.round((Number(ethPrice) * Number(balance.currency.eth)) + (Number(btcPrice) * Number(balance.currency.btc)) + (Number(dogePrice) * Number(balance.currency.doge)) + Number(balance.currency.usd) + (Number(ltcPrice) * Number(balance.currency.ltc)))
let amountOfDoge = Math.round(balance.currency.doge);
let equivalantDoge = Math.round(dogePrice * balance.currency.doge)
let amountOfUsd = Math.round(balance.currency.usd)
let amountOfBtc = Math.round(1000 * balance.currency.btc) / 1000
let equivalantBtc = Math.round(btcPrice * balance.currency.btc)
let amountOfEth = Math.round(100 * balance.currency.eth) / 100
let equivalantEth = Math.round(ethPrice * balance.currency.eth);
let amountOfLtc = Math.round(100 * balance.currency.ltc) / 100;
let equivalantLtc = Math.round(ltcPrice * balance.currency.ltc);
totalUSD = makeReadable(totalUSD);
amountOfDoge = makeReadable(amountOfDoge);
equivalantDoge = makeReadable(equivalantDoge);
amountOfUsd = makeReadable(amountOfUsd);
amountOfBtc = makeReadable(amountOfBtc);
equivalantBtc = makeReadable(equivalantBtc);
amountOfEth = makeReadable(amountOfEth);
equivalantEth = makeReadable(equivalantEth);
amountOfLtc = makeReadable(amountOfLtc);
equivalantLtc = makeReadable(equivalantLtc)
function makeReadable(total) {
if (total.toString().length > 12) { total = total.toLocaleString("en-US").toString(); total = total.slice(0, total.length - 12) + " Billion" }
else if (total.toString().length > 9) { total = total.toLocaleString("en-US").toString(); total = total.slice(0, total.length - 8) + " Million" }
else if (total.toString().length > 6) { total = total.toLocaleString("en-US").toString(); total = total.slice(0, total.length - 4) + "K" }
else if (total.toString().length > 3) {
total = total.toLocaleString("en-US");
}
return total;
}
let output = new Discord.MessageEmbed()
.setTitle(tag + "'s current wallet")
.setColor("#9098a6")
.addFields(
{ name: amountOfDoge + " Doge coin", value: "= " + equivalantDoge + " usd" },
{ name: amountOfUsd + " USD", value: "= " + amountOfUsd + " usd" },
{ name: amountOfBtc + " BTC", value: "= " + equivalantBtc + " usd" },
{ name: amountOfEth + " ETH", value: "= " + equivalantEth + " usd" },
{ name: amountOfLtc + " LTC", value: "= " + equivalantLtc + " usd" },
{ name: "Total in USD", value: totalUSD },
)
message.channel.send(output)
}
if (message.content.toLowerCase().startsWith(prefix + "job")) {
if (dbCooldowns[message.author.id].jobs < Date.now()) {
var minute = 60000;
//Set cooldown
let path = message.author.id + ".jobs"
await mongoclient.db("elonbot").collection("cooldowns")
.updateOne({ name: "all" }, { $set: { [path]: Date.now() + 7200000 } })
let output = new Discord.MessageEmbed()
.setTitle("Choose a Job")
.setColor("#9098a6")
.addFields(
{ name: "SpaceX jobs", value: `1. Coder - ${emojis.dogecoin} 1,000\n2. Accountant - ${emojis.dogecoin} 600\n3. Flight Computer - ${emojis.dogecoin} 10,000 ||Half chance of dying||` },
{ name: "Tesla Jobs", value: `4. Engineer - ${emojis.dogecoin} 950\n5. Accountant - ${emojis.dogecoin} 650\n6. Test Driver - ${emojis.dogecoin} 8,000 ||Quarter chance of dying||` },
{ name: "Miscelanious", value: `7. Babysiting X Æ A-XII - ${emojis.dogecoin} 850` },
{ name: "Additional Info", value: "-To choose a job send the message corresponding to it (or type cancel to cancel the operation)" },
)
message.channel.send(output)
//let x = await selOption();
for (var x = 0; x < 5; x++) {
if (x === 3) {
message.channel.send("Too many failed attempts, please retype the command!");
return;
}
let option = await selOption();
if (option === "cancel") {
message.channel.send("Canceled.");
return;
}
if (Number(option) < 1 || Number(option) > 7) {
message.channel.send("That isn't an option, enter a valid number");
let path = message.author.id + ".jobs"
await mongoclient.db("elonbot").collection("cooldowns")
.updateOne({ name: "all" }, { $set: { [path]: 0 } })
return;
} else {
updateDocumentSet(mongoclient, message.author.id, { job: Number(option) })
if (Number(option) < 4) {
if (option === "1") message.channel.send("You are now working at SpaceX as an coder, making 1000 doge an hour");
if (option === "2") message.channel.send("You are now working at SpaceX as an accountant, making 600 doge an hour");
if (option === "3") message.channel.send("You are now working at SpaceX as a flight computer, making 10k doge an hour");
} else if (Number(option) < 7) {
if (option === "4") message.channel.send("You are now working at Tesla as an engineer, making 950 doge an hour");
if (option === "5") message.channel.send("You are now working at Tesla as an accountant, making 650 doge an hour");
if (option === "6") message.channel.send("You are now working at Tesla as a test driver, making 8k doge an hour");
} else if (option === "7") message.channel.send("You are now working for Elon as a baby siter, making 850 doge an hour");
else {
message.channel.send("That isn't an option, enter a valid number");
let path = message.author.id + ".jobs"
await mongoclient.db("elonbot").collection("cooldowns")
.updateOne({ name: "all" }, { $set: { [path]: 0 } })
return;
}
break;
}
}
function selOption() {
return new Promise(resolve => {
message.channel.awaitMessages(m => m.author.id === message.author.id,
{ max: 1, time: 30000 }).then(collected => {
resolve(collected.first().content);
}).catch(() => {
message.channel.send('No answer after 30 seconds, operation canceled.');
});
});
}
} else return message.channel.send("To get a new job, you have to wait: " + Math.round((dbCooldowns[message.author.id].jobs - Date.now()) / 60000) + " minutes before you can use this command again")
}
if (message.content.toLowerCase().startsWith(prefix + "work")) {
if (dbCooldowns[message.author.id].work < Date.now()) {
var minute = 60000;
//Set cooldown
let path = message.author.id + ".work"
await mongoclient.db("elonbot").collection("cooldowns")
.updateOne({ name: "all" }, { $set: { [path]: Date.now() + 3600000 } })
let person = await checkStuff(mongoclient, message.author.id);
let boost = (person.inventory.twitter * 0.05) + 1
let jobNum = person.job;
if (jobNum === 1) {
var code = ['if (user.cookies.accept) cookies.record() else cookies.record()', 'python sucks', 'return halp;', 'c++ is king', 'visual studios', 'bugs suck'];
let x = Math.floor(Math.random() * 6);
message.channel.send("Quick! Type the following words in the chat: \n`" + code[x] + "`");
let response = await selOption();
let elon = await checkStuff(mongoclient, message.author.id);
if (elon.hobby === "elon") {
message.channel.send("since you're elon's child, you get an extra 200 doge!")
await mongoclient.db("elonbot").collection("everything")
.updateOne({ name: message.author.id }, { $set: { currency: { doge: (elon.currency.doge + 200), usd: elon.currency.usd, btc: elon.currency.btc, eth: elon.currency.eth } } })
}
if (response.toLowerCase() === code[x]) {
let increase = 1000 * boost
message.channel.send("Great job! For that hour of work, you get " + increase + " Doge!");
await mongoclient.db("elonbot").collection("everything")
.updateOne({ name: message.author.id }, { $inc: { "currency.doge": increase } })
} else {
let increase = 322 * boost
message.channel.send("How did you mess up that simple of a task?! I'm only giving you " + increase + " doge for that hour of work. I'm expecting to not see this mistake happen ever again.");
await mongoclient.db("elonbot").collection("everything")
.updateOne({ name: message.author.id }, { $inc: { "currency.doge": increase } })
}
function selOption() {
return new Promise(resolve => {
message.channel.awaitMessages(m => m.author.id === message.author.id,
{ max: 1, time: 30000 }).then(collected => {
resolve(collected.first().content);
}).catch(() => {
resolve("bad")
});
});
}
} else if (jobNum === 2) {
let elon = await checkStuff(mongoclient, message.author.id)
let x = Math.floor(Math.random() * 11);
let y = Math.floor(Math.random() * 11);
message.channel.send("Time to crunch some numbers! Enter the solution to the equation below: \n " + x + "x" + y);
let response = await selOption();
if (elon.hobby === "elon") {
message.channel.send("since you're elon's child, you get an extra 200 doge!")
await mongoclient.db("elonbot").collection("everything")
.updateOne({ name: message.author.id }, { $set: { currency: { doge: (elon.currency.doge + 200), usd: elon.currency.usd, btc: elon.currency.btc, eth: elon.currency.eth } } })
}
if (Number(response) === x * y) {
let increase = 600 * boost
message.channel.send("Great job! You get " + increase + " doge for that hour of work!");
await mongoclient.db("elonbot").collection("everything")
.updateOne({ name: message.author.id }, { $inc: { "currency.doge": increase } })
} else {
let increase = 100 * boost
message.channel.send("What the heck? How did you mess that up?! I'm only giving you " + increase + " doge for that hour of work");
await mongoclient.db("elonbot").collection("everything")
.updateOne({ name: message.author.id }, { $inc: { "currency.doge": increase } })
}
function selOption() {
return new Promise(resolve => {
message.channel.awaitMessages(m => m.author.id === message.author.id,
{ max: 1, time: 30000 }).then(collected => {
resolve(collected.first().content);
}).catch(() => {
resolve("halp")
});
});
}
} else if (jobNum === 3) {
let elon = await checkStuff(mongoclient, message.author.id)
let x = Math.floor(Math.random() * 100);
let edit = await message.channel.send("3...")
await sleep(1000);
await edit.edit("2...");
await sleep(1000);
await edit.edit("1...")
await sleep(1000);
await message.channel.send("And liftoff!")
await sleep(5000);
if (x < 50) {
await message.channel.send("Wait nvm, it crashed. Welp, time to hire another flight computer since our other one died.")
let lifesaver = await checkStuff(mongoclient, message.author.id)
let num = lifesaver.inventory.gold;
if (num > 0) {
message.channel.send("At least you had a life saver (gold) You didn't die");
previous = lifesaver;
await mongoclient.db("elonbot").collection("everything")
.updateOne({ name: message.author.id }, { $inc: { "inventory.gold": -1 } })
return;
}
await mongoclient.db("elonbot").collection("everything")
.updateOne({ name: message.author.id }, {
$set: {
currency: {
usd: 0,
doge: 0,
btc: 0,
eth: 0,
},
stocks: {
tesla: 0,
space: 0,
roblox: 0,
boring: 0,
gameStonks: 0,
elonstock: 0
},
inventory: {
rockets: 0,
flamthrowers: 0,
nft: 0,
teslas: 0,
gold: 0,
houses: 0,
twitter: 0
}
}
})
} else {
let increasesmall = 10 * boost;
let increase = 10000 * boost
await message.channel.send("Mission Success! Our flight computer just got paid " + increasesmall + "k doge.");
if (elon.hobby === "elon") {
message.channel.send("since you're elon's child, you get an extra 200 doge!")
await mongoclient.db("elonbot").collection("everything")
.updateOne({ name: message.author.id }, { $inc: { "currency.doge": 200 } })
}
await mongoclient.db("elonbot").collection("everything")
.updateOne({ name: message.author.id }, { $inc: { "currency.doge": increase } })
}
} else if (jobNum === 4) {
let elon = await checkStuff(mongoclient, message.author.id)
let phrases = ["braking", "self driving cars", "batteries", "right to repair is a joke", "machine learning is great for self driving cars", "cruise control is great"];
let x = Math.floor(Math.random() * 6);
message.channel.send("For this hour of work, type the following phrases into chat: \n `" + phrases[x] + "`");
let response = await selOption();
if (elon.hobby === "elon") {
message.channel.send("since you're elon's child, you get an extra 200 doge!")
await mongoclient.db("elonbot").collection("everything")
.updateOne({ name: message.author.id }, { $set: { currency: { doge: (elon.currency.doge + 200), usd: elon.currency.usd, btc: elon.currency.btc, eth: elon.currency.eth } } })
}
if (response.toLowerCase() === phrases[x]) {
let increase = 950 * boost;
message.channel.send("great job! For that hour of work, you get " + increase + " Doge coins");
await mongoclient.db("elonbot").collection("everything")
.updateOne({ name: message.author.id }, { $inc: { "currency.doge": increase } })
} else {
let fire = Math.floor(Math.random() * 6);
if (fire < 3) {
message.channel.send("Wow, you failed at the most simple task! Ur fired. ")
updateDocumentSet(mongoclient, message.author.id, { job: 100 })
} else {
message.channel.send("Seriously, how did you mess *that* up? I'm only giving you 10 doge for that hour of work");
await mongoclient.db("elonbot").collection("everything")
.updateOne({ name: message.author.id }, { $inc: { "currency.doge": 10 } })
}
}
function selOption() {
return new Promise(resolve => {
message.channel.awaitMessages(m => m.author.id === message.author.id,
{ max: 1, time: 30000 }).then(collected => {
resolve(collected.first().content);
}).catch(() => {
resolve("bad")
});
});
}
} else if (jobNum === 5) {
let elon = await checkStuff(mongoclient, message.author.id)
let x = Math.floor(Math.random() * 99);
let y = Math.floor(Math.random() * 99);
message.channel.send("Time to crunch some numbers! Enter the solution to the equation below: \n " + x + "x" + y);
let response = await selOption();
if (elon.hobby === "elon") {
message.channel.send("since you're elon's child, you get an extra 200 doge!")
await mongoclient.db("elonbot").collection("everything")
.updateOne({ name: message.author.id }, { $set: { currency: { doge: (elon.currency.doge + 200), usd: elon.currency.usd, btc: elon.currency.btc, eth: elon.currency.eth } } })
}
if (Number(response) === x * y) {
let increase = 650 * boost
message.channel.send("Great job! You get " + increase + " doge for that hour of work!");
await mongoclient.db("elonbot").collection("everything")
.updateOne({ name: message.author.id }, { $inc: { "currency.doge": increase } })
} else {
let increase = 100 * boost
message.channel.send("What the heck? How did you mess that up?! I'm only giving you " + increase + " doge for that hour of work");
await mongoclient.db("elonbot").collection("everything")
.updateOne({ name: message.author.id }, { $inc: { "currency.doge": increase } })
}
function selOption() {
return new Promise(resolve => {
message.channel.awaitMessages(m => m.author.id === message.author.id,
{ max: 1, time: 30000 }).then(collected => {
resolve(collected.first().content);
}).catch(() => {
resolve("halp")
});
});
}
} else if (jobNum === 6) {
let elon = await checkStuff(mongoclient, message.author.id)
let x = Math.floor(Math.random() * 100);
if (elon.hobby === "elon") {
message.channel.send("since you're elon's child, you get an extra 200 doge!")
await mongoclient.db("elonbot").collection("everything")
.updateOne({ name: message.author.id }, { $set: { currency: { doge: (elon.currency.doge + 200), usd: elon.currency.usd, btc: elon.currency.btc, eth: elon.currency.eth } } })
}
if (x < 25) {
message.channel.send("You were a test driver for Tesla (keyword: `were`)")
let lifesaver = await checkStuff(mongoclient, message.author.id)
let num = lifesaver.inventory.gold;
if (num > 0) {
message.channel.send("At least you had a life saver (gold) You didn't die");
previous = lifesaver;
await mongoclient.db("elonbot").collection("everything")
.updateOne({ name: message.author.id }, { $inc: { "inventory.gold": -1 } })
return;
}
await mongoclient.db("elonbot").collection("everything")
.updateOne({ name: message.author.id }, {
$set: {
currency: {
usd: 0,
doge: 0,
btc: 0,
eth: 0,
},
stocks: {
tesla: 0,
space: 0,
roblox: 0,
boring: 0,
gameStonks: 0,
elonstock: 0
},
inventory: {
rockets: 0,
flamthrowers: 0,
nft: 0,
teslas: 0,
gold: 0,
houses: 0,
twitter: 0
}
}
})
} else {
let increasesmall = 8 * boost;
let increase = 8000 * boost
message.channel.send("Congrats! You survived! You get " + increasesmall + "k doge for that hour of work!");
await mongoclient.db("elonbot").collection("everything")
.updateOne({ name: message.author.id }, { $inc: { "currency.doge": increase } })
}
} else if (jobNum === 7) {
let elon = await checkStuff(mongoclient, message.author.id)
if (elon.hobby === "elon") {
message.channel.send("since you're elon's child, you get an extra 200 doge!")
await mongoclient.db("elonbot").collection("everything")
.updateOne({ name: message.author.id }, { $set: { currency: { doge: (elon.currency.doge + 200), usd: elon.currency.usd, btc: elon.currency.btc, eth: elon.currency.eth } } })
}
message.channel.send("Quick! X Æ A-XII is starting to cry! Type the following phrase into the chat: \n `Rock-a-bye baby in the tree top. When the wind blows the cradle will rock. When the bough breaks, the cradle will fall. And down will come Baby, Cradle and all.`")
let response = await selOption();
if (response === "Rock-a-bye baby in the tree top. When the wind blows the cradle will rock. When the bough breaks, the cradle will fall. And down will come Baby, Cradle and all.") {
let increase = 850 * boost;
message.channel.send("Congrats! The baby is now asleep and Elon comes in and rewards you with " + increase + " Doge!");
await mongoclient.db("elonbot").collection("everything")
.updateOne({ name: message.author.id }, { $inc: { "currency.doge": increase } })
} else {
let increase = 80 * boost
message.channel.send("X Æ A-XII is now rampaging through Elon's mansion, and then Elon comes in and is 'sorely disappointed' You only get " + increase + " Doge for that hour of grueling work");
await mongoclient.db("elonbot").collection("everything")
.updateOne({ name: message.author.id }, { $inc: { "currency.doge": increase } })
}
function selOption() {
return new Promise(resolve => {
message.channel.awaitMessages(m => m.author.id === message.author.id,
{ max: 1, time: 30000 }).then(collected => {
resolve(collected.first().content);
}).catch(() => {
resolve("halp")
});
});
}
} else {
let path = message.author.id + ".work"
await mongoclient.db("elonbot").collection("cooldowns")
.updateOne({ name: "all" }, { $set: { [path]: 0 } })
return message.channel.send("You currently don't have a job! To get one, do `el jobs`")
}
} else return message.channel.send("To work again, you have to wait: " + Math.round((dbCooldowns[message.author.id].work - Date.now()) / 60000) + " minutes before you can use this command again")
}
if (message.content.toLowerCase().startsWith(prefix + "trade")) {
if (cooldowns[message.author.id].trade < Date.now()) {
delete cooldowns[message.author.id].trade;
var minute = 60000;
//Set cooldown
cooldowns[message.author.id].trade = Date.now() + 60000; //Set a 1 hour cooldown
if (message.content.toLowerCase().match(/\d+/) === null) {
cooldowns[message.author.id].trade = 0;
return message.channel.send("I didn't detect a number in there! The correct syntax is: `el trade **thing** **amount**`")
}
thenum = message.content.toLowerCase().match(/\d+/)[0]
var coin;
if (message.content.toLowerCase().includes("doge")) {
message.channel.send("OK! What do you want to use to buy your " + thenum + " doge with?")
coin = "doge"
} else if (message.content.toLowerCase().includes("bit") || message.content.toLowerCase().includes("btc")) {
message.channel.send("OK! What do you want to buy your " + thenum + " Bitcoin with?")
coin = "btc"
} else if (message.content.toLowerCase().includes("eth")) {
message.channel.send("OK! What do you want to buy your " + thenum + " Ethereum with?");
coin = "eth"
} else if (message.content.toLowerCase().includes("usd")) {
message.channel.send("OK! What do you want to buy your " + thenum + " United states Dollar with?");
coin = "usd"
} else if (message.content.toLowerCase().includes("tesla")) {
message.channel.send("OK! What do you want to buy your " + thenum + " tesla stocks with?");
coin = "tesla"
} else if (message.content.toLowerCase().includes("space")) {
message.channel.send("OK! What do you want to buy your " + thenum + " SpaceX stocks with?");
coin = "space"
} else if (message.content.toLowerCase().includes("bor")) {
message.channel.send("OK! What do you want to buy your " + thenum + " Boring Company stocks with?");
coin = "bor"
} else if (message.content.toLowerCase().includes("elon")) {
message.channel.send("OK! What do you want to buy your " + thenum + " elon stocks with?");
coin = "ingame"
} else if (message.content.toLowerCase().includes("roblox")) {
message.channel.send("OK! What do you want to buy your " + thenum + " Roblox stocks with?");
coin = "roblox"
} else if (message.content.toLowerCase().includes("game") || message.content.toLowerCase().includes("gme")) {
message.channel.send("OK! What do you want to buy your " + thenum + " Game stop stocks with?");
coin = "game"
} else if (message.content.toLowerCase().includes("ltc") || message.content.toLowerCase().includes("lite")) {
message.channel.send("OK! What do you want to buy your " + thenum + " Litecoin with?");
coin = "ltc"
} else if (message.content.toLowerCase().includes("bb") || message.content.toLowerCase().includes("black")) {
message.channel.send("OK! What do you want to buy your " + thenum + " BlackBerry Stocks with?");
coin == "bb"
}
let options = new Discord.MessageEmbed()
.setTitle("Menu")
.setColor("#9098a6")
.addFields(
{ name: "Currencies", value: " 1. Dogecoin\n2. USD \n3. BTC\n4. ETH\n 11. LTC" },
{ name: "Stocks", value: "5. Tesla\n6. SpaceX (not public yet)\n7. Roblox\n8. Boring Company (Not public yet)\n9. Game Stonks\n10. Elon Stocks\n 12. Blackberry" },
)
message.channel.send(options)
let x = await selOption();
if (Number(x).toString().toLowerCase() === "nan") {
return message.channel.send("That wasn't a valid option, please try again.");
} else {
if (Number(x) > 12 || Number(x) < 1) {
return message.channel.send("That wasn't a valid option, please try again.")
}
// put stuff here
let currentWal = await checkStuff(mongoclient, message.author.id);
var requestedAmount = 0;
if (x.toString() === "1") { requestedAmount = currentWal.currency.doge; }
else if (x.toString() === "2") requestedAmount = currentWal.currency.usd;
else if (x.toString() === "3") requestedAmount = currentWal.currency.btc;
else if (x.toString() === "4") requestedAmount = currentWal.currency.eth;
else if (x.toString() === "5") requestedAmount = currentWal.stocks.tesla;
else if (x.toString() === "6") return message.channel.send("SpaceX is currently not a publicly listed company, so you can't buy it.")
else if (x.toString() === "7") requestedAmount = currentWal.stocks.roblox;
else if (x.toString() === "8") return message.channel.send("The Boring Company is currently not a publicly listed company, so you can't buy it.")
else if (x.toString() === "9") requestedAmount = currentWal.stocks.gameStonks;
else if (x.toString() === "10") requestedAmount = currentWal.stocks.elonstock;
else if (x.toString() === "11") { requestedAmount = currentWal.currency.ltc; }
else if (x.toString() === "12") requestedAmount = currentWal.stocks.blackberry;
let amountToBuy = await func1(thenum);
async function func1(thenum) {
var amountToBuy = 0;
let prices = global.cryptoPrices
let dogePrice = Number(prices.dogecoin.usd)
let ethPrice = Number(prices.ethereum.usd)
let btcPrice = Number(prices.bitcoin.usd)
let ltcPrice = Number(prices.litecoin.usd);
if (coin === "doge") {
amountToBuy = dogePrice * Number(thenum);
} else if (coin === "btc") {
amountToBuy = btcPrice * Number(thenum);
} else if (coin === "eth") {
amountToBuy = ethPrice * Number(thenum);
} else if (coin === "tesla") {
amountToBuy = global.stockPrices.tsla * Number(thenum)
} else if (coin === "game") {
amountToBuy = global.stockPrices.gme * Number(thenum)
} else if (coin === "roblox") {
amountToBuy = global.stockPrices.rblx * Number(thenum)
} else if (coin === "ingame") {
amountToBuy = Math.floor(Math.random() * 300) * Number(thenum);
} else if (coin === "usd") {
amountToBuy = Number(thenum)
} else if (coin === "ltc") {
amountToBuy = ltcPrice * Number(thenum)
} else if (coin === "bb") {
amountToBuy = global.stockPrices.bb * Number(thenum)
}
return amountToBuy;
}
//_________________________________________________________________
// amounttobuy is the amount that they want to buy converted to usdt
// totalAmount is the amount that they are going to spend in their requested currency
let totalAmount = await func2(amountToBuy);
async function func2(amountToBuy) {
let prices = global.cryptoPrices
let dogePrice = Number(prices.dogecoin.usd)
let ethPrice = Number(prices.ethereum.usd)
let btcPrice = Number(prices.bitcoin.usd)
let ltcPrice = Number(prices.litecoin.usd);
var totalAmount;
if (x.toString() === "1") {
totalAmount = amountToBuy / dogePrice
} else if (x.toString() === "2") {
totalAmount = amountToBuy;
} else if (x.toString() === "3") {
totalAmount = amountToBuy / btcPrice
} else if (x.toString() === "4") {
totalAmount = amountToBuy / ethPrice
} else if (x.toString() === "5") {
totalAmount = amountToBuy / global.stockPrices.tsla
} else if (x.toString() === "7") {
totalAmount = amountToBuy / global.stockPrices.rblx
} else if (x.toString() === "9") {
totalAmount = amountToBuy / global.stockPrices.gme
} else if (x.toString() === "10") {
totalAmount = amountToBuy / Math.floor(Math.random() * 300)
} else if (x.toString() === "11") {
totalAmount = amountToBuy / ltcPrice
} else if (x.toString() === "12") {
totalAmount = amountToBuy / global.stockPrices.bb
}
return totalAmount;
}
if (requestedAmount === undefined) {
cooldowns[message.author.id].trade = 0;
return message.channel.send("You don't have enough money lol imagine being poor.")
}
if (totalAmount > requestedAmount) {
cooldowns[message.author.id].trade = 0;
return message.channel.send("You don't have enough money lol imagine being poor.")
}
totalAmount = Number(totalAmount);
thenum = Number(thenum)
//taking away stuff
if (x.toString() === "1") {
await mongoclient.db("elonbot").collection("everything")
.updateOne({ name: message.author.id }, { $inc: { "currency.doge": -totalAmount } })
} else if (x.toString() === "2") {
await mongoclient.db("elonbot").collection("everything")
.updateOne({ name: message.author.id }, { $inc: { "currency.usd": -totalAmount } })
} else if (x.toString() === "3") {
await mongoclient.db("elonbot").collection("everything")
.updateOne({ name: message.author.id }, { $inc: { "currency.btc": -totalAmount } })
} else if (x.toString() === "4") {
await mongoclient.db("elonbot").collection("everything")
.updateOne({ name: message.author.id }, { $inc: { "currency.eth": -totalAmount } })
} else if (x.toString() === "5") {
await mongoclient.db("elonbot").collection("everything")
.updateOne({ name: message.author.id }, { $inc: { "stocks.tesla": -totalAmount } })
} else if (x.toString() === "7") {
await mongoclient.db("elonbot").collection("everything")
.updateOne({ name: message.author.id }, { $inc: { "stocks.roblox": -totalAmount } })
} else if (x.toString() === "9") {
await mongoclient.db("elonbot").collection("everything")
.updateOne({ name: message.author.id }, { $inc: { "stocks.gameStonks": -totalAmount } })
} else if (x.toString() === "10") {
await mongoclient.db("elonbot").collection("everything")
.updateOne({ name: message.author.id }, { $inc: { "stocks.elonstock": -totalAmount } })
} else if (x.toString() === "11") {
await mongoclient.db("elonbot").collection("everything")
.updateOne({ name: message.author.id }, { $inc: { "currency.ltc": -totalAmount } })
} else if (x.toString() === "12") {
await mongoclient.db("elonbot").collection("everything")
.updateOne({ name: message.author.id }, { $inc: { "stocks.blackberry": -totalAmount } })
}
//end of taking away stuff
//start of adding stuff
if (message.content.toLowerCase().includes("doge")) {
await mongoclient.db("elonbot").collection("everything")
.updateOne({ name: message.author.id }, { $inc: { "currency.doge": thenum } })
} else if (message.content.toLowerCase().includes("bit") || message.content.toLowerCase().includes("btc")) {
await mongoclient.db("elonbot").collection("everything")
.updateOne({ name: message.author.id }, { $inc: { "currency.btc": thenum } })
} else if (message.content.toLowerCase().includes("eth")) {
await mongoclient.db("elonbot").collection("everything")
.updateOne({ name: message.author.id }, { $inc: { "currency.eth": thenum } })
} else if (message.content.toLowerCase().includes("usd")) {
await mongoclient.db("elonbot").collection("everything")
.updateOne({ name: message.author.id }, { $inc: { "currency.usd": thenum } })
} else if (message.content.toLowerCase().includes("tesla")) {
await mongoclient.db("elonbot").collection("everything")
.updateOne({ name: message.author.id }, { $inc: { "stocks.tesla": thenum } })
} else if (message.content.toLowerCase().includes("space")) {
await mongoclient.db("elonbot").collection("everything")
.updateOne({ name: message.author.id }, { $inc: { "stocks.space": thenum } })
} else if (message.content.toLowerCase().includes("bor")) {
await mongoclient.db("elonbot").collection("everything")
.updateOne({ name: message.author.id }, { $inc: { "stocks.boring": thenum } })
} else if (message.content.toLowerCase().includes("elon")) {
await mongoclient.db("elonbot").collection("everything")
.updateOne({ name: message.author.id }, { $inc: { "stocks.elonstock": thenum } })
} else if (message.content.toLowerCase().includes("roblox")) {
await mongoclient.db("elonbot").collection("everything")
.updateOne({ name: message.author.id }, { $inc: { "stocks.roblox": thenum } })
} else if (message.content.toLowerCase().includes("game") || message.content.toLowerCase().includes("gme")) {
await mongoclient.db("elonbot").collection("everything")
.updateOne({ name: message.author.id }, { $inc: { "stocks.gameStonk": thenum } })
} else if (message.content.toLowerCase().includes("ltc") || message.content.toLowerCase().includes("lite")) {
await mongoclient.db("elonbot").collection("everything")
.updateOne({ name: message.author.id }, { $inc: { "currency.ltc": thenum } })
} else if (message.content.toLowerCase().includes("bb") || message.content.toLowerCase().includes("black")) {
await mongoclient.db("elonbot").collection("everything")
.updateOne({ name: message.author.id }, { $inc: { "stocks.blackberry": thenum } })
}
message.channel.send("Succesful transaction!")