-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
2960 lines (2134 loc) · 129 KB
/
main.py
File metadata and controls
2960 lines (2134 loc) · 129 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
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
############################################################################################################################################################################
## if you are reading this on github and your not monkey 99.9% of the comments are for me 4 weeks later from typing the code so sry if theres to much comments for you XD ##
############################################################################################################################################################################
from datetime import time , timezone, datetime as clock, timedelta
import discord, asyncio, os, json, random, requests, python_weather, subprocess, csv
from discord.ui import Button , View
from discord.ext import commands, tasks
from pynput.keyboard import Key, Controller
from dotenv import load_dotenv
from os import getenv
from PIL import Image, ImageDraw, ImageFont
import datetime
from io import BytesIO
os.chdir("/home/monkeybee11/Desktop/monkey bot discord")
load_dotenv()
token = getenv("monkey_bot")
# to do list
# come up with more games
monkey = int(113051316225368064)
dks = int(119791596681166848)
password = False
oimate = commands.Bot()
fishNchips = Controller()
t1 = ""
t2 = ""
t3 = ""
b1 = ""
b2 = ""
b3 = ""
f1 = ""
f2 = ""
f3 = ""
# these are veriables im using for banana game
# the targets they get set to the user and target for banana game so
# only they can intaract and no random person jumps in
thrower = "b"
splater = "a"
# create slash commarnd groups here
banana = oimate.create_group("banana")
dunk = oimate.create_group("dunk")
snows = oimate.create_group("snow")
pocket = oimate.create_group("pocket")
top = oimate.create_group("top")
pets = oimate.create_group("pet")
shop = oimate.create_group("shop")
fish_command = oimate.create_group("fish")
talk = oimate.create_group("talk")
weather = oimate.create_group("weather")
rps = oimate.create_group("rps")
do = oimate.create_group("deckedout")
@oimate.event
async def on_ready(): #this is where the bot brain starts to work
print("discord") # print() sends to the CMD not to discord
@oimate.event
async def on_application_command_error(ctx, error):
global monkey
if isinstance(error, commands.MissingRequiredArgument): #if command wasnot not right
await ctx.respond("you shoudnt see this message ping monkeybee11(monkeysock) and the command is on cooldown(if it has one) dont retry it")
elif isinstance(error, commands.CommandOnCooldown): #checks if on cooldown
await ctx.respond(error)
else:
raise error
#######################################
## testing ground ##
#######################################
#if this block of code is empty im not testing anything
#this is just so im able to find it in like 4 weeks time
# and me proberly forgotten how to use python :P
#######################################
## RPS ##
#######################################
class rpsView(discord.ui.View):
@discord.ui.button(emoji = "<:rock:1118952549093998653>", style= discord.ButtonStyle.primary, custom_id="rocky")
async def rock(self, button, interaction):
with open("rps.json","r") as f:
pick = json.load(f)
picked = pick["picked"]
pick["picked"] = ""
for child in self.children:
child.disabled = True
if picked == 0:
button.style = discord.ButtonStyle.grey
button.label = "both"
await interaction.response.edit_message(content="DRAW",view=self)
elif picked == 1:
pick["lose1"] += 1
button.style = discord.ButtonStyle.green
button.emoji = "<:rockWIN:1118952552529145946>"
sissorsbutton =[x for x in self.children if x.custom_id=="sissory"][0]
sissorsbutton.style = discord.ButtonStyle.red
sissorsbutton.emoji = "<:sissorsLOSE:1118952556593430642>"
button.label = interaction.user.name
sissorsbutton.label = "monkeybot"
await interaction.response.edit_message(content="YOU WON",view=self)
elif picked == 2:
pick["win1"] += 1
button.style = discord.ButtonStyle.red
button.emoji = "<:rockLOSE:1118952550419406971>"
papperbutton =[x for x in self.children if x.custom_id=="pappery"][0]
papperbutton.style = discord.ButtonStyle.green
papperbutton.emoji = "<:none:1118958111403819089>"
button.label = interaction.user.name
papperbutton.label = "monkeybot"
await interaction.response.edit_message(content="YOU LOST",view=self)
with open("rps.json","w") as f:
json.dump(pick, f, indent=4)
@discord.ui.button(emoji = "<:papper:1118952545352683602>", style= discord.ButtonStyle.primary, custom_id="pappery")
async def paper(self, button, interaction):
with open("rps.json","r") as f:
pick = json.load(f)
picked = pick["picked"]
pick["picked"] = ""
for child in self.children:
child.disabled = True
if picked == 0:
pick["lose2"] +=1
button.style = discord.ButtonStyle.green
button.emoji = "<:none:1118958111403819089>"
rockbutton =[x for x in self.children if x.custom_id=="rocky"][0]
rockbutton.style = discord.ButtonStyle.red
rockbutton.emoji = "<:rockLOSE:1118952550419406971>"
button.label = interaction.user.name
rockbutton.label = "monkeybot"
await interaction.response.edit_message(content="YOU WIN",view=self)
elif picked == 1:
button.style = discord.ButtonStyle.gray
button.label = "both"
await interaction.response.edit_message(content="DRAW",view=self)
elif picked == 2:
pick["win2"] += 1
button.style = discord.ButtonStyle.red
button.emoji = "<:papperLOSE:1118952547646980106>"
sissorsbutton =[x for x in self.children if x.custom_id=="sissory"][0]
sissorsbutton.style = discord.ButtonStyle.green
sissorsbutton.emoji = "<:sissorsWIN:1118952557847511051>"
button.label = interaction.user.name
sissorsbutton.label = "monkeybot"
await interaction.response.edit_message(content="YOU LOST",view=self)
with open("rps.json","w") as f:
json.dump(pick, f, indent=4)
@discord.ui.button(emoji = "<:sissors:1118952554026508408>", style= discord.ButtonStyle.primary, custom_id="sissory")
async def sissors(self, button, interaction):
with open("rps.json","r") as f:
pick = json.load(f)
picked = pick["picked"]
pick["picked"] = ""
for child in self.children:
child.disabled = True
if picked == 0:
pick["win3"] +=1
button.style = discord.ButtonStyle.red
button.emoji = "<:sissorsLOSE:1118952556593430642>"
rockbutton =[x for x in self.children if x.custom_id=="rocky"][0]
rockbutton.style = discord.ButtonStyle.green
rockbutton.emoji = "<:rockWIN:1118952552529145946>"
button.label = interaction.user.name
rockbutton.label = "monkeybot"
await interaction.response.edit_message(content="YOU LOST",view=self)
elif picked == 1:
pick["lose3"] +=1
button.style = discord.ButtonStyle.green
button.emoji = "<:sissorsWIN:1118952557847511051>"
papperbutton =[x for x in self.children if x.custom_id=="pappery"][0]
papperbutton.style = discord.ButtonStyle.red
papperbutton.emoji = "<:papperLOSE:1118952547646980106>"
button.label = interaction.user.name
papperbutton.label = "monkeybot"
await interaction.response.edit_message(content="YOU WIN",view=self)
elif picked == 2:
button.style = discord.ButtonStyle.gray
button.label = "both"
await interaction.response.edit_message(content="DRAW",view=self)
with open("rps.json","w") as f:
json.dump(pick, f, indent=4)
@rps.command(description = "play a game of rock papper sissors")
async def rps(ctx, member:discord.Member):
await ctx.response.defer()
await open_account(ctx.author)
await open_account(member)
user = ctx.author
users = await get_ticket_data()
if member.id == 788126107173912636: #monkeybots user id
rpslist = ["r","p","s"]
choise = random.randint(1,4) #little randomness wont hert even if hes remembering what options won and lost the most
with open("rps.json","r") as f:
pick = json.load(f)
pick["picked"] = ""
with open("rps.json","w") as f:
json.dump(pick, f, indent=4)
win1 = pick["win1"]
win2 = pick["win2"]
win3 = pick["win3"]
lose1 = pick["lose1"]
lose2 = pick["lose2"]
lose3 = pick["lose3"]
r = str(choise + win1 - lose1)
p = str(choise + win2 - lose2)
s = str(choise + win3 - lose3)
play = random.choices(rpslist, weights = [int(r), int(p), int(s)])
#print(play)
pick["picked"] = rpslist.index(play[0])
pick["games"] += 1
with open("rps.json", "w") as f:
json.dump(pick, f, indent=4)
await ctx.followup.send("so you wanna play......ok ready? roooooock pappppper sissssssors.....SHOOT", view=rpsView())
#user clicks button picking there move
elif member.id != 788126107173912636:
await ctx.followup.send("sry this commarnd is still being worked on try picking monkeybot as your target for now")
###########################################
## your pocket ##
###########################################
@pocket.command(description = "shows u whats in your pocket")
async def item(ctx):
await ctx.response.defer()
await open_account(ctx.author)
user = ctx.author
users = await get_ticket_data()
# note if any new items are added to this list manualy add them to the ticketbank.json file
ticket_amt = users[str(user.id)]["ticket"]
banana_amt = users[str(user.id)]["banana"]
snow_amt = users[str(user.id)]["snowball"]
cracker_amt = users[str(user.id)]["ccracker"]
em = discord.Embed(title = f"inside {ctx.author.name}'s pocket is", colour = discord.Colour.red())
em.add_field(name = "<:DanTix:919966342797463552>", value = ticket_amt, inline = True)
em.add_field(name = "<:mnkyThrow:704518598764527687>", value = banana_amt, inline = True)
em.add_field(name = "<:2021_Snowsgiving_Emojis_001_Snow:917929344914030642>",value = snow_amt, inline = True)
em.add_field(name = "<:christmas_cracker:1040655557171871794>",value = cracker_amt, inline = True)
await ctx.followup.send(embed = em)
async def open_account(user):
users = await get_ticket_data()
if str(user.id) in users:
return False
else:
#this is where we set the names for the database in the json file
# cant think of a name but item? based things
users[str(user.id)] = {}
users[str(user.id)]["ticket"] = 0
users[str(user.id)]["banana"] = 0
users[str(user.id)]["snowball"] = 0
users[str(user.id)]["ccracker"] = 0
users[str(user.id)]["snowman_cursed"] = 0
users[str(user.id)]["splat"] = 0
users[str(user.id)]["name"] = ""
#immunitys
users[str(user.id)]["snow_immune"] = 0
users[str(user.id)]["banana_immune"] = 0
#pets
users[str(user.id)]["fish"] = 0
users[str(user.id)]["monkey"] = 0
users[str(user.id)]["snowman"] = 0
users[str(user.id)]["petfood"] = 0
users[str(user.id)]["petmed"] = 0
users[str(user.id)]["active_pet"] = ""
users[str(user.id)]["pet_hunger"] = 10
users[str(user.id)]["pet_clean"] = 10
users[str(user.id)]["pet_health"] = 10
users[str(user.id)]["pet_fun"] = 10
users[str(user.id)]["pet_sickness"] = 0
users[str(user.id)]["pet_freeze"] = 0
users[str(user.id)]["health_tick"] = 10
users[str(user.id)]["hunger_tick"] = 10
users[str(user.id)]["fun_tick"] = 10
users[str(user.id)]["clean_tick"] = 10
users[str(user.id)]["pet name"] = ""
users[str(user.id)]["size"] = 0
#games
users[str(user.id)]["rps"] = ""
with open("ticketbank.json","w") as f:
json.dump(users,f, indent=4)
return True
async def get_ticket_data():
with open ("ticketbank.json","r") as f:
users = json.load(f)
return users
#######################################
## statis immunitys ##
#######################################
@oimate.slash_command(name ="immunity_card" , description = "looks at your immunity card to see what your immune to")
async def immunty_card(ctx):
await ctx.response.defer()
await open_account(ctx.author)
user = ctx.author
users = await get_ticket_data()
snow_imune = users[str(user.id)]["snow_immune"]
banana_imune = users[str(user.id)]["banana_immune"]
em = discord.Embed(title = f"{ctx.author.name}")
em.add_field(name = "snowman statis", value = f"{snow_imune}", inline = True)
em.add_field(name = "banana statis", value = f"{banana_imune}", inline = True)
await ctx.followup.send(embed = em)
##############
# map link #
##############
@oimate.slash_command(name = "monkeymines_map" , description = "link to the monkeymines map")
async def map(ctx):
await ctx.response.defer()
await ctx.followup.send("http://monkeyminesmap.net/")
###############
#set immunty #
###############
@oimate.slash_command(name = "immune" , description ="set your immuntys")
async def immune(ctx, message = None):
await ctx.response.defer()
await open_account(ctx.author)
user = ctx.author
users = await get_ticket_data()
if message == "add_snowman":
users[str(user.id)]["snow_immune"] = 1
await ctx.followup.send(f"{user.name} has become immune to the snowman curse")
elif message == "remove_snowman":
users[str(user.id)]["snow_immune"] = 0
await ctx.followup.send(f"{user.name} is no longer immune to the snowman curse")
elif message == "add_banana":
users[str(user.id)]["banana_immune"] = 1
await ctx.followup.send(f"{user.name} no longer will have banana stuck on there face")
elif message == "remove_banana":
users[str(user.id)]["banana_immune"] = 0
await ctx.followup.send(f"{user.name} will have banana stuck to there face when thrown at them")
else:
await ctx.followup.send("use this commarnd to add or remove immuitys to effects from this bot")
with open("ticketbank.json","w") as f:
json.dump(users,f, indent=4)
#######################################
## pet pocket ##
#######################################
@pocket.command(description = "looks at your pet related things")
async def pet(ctx):
await ctx.response.defer()
await open_account(ctx.author)
user = ctx.author
users = await get_ticket_data()
fish = users[str(user.id)]["fish"]
monkey = users[str(user.id)]["monkey"]
snowman = users[str(user.id)]["snowman"]
petfood = users[str(user.id)]["petfood"]
petmed = users[str(user.id)]["petmed"]
em = discord.Embed(title = f"{ctx.author.name}")
em.add_field(name = "🐟", value = f"{fish}", inline = True)
em.add_field(name = "🐒" , value = f"{monkey}",inline = True)
em.add_field(name = "⛄" , value = f"{snowman}",inline = True)
em.add_field(name = "🥫", value = f"{petfood}", inline = True)
em.add_field(name = "💊", value = f"{petmed}", inline = True)
await ctx.followup.send(embed = em)
@tasks.loop(time = time(17 , 35, tzinfo=datetime.timezone.utc))
async def choco_loop():
channel = oimate.get_channel(672550204213297174)
await channel.send('<@&888038726154993714> oi oi paycheck time come and get your<:galixy_cookie:1086380582080086057><:galixy_cookie:1086380582080086057><:galixy_cookie:1086380582080086057>')
@tasks.loop(hours=1)
async def trophy_check():
global t1, t2, t3 ,b1 ,b2 ,b3, f1, f2, f3
with open("ticketbank.json","r") as f:
users = json.load(f)
ticket_check = sorted(users.items(), key=lambda x: x[1]["ticket"], reverse=True)
banana_check = sorted(users.items(), key=lambda x: x[1]["banana"], reverse=True)
fish_check = sorted(users.items(), key=lambda x: x[1]["size"], reverse=True)
t1 = int(ticket_check[0][0])
t2 = int(ticket_check[1][0])
t3 = int(ticket_check[2][0])
b1 = int(banana_check[0][0])
b2 = int(banana_check[1][0])
b3 = int(banana_check[2][0])
f1 = int(fish_check[0][0])
f2 = int(fish_check[1][0])
f3 = int(fish_check[2][0])
@tasks.loop(minutes=30)
async def pet_tick():
with open("ticketbank.json","r") as f:
users = json.load(f)
check1 = random.randint(1,2)
check2 = random.randint(1,2)
sicky = random.randint(0,10)
for user, value in users.items():
if users[user]["active_pet"] != "" and users[user]["pet_freeze"] == 0:
if check1 == 1 and check2 == 1:
users[user]["hunger_tick"] -= 1
if users[user]["hunger_tick"] <= 0:
users[user]["hunger_tick"] = 10
users[user]["pet_hunger"] -= 1
if users[user]["pet_hunger"] <= 0:
users[user]["pet_hunger"] = 0
users[user]["pet_health"] -= 1
elif check1 == 1 and check2 == 2:
users[user]["clean_tick"] -= 1
if users[user]["clean_tick"] <= 0:
users[user]["clean_tick"] = 10
users[user]["pet_clean"] -= 1
if users[user]["pet_clean"] <= 3:
if sicky > 5:
users[user]["pet_sickness"] = 1
if users[user]["pet_sickness"] == 1:
users[user]["pet_health"] -= 2
elif check1 == 2 and check2 == 1 and users[user]["active_pet"] != "fish":
users[user]["fun_tick"] -= 1
if users[user]["fun_tick"] <= 0:
users[user]["fun_tick"] = 10
users[user]["pet_fun"] -= 1
elif users[user]["pet_health"] > 0 and users[user]["pet_health"] < 10:
users[user]["pet_hunger"] -= 1
users[user]["pet_health"] += 1
with open("ticketbank.json","w") as f:
json.dump(users,f, indent=4)
#######################################
## fish cooler ##
#######################################
async def check_fish_cooler(user):
users = await get_fishcooler_data()
if str(user.id) in users:
return False
else:
users[str(user.id)] = {}
users[str(user.id)]["fish name"] = []
with open("fishCooler.json","w") as f:
json.dump(users,f, indent=4)
return True
async def get_fishcooler_data():
with open ("fishCooler.json","r") as f:
users = json.load(f)
return users
@fish_command.command(description = "better list of your fish cooler")
async def list(ctx):
await ctx.response.defer()
await check_fish_cooler(ctx.author)
users = await get_fishcooler_data()
user = ctx.author
fish = users[str(user.id)]["fish name"]
em = discord.Embed(title = f"{ctx.author.name} fish list")
em.add_field(name = "cod", value = fish.count("cod") , inline = True)
em.add_field(name = "salamon", value = fish.count("salamon"), inline = True)
em.add_field(name = "catfish", value = fish.count("catfish"), inline = True)
em.add_field(name = "kitchen sink", value = fish.count("kitchen sink"), inline = True)
em.add_field(name = "shark", value = fish.count("shark"), inline = True)
em.add_field(name = "whale", value = fish.count("whale"), inline = True)
em.add_field(name = ":fish:", value = fish.count(":fish:"), inline = True)
em.add_field(name = ":wood:", value = fish.count(":wood:"), inline = True)
em.add_field(name = ":shark:", value = fish.count(":shark:"), inline = True)
em.add_field(name = "👓", value = fish.count("👓"), inline = True)
em.add_field(name = "BEAR-acuda", value = fish.count("BEAR-acuda"), inline = True)
em.add_field(name = "old boot", value = fish.count("old boot"), inline = True)
em.add_field(name = "the other old boot", value = fish.count("the other old boot"), inline = True)
em.add_field(name = "a new boot", value = fish.count("a new boot"), inline = True)
em.add_field(name = "a strange glowing book something about mending" , value = fish.count("a strange glowing book something about mending"), inline = True)
em.add_field(name = "a peanut butter jelly fish", value = fish.count("a peanut butter jelly fish"), inline = True)
em.add_field(name = "NEMO", value = fish.count("NEMO"), inline = True)
em.add_field(name = "frozen tuna", value = fish.count("frozen tuna"), inline = True)
em.add_field(name = "some legobricks from the 1969 LEGO satun V rocket", value = fish.count("some legobricks from the 1969 LEGO satun V rocket"), inline = True)
await ctx.followup.send(embed = em)
#######################################
## rpg data ##
#######################################
#removed for now coming back later
#######################################
## random stuff ##
#######################################
@oimate.slash_command(name = "nailed_it", description = "nailed it")
async def nailedit(ctx):
await ctx.response.defer()
nail = random.randint(1,2)
if nail == 1:
await ctx.followup.send("<:NailedItDan:887162185166516256>")
elif nail == 2:
await ctx.followup.send("<:mnkyNailedIt:739908983833362433>")
@oimate.slash_command(name = "dadjokes", description = "dadjoke emoji")
async def dadjoke(ctx):
await ctx.response.defer()
joke = random.randint(1,2)
if joke == 1:
await ctx.followup.send("<:DadJokeDan:887164212261056574>")
elif joke == 2:
await ctx.followup.send(" <:mnkyDadJoke:704518638706753588>")
@oimate.slash_command(name = "d20", description = "rolls a d20")
async def d20(ctx):
await ctx.response.defer()
roll = random.randint(1,20)
await ctx.followup.send(file = discord.File(f"/home/monkeybee11/Desktop/monkey bot discord/img/dice/gif/D20_{roll}.gif"))
#############################
## decked out stuff ##
#############################
@do.command(description="monkeybot will help u pick a card")
async def pick(ctx, card1: str = None, card2: str = None, card3: str = None, card4: str = None):
await ctx.response.defer()
# Create a list of the options
options = [card1, card2, card3, card4]
# Remove any None values from the list
options = [option for option in options if option is not None]
# Randomly select an option
picked_option = random.choice(options)
await ctx.followup.send(f"how about you pick {picked_option}?")
@do.command(description="check out players deck")
async def deck(ctx, playername: str = None):
await ctx.response.defer()
if playername == "monkeybee":
sheet_id = 1715902524
elif playername == "dan":
sheet_id = 1971408694
elif playername == "kuya":
sheet_id = 272789619
elif playername == "kiz":
sheet_id = 1685723413
command = f'wget --output-file="logs.csv" "https://docs.google.com/spreadsheets/d/1zCOWZDasd9zMeLcy35R1X3ElnTSSN7OvoMMSY3eGjko/export?format=csv&gid={sheet_id}" -O "downloaded_content.csv"'
subprocess.run(command, shell=True)
with open("downloaded_content.csv", "r") as csvfile:
reader_variable = csv.reader(csvfile, delimiter=",")
cells = []
for row in reader_variable:
cells.append(row)
# [up/down][left/right]
embed_common = discord.Embed(title = f"{playername}'s deck (common)", colour = discord.Colour.light_gray())
embed_common.add_field( name = f"{cells[3][3]}", value = f"{cells[3][1]}" , inline = True)
embed_common.add_field( name = f"{cells[4][3]}", value = f"{cells[4][1]}", inline = True)
embed_common.add_field( name = f"{cells[5][3]}" , value = f"{cells[5][1]}", inline = True)
embed_common.add_field( name = f"{cells[6][3]}" , value = f"{cells[6][1]}", inline = True)
embed_uncommon = discord.Embed(title = f"{playername}'s deck (uncommon)", colour = discord.Colour.green())
embed_uncommon.add_field( name = f"{cells[9][3]}" , value = f"{cells[9][1]}", inline = True)
embed_uncommon.add_field( name = f"{cells[10][3]}" , value = f"{cells[10][1]}", inline = True)
embed_uncommon.add_field( name = f"{cells[11][3]}" , value = f"{cells[11][1]}", inline = True)
embed_uncommon.add_field( name = f"{cells[12][3]}" , value = f"{cells[12][1]}", inline = True)
embed_uncommon.add_field( name = f"{cells[13][3]}" , value = f"{cells[13][1]}", inline = True)
embed_uncommon.add_field( name = f"{cells[14][3]}" , value = f"{cells[14][1]}", inline = True)
embed_uncommon.add_field( name = f"{cells[15][3]}" , value = f"{cells[15][1]}", inline = True)
embed_uncommon.add_field( name = f"{cells[16][3]}" , value = f"{cells[16][1]}", inline = True)
embed_uncommon.add_field( name = f"{cells[17][3]}" , value = f"{cells[17][1]}", inline = True)
embed_uncommon.add_field( name = f"{cells[18][3]}" , value = f"{cells[18][1]}", inline = True)
embed_uncommon.add_field( name = f"{cells[19][3]}" , value = f"{cells[19][1]}", inline = True)
embed_uncommon.add_field( name = f"{cells[20][3]}" , value = f"{cells[20][1]}", inline = True)
embed_uncommon.add_field( name = f"{cells[21][3]}" , value = f"{cells[21][1]}", inline = True)
embed_uncommon.add_field( name = f"{cells[22][3]}" , value = f"{cells[22][1]}", inline = True)
embed_uncommon.add_field( name = f"{cells[23][3]}" , value = f"{cells[23][1]}", inline = True)
embed_rare = discord.Embed(title = f"{playername}'s deck (rare)", colour = discord.Colour.blue())
embed_rare.add_field( name = f"{cells[3][13]}" , value = f"{cells[3][11]}", inline = True)
embed_rare.add_field( name = f"{cells[4][13]}" , value = f"{cells[4][11]}", inline = True)
embed_rare.add_field( name = f"{cells[5][13]}" , value = f"{cells[5][11]}", inline = True)
embed_rare.add_field( name = f"{cells[6][13]}" , value = f"{cells[6][11]}", inline = True)
embed_rare.add_field( name = f"{cells[7][13]}" , value = f"{cells[7][11]}", inline = True)
embed_rare.add_field( name = f"{cells[8][13]}" , value = f"{cells[8][11]}", inline = True)
embed_rare.add_field( name = f"{cells[9][13]}" , value = f"{cells[9][11]}", inline = True)
embed_rare.add_field( name = f"{cells[10][13]}" , value = f"{cells[10][11]}", inline = True)
embed_rare.add_field( name = f"{cells[11][13]}" , value = f"{cells[11][11]}", inline = True)
embed_rare.add_field( name = f"{cells[12][13]}" , value = f"{cells[12][11]}", inline = True)
embed_rare.add_field( name = f"{cells[13][13]}" , value = f"{cells[13][11]}", inline = True)
embed_rare.add_field( name = f"{cells[14][13]}" , value = f"{cells[14][11]}", inline = True)
embed_legendary = discord.Embed(title = f"{playername}'s deck (legendary)", colour = discord.Colour.purple())
embed_legendary.add_field( name = f"{cells[17][13]}" , value = f"{cells[17][11]}", inline = True)
embed_legendary.add_field( name = f"{cells[18][13]}" , value = f"{cells[18][11]}", inline = True)
embed_legendary.add_field( name = f"{cells[19][13]}" , value = f"{cells[19][11]}", inline = True)
embed_legendary.add_field( name = f"{cells[20][13]}" , value = f"{cells[20][11]}", inline = True)
embed_legendary.add_field( name = f"{cells[21][13]}" , value = f"{cells[21][11]}", inline = True)
embed_ethereals = discord.Embed(title = f"{playername}'s deck (etheral)", colour = discord.Colour.gold())
embed_ethereals.add_field( name = f"{cells[24][13]}" , value = f"{cells[24][11]}", inline = True)
embed_ethereals.add_field( name = f"{cells[25][13]}" , value = f"{cells[25][11]}", inline = True)
embed_ethereals.add_field( name = f"{cells[26][13]}" , value = f"{cells[26][11]}", inline = True)
embed_ethereals.add_field( name = f"{cells[27][13]}" , value = f"{cells[27][11]}", inline = True)
await ctx.followup.send(embed = embed_common)
await ctx.send(embed = embed_uncommon)
await ctx.send(embed = embed_rare)
await ctx.send(embed = embed_legendary)
await ctx.send(embed = embed_ethereals)
await ctx.send(f" {playername} has {cells[1][1]} cards in there deck")
os.remove("/home/monkeybee11/Desktop/monkey bot discord/downloaded_content.csv")
os.remove("/home/monkeybee11/Desktop/monkey bot discord/logs.csv")
#############################
## get others wet ##
#############################
@oimate.slash_command(name = "pew" ,description = "shoot someone with a water gun")
async def pew(ctx,member:discord.Member):
await ctx.response.defer()
miss = random.randint(1,100)
if miss <= 80:
await ctx.followup.send(f"<@!{member.id}> got shot by <@!{ctx.author.id}>")
await ctx.send("<a:TargetAnim:927671875834875974>")
elif miss > 80 and miss < 90:
await open_account(ctx.author)
await open_account(member)
users = await get_ticket_data()
user = ctx.author
mem = member
aim = random.randint(1,5)
users[str(user.id)]["ticket"] += aim
users[str(mem.id)]["ticket"] -= aim
if users[str(mem.id)]["ticket"] < 0:
users[str(mem.id)]["ticket"] = 0
await ctx.followup.send(f"showing off there cowboy skills <@!{user.id}> not only got <@!{member.id}> wet but shot {aim} tickets out of there hand and grabed them mid air")
elif miss >= 90:
name = []
for member in ctx.guild.members:
name.append(member.id)
await ctx.followup.send(f"<@!{ctx.author.id}> missed there target and shot <@!{random.choice(name)}>")
await ctx.send("<a:TargetAnim:927671875834875974>")
await ctx.send(f"<@!{ctx.author.id}> may want to pratice there aim at the target game")
##########################################
## dad jokes ##
##########################################
@commands.cooldown(1,1200,commands.BucketType.user)
@oimate.slash_command(name= "joke", description = "tells a joke")
async def joke(ctx):
await ctx.response.defer()
jokeimg = " "
dadjoke = random.randint(1,3)
if dadjoke == 1:
jokeimg = "https://cdn.discordapp.com/emojis/887164212261056574.webp?size=96&quality=lossless"
elif dadjoke == 2:
jokeimg ="https://cdn.discordapp.com/emojis/704518638706753588.webp?size=96&quality=lossless"
elif dadjoke ==3:
jokeimg = "https://cdn.discordapp.com/emojis/894525186655780864.webp?size=44&quality=lossless"
joke = [
"why coudnt the pony sing a lullaby? ||she was a little horse||",
"what do u call a boomerang that wont come back? ||a stick||",
"what does a cloud wear under his raincoat? ||thunderwear||",
"two pickles fell out of a jar onto the floor what did one say to the other? ||dill with it||",
"what time is it when the clock strikes 13? ||time to get a new clock||",
"how dose acucumber become a pickle? || it goes through a jarring experience||",
"what did one toilet say to the other? ||you look a bit flushed||",
"what do u think of that new diner on the moon? ||food was good but there really wasnt much atmosphre||",
"why did the dinosaur cross the road?||because the chicken wasnt born yet||",
"why cant elsa from frozen have a baloon?||because she will \"let it go\"||",
"what musical instrument is found in the bathroom?||a tuba toothpaste||",
"why did the kid bring a ladder to school?||because he wanted to go to high school||",
"what do you call a dog magician?||a labracadabrador||",
"where woud you find an elephant?||the same place you lost her||",
"how do you get a squirrel to like you?||act like a nut||",
"what do you call two birds in love?||tweethearts||",
"how dose a scientist freshen her breath?||with experi-mints||",
"how are false teeth like stars?||they come out at night||",
"what building in your town has the most stories?||the public library||",
"whats a computers favrout snack?||computer chips||",
"what did one vocano say to the other?||i lava you||",
"how do we know that the ocean is frendly?||it waves||",
"what is a tornados favrout game to play?||twister||",
"how dose the moon cut his hair?||eclipes it||",
"how do you talk to a giant?||use BIG words||",
"what animal is allways at the baseball game?||a bat||",
"what falls in winter but never gets hurt?||snow||",
"what did the dalmatian say after lunch?||that hit the spot||",
"why did the kid cross the playground?||to get to the other side||",
"what do you call a droid that takes the long way around?||R2 detour||",
"why did the cookie go to the hospital?||because he felt crummy||",
"why was the baby strawberry crying?||because her mum and dad was in a jam||",
"what did the little corn say to the mama corn?||wheres is pop corn?||",
"how do you make a lemon drop?||just let it fall||",
"what did the limestone say to the geologist?||dont take me for granite||",
"why dose a seagul fly over the sea?||because if they flew over the bay it woud be a baygull||",
"what kind of water cant freeze?||hot water||",
"what kind of tree fits in your hand?||a palm tree||",
"what do you call a dinosaur that is a sleep?||a dino-snore||",
"whats fast loud and crunchy?||a rocket chip||",
"why did the teddybear say no to desserts?||he was stuffed||",
"what has ears but cant hear?||a corn field||",
"what did the left eye say to the right eye?||between us something smells||",
"what did one plate say to the other plate?||dinner is on me||",
"why did the student eat his homework?||the teacher told him it was a piece of cake||",
"when you look for something why is it allways in the last place you look?||because when u find it you stop looking||",
"what is brown hairy and wears sunglasses?||a coconut on vacation||",
"what do you say to a rabbit on his birthday?||hoppy birthday||",
"whats the one thing u get every year on your birthday guaranteed?||one year older||",
"why do candles allways go on top of the cake?||because its hard to light them form the bottom||",
"what do cakes and baseball teams have in common?||they both need a good batter||",
"two monkeys are in a bath one says oo ahh ahh eeeeeek||the other said turn the cold tap on then||",
"FUN FACT!! \"sugar\" is the only word in the english language where \"su-\" makes a \"sh\" sound .... || at leace im pritty sure thats correct||"
]
haha = len(joke)
hoho = random.randrange(haha)
JOKE = joke[hoho]
jokebed=discord.Embed(title= "DAD JOKE")
jokebed.set_author(name =(ctx.author.name))
jokebed.set_thumbnail(url=(jokeimg))
jokebed.add_field(name = f"{JOKE}" , value = "<:laughtingmonkey:894525186655780864>", inline = True)
await ctx.followup.send(embed=jokebed)
##########################################
## bubble wrap ##
##########################################
@oimate.slash_command(name = "bubble_wrap", description = "discord stress releave")
async def stress(ctx):
await ctx.response.defer()
await ctx.followup.send(f"you seem stressed {ctx.author}....here have some bubble wrap")
await ctx.send("||pop||||pop||||pop||||pop||||pop||||pop||||pop||||pop||||pop||||pop||\n||pop||||pop||||pop||||pop||||pop||||pop||||pop||||pop||||pop||||pop||\n||pop||||pop||||pop||||pop||||pop||||pop||||pop||||pop||||pop||||pop||\n||pop||||pop||||pop||||pop||||pop||||pop||||pop||||pop||||pop||||pop||\n||pop||||pop||||pop||||pop||||pop||||pop||||pop||||pop||||pop||||pop||\n||pop||||pop||||pop||||pop||||pop||||pop||||pop||||pop||||pop||||pop||\n||pop||||pop||||pop||||pop||||pop||||pop||||pop||||pop||||pop||||pop||\n||pop||||pop||||pop||||pop||||pop||||pop||||pop||||pop||||pop||||pop||\n||pop||||pop||||pop||||pop||||pop||||pop||||pop||||pop||||pop||||pop||\n||pop||||pop||||pop||||pop||||pop||||pop||||pop||||pop||||pop||||pop||")
##########################################
## weather ##
##########################################
######################
# weather list #
######################
partly_sunny = "Partly Sunny"
mostly_cloudy = ["Mostly Cloudy" , "Overcast" ]
sunny = ["Sunny","Clear"]
rainy = ["Rain","Light Rain","Rain Showers", "Light rain, mist"]
cloudy = "Cloudy"
thunder = "Thundery Showers"
sunnycloud = ["Partly Cloudy" , "Mostly Sunny"]
slush = "Light Rain and Snow"
snow = "Snow"
ninja_cloud = ["Mist", "Rain, mist"]
l = ""
class weather_view(discord.ui.View):
@discord.ui.select(
placeholder = "pick a weather report",
min_values = 1,
max_values = 1,
options = [
discord.SelectOption(
label= "emoji",
description= "the old weather commarnd :3 "
),
discord.SelectOption(
label= "weather report",
description= "wttr v1 weather report"
),
discord.SelectOption(
label= "data rich report",
description= "wttr v2 data rich report"
),
discord.SelectOption(
label= "weather map WIP",
description= "a weather map (WIP not working fully)"
),
discord.SelectOption(
label= "moon",
description= "MOOOOOOOON"
) ] )
async def weather_callback(self,select, interaction):
if select.values[0] == "emoji":
client = python_weather.Client(unit=python_weather.METRIC)
weather = await client.get(f"{l}")
weather_check = weather.current.description
if weather_check == partly_sunny: # little cloudy but sunny
await interaction.response.send_message(":partly_sunny:")
elif weather_check in mostly_cloudy: # sunny cloud
await interaction.response.send_message(":white_sun_cloud:")
elif weather_check in sunny: #lots of sun
await interaction.response.send_message(":sunny:")
elif weather_check in rainy: #rain
await interaction.response.send_message(":cloud_rain:")
elif weather_check == cloudy: #clouds
await interaction.response.send_message(":cloud:")
elif weather_check == thunder: # thunder storms
await interaction.response.send_message(":thunder_cloud_rain:")
elif weather_check in sunnycloud: # dont knwo y ive made this its own thing
await interaction.response.send_message(":white_sun_small_cloud:")
elif weather_check == slush: # slush
await interaction.response.send_message(":cloud_snow: :cloud_rain:")
elif weather_check == snow: # snow
await interaction.response.send_message(":cloud_snow:")
elif weather_check in ninja_cloud: # WATCH OUT THATS NINJAS SMOKEBOMBS
await interaction.response.send_message("🥷😶🌫️")
elif weather_check == "Partly cloudy":
await interaction.response.send_message("🌥️")
else: