This repository has been archived by the owner on Sep 20, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path7_hypixel.sk
1061 lines (842 loc) · 68.9 KB
/
7_hypixel.sk
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
#! File automatically made in Discord by ! Cerial#0001! (8/10/22, 10:36 AM)
options:
bot: "DisTune"
icon: "https://cdn.discordapp.com/attachments/809401069489750057/947037864120680458/distune-new.png"
color: rgb(47, 49, 54)
uuid: f25e8d2c-e0c0-4e82-8b0a-c61d2fb75690
on load:
set {_c} to newSlash("hypixel", "Hypixel commands!")
set {_hy::status} to newSubCmd_Slash("status", "Check the status of the Hypixel API.")
set {_hy::friends} to newSubCmd_Slash("friends", "Check the friends of a player.")
newOption_Slash({_hy::friends}, "player", "The name of the player you want to check their friends.")
set {_hy::info} to newSubCmd_Slash("info", "Get general Hypixel information of a player.")
newOption_Slash({_hy::info}, "player", "The name of the player you want to check their stats.")
add {_hy::*} to sub commands of {_c}
addSlash_Global({_c}, "hypixel")
on load:
set {apikey} to yml value "apikey" from file "plugins/DisTune/important.yml"
function booleanToYN(b: boolean) :: string:
return "yes" if {_b} = true
return "no" if {_b} = false
function hypixel_apistatus(success: string, cause: string, username: string) :: embedbuilder:
make embed:
set title of the embed to "Hypixel - API status"
set {_syn} to booleanToYN({_success} parsed as boolean)
#broadcast "Values: %{_syn}% | %{_success}% | %{_cause}%"
add field named "API Key Valid" with value {_syn} to embed
if {_syn} = "no":
if {_cause} = "Invalid API key":
add field named "Faliure Cause" with value "The Hypixel API key the bot is using is invalid. Contact Cerial as soon as possible" to embed
else if {_cause} = "Key throttle":
add field named "Faliure Cause" with value "The Hypixel API is either being overloaded or the API key is being overloaded." to embed
set embed color of the embed to red
else if {_syn} = "yes":
set embed color of the embed to lime
add field named "Key Owner" with value "%{_username}%" to embed
set thumbnail of the embed to "https://minotar.net/helm/%{_username}%/100.png"
return last embed
on slash command:
event-string = "hypixel/status"
delete {_json::*} and {_b} and {_json2::*} and {_b2}
if {_e::%discord id of event-member%} is set:
reply with hidden ":x: You're already checking Hypixel API status!"
stop
make embed:
set description of the embed to "<a:distune_loading:1006642541996814336> **Checking Hypixel API status...**"
set embed color of the embed to yellow
reply with last embed and store it in {_e::%discord id of event-member%}
send a request to "https://api.hypixel.net/key?key=%{apikey}%"
set {_b} to last http response's body
copy json {_b} to {_json::*}
#post "**HYPIXEL API HTTP DEBUG MODE**%nl%HTTP Response: ```json%nl%%{_b}%```%nl%Skript Output: ```%nl%%{_json::*}%```" to event-channel
send a request to "https://api.mojang.com/user/profile/%{_json::record::owner}%"
set {_b2} to last http response's body
copy json {_b2} to {_json2::*}
#post "**MOJANG API HTTP DEBUG MODE**%nl%HTTP Response: ```json%nl%%{_b2}%```%nl%Skript Output: ```%nl%%{_json2::*}%```" to event-channel
edit {_e::%discord id of event-member%} with hypixel_apistatus("%{_json::success}%", "%{_json::cause}%", "%{_json2::name}%")
delete {_e::%discord id of event-member%}
stop
function noFormat(s: string) :: string:
replace all "_" with "\_" in {_s}
return {_s}
import:
java.lang.System
on slash command:
event-string = "hypixel/friends"
set {_p} to argument "player" as string
delete {friends.List::%discord id of event-member%::%discord id of event-guild%::*}
set {_n1} to System.currentTimeMillis()
make embed:
set title of the embed to "<a:distune_loading:1006642541996814336> Checking Hypixel friends of %{_p}%..."
delete {_prog::*}
add "<a:distune_loading:1006642541996814336> Getting account UUID from Mojang API..." to {_prog::*}
add "<a:distune_loading:1006642541996814336> Getting friends from Hypixel API..." to {_prog::*}
set description of the embed to "This might take a minute if the user has too many friends.%nl%%join {_prog::*} with nl%"
set embed color of the embed to yellow
reply with last embed and store it in {friends.Embed::%discord id of event-member%::%discord id of event-guild%}
set {_b} to text from url "https://api.mojang.com/user/profile/agent/minecraft/name/%{_p}%"
copy json {_b} to {_json::*}
broadcast "%{_b}% | %{_json::*}%"
if {_json::*} is not set:
make embed:
set title of the embed to ":x: Checking Hypixel friends of %{_p}%..."
delete {_prog::*}
add ":x: The username `%{_p}%` is invalid. Check the spelling of the username." to {_prog::*}
add ":x: Getting friends from Hypixel API..." to {_prog::*}
set description of the embed to "This might take a minute if the user has too many friends.%nl%%join {_prog::*} with nl%"
set embed color of the embed to yellow
edit {friends.Embed::%discord id of event-member%::%discord id of event-guild%} with last embed
delete {friends.Embed::%discord id of event-member%::%discord id of event-guild%}
stop
else:
make embed:
set title of the embed to "<a:distune_loading:1006642541996814336> Checking Hypixel friends of %{_p}%..."
delete {_prog::*}
add ":white_check_mark: Got account from Mojang API. (Proper Username: %{_json::name}%)" to {_prog::*}
add "<a:distune_loading:1006642541996814336> Getting friends from Hypixel API..." to {_prog::*}
set description of the embed to "This might take a minute if the user has too many friends.%nl%%join {_prog::*} with nl%"
set embed color of the embed to yellow
edit {friends.Embed::%discord id of event-member%::%discord id of event-guild%} with last embed
set {_b2} to text from url "https://api.hypixel.net/friends?key=%{apiKey}%&uuid=%{_json::id}%"
copy json {_b2} to {_json2::*}
#broadcast "%{_b2}% | %{_json2::*}%"
# Edit this when doing buttons/dropdown
set {_page} to 1
set {_start} to ({_page} * 20)-20
set {_end} to {_page} * 20
loop {_json2::records::*}:
set {_num} to loop-index parsed as integer
if {_num} = {_start}:
set {_do} to true
if {_num} = {_end}:
set {_do} to false
if {_do} = false:
stop loop
else:
if noFormat({_json2::records::%{_num}%::uuidSender}) = {_json::id}:
delete {_json3::*}
set {_b3} to text from url "https://api.minetools.eu/uuid/%noFormat({_json2::records::%{_num}%::uuidReceiver})%"
copy json {_b3} to {_json3::*}
if {_json3::id} is not set:
stop loop
#wait 1 tick
#broadcast "%loop-index%;%noFormat({_json2::records::%{_num}%::uuidReceiver})%;%{_json3::name}%;receiver"
add "%{_num}%. **%{_json3::name}%** (Receiver)" to {_dis::%discord id of event-member%::*}
else:
delete {_json3::*}
set {_b3} to text from url "https://api.minetools.eu/uuid/%noFormat({_json2::records::%{_num}%::uuidSender})%"
copy json {_b3} to {_json3::*}
if {_json3::id} is not set:
stop loop
#wait 1 tick
#broadcast "%loop-index%;%noFormat({_json2::records::%{_num}%::uuidSender})%;%{_json3::name}%;sender"
add "%{_num}%. **%{_json3::name}%** (Sender)" to {_dis::%discord id of event-member%::*}
loop {_json2::records::*}:
set {_s} to loop-index parsed as integer
make embed:
set title of the embed to "<a:distune_loading:1006642541996814336> Checking Hypixel friends of %{_p}%..."
delete {_prog::*}
add ":white_check_mark: Got account from Mojang API. (Proper Username: %{_json::name}%)" to {_prog::*}
add ":white_check_mark: Got friends from the Hypixel API. The friend list will be displayed in a second." to {_prog::*}
set description of the embed to "This might take a minute if the user has too many friends.%nl%%join {_prog::*} with nl%"
set embed color of the embed to yellow
edit {friends.Embed::%discord id of event-member%::%discord id of event-guild%} with last embed
wait 1 second
set {friends.Pages::%discord id of event-member%::%discord id of event-guild%} and {_pgs} to ceil({_s} / 20)
set {friends.CurrentPage::%discord id of event-member%::%discord id of event-guild%} to 1
set {friends.Information::%discord id of event-member%::%discord id of event-guild%} to "%{_json::name}%;%{_json::id}%"
set {_r::1} to new components row
if {_page} < 2:
add new disabled primary button with id "hfriends-%discord id of event-member%-back" named " " with emote "arrow_left" to components of {_r::1}
else:
add new primary button with id "hfriends-%discord id of event-member%-back" named " " with emote "arrow_left" to components of {_r::1}
add new disabled secondary button with id "hfriends-%discord id of event-member%-pageamt" named "Page %{friends.CurrentPage::%discord id of event-member%::%discord id of event-guild%}%/%{_pgs}%" to components of {_r::1}
add new primary button with id "hfriends-%discord id of event-member%-next" named " " with emote "arrow_right" to components of {_r::1}
set {_r::2} to new components row
add new success button with id "hfriends-%discord id of event-member%-custompagenum" named "Enter Page Number" to components of {_r::2}
make embed:
set title of the embed to "Hypixel - Friends list of %{_json::name}%"
set description of the embed to "%join {_dis::%discord id of event-member%::*} with nl%"
set footer of the embed to "They have %{_s}% friends. Finished action in %System.currentTimeMillis()-{_n1}%ms."
set embed color of the embed to lime
edit {friends.Embed::%discord id of event-member%::%discord id of event-guild%} with last embed with components {_r::*}
stop
on button click:
event-string contains "hfriends"
set {_s::*} to split event-string at "-"
if discord id of event-member != {_s::2}:
reply with hidden ":x: This is not your Hypixel Friends checker session."
stop
if {_s::3} = "next":
defer the interaction
set {_info::*} to split {friends.Information::%discord id of event-member%::%discord id of event-guild%} at ";"
set {_pgs} to {friends.Pages::%discord id of event-member%::%discord id of event-guild%}
add 1 to {friends.CurrentPage::%discord id of event-member%::%discord id of event-guild%}
set {_p} to {_info::1}
make embed:
set title of the embed to "<a:distune_loading:1006642541996814336> Checking Hypixel friends of %{_info::1}%..."
delete {_prog::*}
add "<a:distune_loading:1006642541996814336> Getting new friends list from Hypixel API..." to {_prog::*}
set description of the embed to "This might take a minute if the user has too many friends.%nl%%join {_prog::*} with nl%"
set embed color of the embed to yellow
edit {friends.Embed::%discord id of event-member%::%discord id of event-guild%} with last embed
set {_n1} to System.currentTimeMillis()
set {_b2} to text from url "https://api.hypixel.net/friends?key=%{apiKey}%&uuid=%{_info::2}%"
copy json {_b2} to {_json2::*}
#broadcast "%{_b2}% | %{_json2::*}%"
# Edit this when doing buttons/dropdown
set {_page} to {friends.CurrentPage::%discord id of event-member%::%discord id of event-guild%}
set {_start} to ({_page} * 20)-20
set {_end} to {_page} * 20
broadcast "%{_page}% %{_start}% %{_end}%"
loop (({_page}*20)) times:
set {_num} to loop-number
if {_num} < {_start}:
continue
if noFormat({_json2::records::%{_num}%::uuidSender}) = {_info::2}:
delete {_json3::*}
set {_b3} to text from url "https://api.minetools.eu/uuid/%noFormat({_json2::records::%{_num}%::uuidReceiver})%"
copy json {_b3} to {_json3::*}
if {_json3::id} is not set:
stop loop
#wait 1 tick
#broadcast "%loop-number%;%noFormat({_json2::records::%{_num}%::uuidReceiver})%;%{_json3::name}%;receiver"
add "%{_num}%. **%{_json3::name}%** (Receiver)" to {_dis::%discord id of event-member%::*}
else:
delete {_json3::*}
set {_b3} to text from url "https://api.minetools.eu/uuid/%noFormat({_json2::records::%{_num}%::uuidSender})%"
copy json {_b3} to {_json3::*}
if {_json3::id} is not set:
stop loop
#wait 1 tick
#broadcast "%loop-number%;%noFormat({_json2::records::%{_num}%::uuidSender})%;%{_json3::name}%;sender"
add "%{_num}%. **%{_json3::name}%** (Sender)" to {_dis::%discord id of event-member%::*}
loop {_json2::records::*}:
set {_s} to loop-index parsed as integer
make embed:
set title of the embed to "<a:distune_loading:1006642541996814336> Checking Hypixel friends of %{_p}%..."
delete {_prog::*}
add ":white_check_mark: Got friends from the Hypixel API. The edited friend list will be displayed in a second." to {_prog::*}
set description of the embed to "This might take a minute if the user has too many friends.%nl%%join {_prog::*} with nl%"
set embed color of the embed to yellow
edit {friends.Embed::%discord id of event-member%::%discord id of event-guild%} with last embed
wait 1 second
set {_pgs} to {friends.Pages::%discord id of event-member%::%discord id of event-guild%}
set {_r::1} to new components row
if {_page} < 2:
add new disabled primary button with id "hfriends-%discord id of event-member%-back" named " " with emote "arrow_left" to components of {_r::1}
else:
add new primary button with id "hfriends-%discord id of event-member%-back" named " " with emote "arrow_left" to components of {_r::1}
add new disabled secondary button with id "hfriends-%discord id of event-member%-pageamt" named "Page %{friends.CurrentPage::%discord id of event-member%::%discord id of event-guild%}%/%{_pgs}%" to components of {_r::1}
if {_page} = {_pgs}:
add new disabled primary button with id "hfriends-%discord id of event-member%-next" named " " with emote "arrow_right" to components of {_r::1}
else:
add new primary button with id "hfriends-%discord id of event-member%-next" named " " with emote "arrow_right" to components of {_r::1}
set {_r::2} to new components row
add new success button with id "hfriends-%discord id of event-member%-custompagenum" named "Enter Page Number" to components of {_r::2}
make embed:
set title of the embed to "Hypixel - Friends list of %{_info::1}%"
set description of the embed to "%join {_dis::%discord id of event-member%::*} with nl%"
set footer of the embed to "They have %{_s}% friends. Finished action in %System.currentTimeMillis()-{_n1}%ms."
set embed color of the embed to lime
edit {friends.Embed::%discord id of event-member%::%discord id of event-guild%} with last embed with components {_r::*}
stop
if {_s::3} = "back":
defer the interaction
set {_info::*} to split {friends.Information::%discord id of event-member%::%discord id of event-guild%} at ";"
set {_pgs} to {friends.Pages::%discord id of event-member%::%discord id of event-guild%}
remove 1 from {friends.CurrentPage::%discord id of event-member%::%discord id of event-guild%}
set {_p} to {_info::1}
make embed:
set title of the embed to "<a:distune_loading:1006642541996814336> Checking Hypixel friends of %{_info::1}%..."
delete {_prog::*}
add "<a:distune_loading:1006642541996814336> Getting new friends list from Hypixel API..." to {_prog::*}
set description of the embed to "This might take a minute if the user has too many friends.%nl%%join {_prog::*} with nl%"
set embed color of the embed to yellow
edit {friends.Embed::%discord id of event-member%::%discord id of event-guild%} with last embed
set {_n1} to System.currentTimeMillis()
set {_b2} to text from url "https://api.hypixel.net/friends?key=%{apiKey}%&uuid=%{_info::2}%"
copy json {_b2} to {_json2::*}
#broadcast "%{_b2}% | %{_json2::*}%"
# Edit this when doing buttons/dropdown
set {_page} to {friends.CurrentPage::%discord id of event-member%::%discord id of event-guild%}
set {_start} to ({_page} * 20)-20
set {_end} to {_page} * 20
broadcast "%{_page}% %{_start}% %{_end}%"
loop (({_page}*20)) times:
set {_num} to loop-number
if {_num} < {_start}:
continue
if noFormat({_json2::records::%{_num}%::uuidSender}) = {_info::2}:
delete {_json3::*}
set {_b3} to text from url "https://api.minetools.eu/uuid/%noFormat({_json2::records::%{_num}%::uuidReceiver})%"
copy json {_b3} to {_json3::*}
if {_json3::id} is not set:
stop loop
#wait 1 tick
#broadcast "%loop-number%;%noFormat({_json2::records::%{_num}%::uuidReceiver})%;%{_json3::name}%;receiver"
add "%{_num}%. **%{_json3::name}%** (Receiver)" to {_dis::%discord id of event-member%::*}
else:
delete {_json3::*}
set {_b3} to text from url "https://api.minetools.eu/uuid/%noFormat({_json2::records::%{_num}%::uuidSender})%"
copy json {_b3} to {_json3::*}
if {_json3::id} is not set:
stop loop
#wait 1 tick
#broadcast "%loop-number%;%noFormat({_json2::records::%{_num}%::uuidSender})%;%{_json3::name}%;sender"
add "%{_num}%. **%{_json3::name}%** (Sender)" to {_dis::%discord id of event-member%::*}
loop {_json2::records::*}:
set {_s} to loop-index parsed as integer
make embed:
set title of the embed to "<a:distune_loading:1006642541996814336> Checking Hypixel friends of %{_p}%..."
delete {_prog::*}
add ":white_check_mark: Got friends from the Hypixel API. The edited friend list will be displayed in a second." to {_prog::*}
set description of the embed to "This might take a minute if the user has too many friends.%nl%%join {_prog::*} with nl%"
set embed color of the embed to yellow
edit {friends.Embed::%discord id of event-member%::%discord id of event-guild%} with last embed
wait 1 second
set {_pgs} to {friends.Pages::%discord id of event-member%::%discord id of event-guild%}
set {_r::1} to new components row
if {_page} < 2:
add new disabled primary button with id "hfriends-%discord id of event-member%-back" named " " with emote "arrow_left" to components of {_r::1}
else:
add new primary button with id "hfriends-%discord id of event-member%-back" named " " with emote "arrow_left" to components of {_r::1}
add new disabled secondary button with id "hfriends-%discord id of event-member%-pageamt" named "Page %{friends.CurrentPage::%discord id of event-member%::%discord id of event-guild%}%/%{_pgs}%" to components of {_r::1}
if {_page} = {_pgs}:
add new disabled primary button with id "hfriends-%discord id of event-member%-next" named " " with emote "arrow_right" to components of {_r::1}
else:
add new primary button with id "hfriends-%discord id of event-member%-next" named " " with emote "arrow_right" to components of {_r::1}
set {_r::2} to new components row
add new success button with id "hfriends-%discord id of event-member%-custompagenum" named "Enter Page Number" to components of {_r::2}
make embed:
set title of the embed to "Hypixel - Friends list of %{_info::1}%"
set description of the embed to "%join {_dis::%discord id of event-member%::*} with nl%"
set footer of the embed to "They have %{_s}% friends. Finished action in %System.currentTimeMillis()-{_n1}%ms."
set embed color of the embed to lime
edit {friends.Embed::%discord id of event-member%::%discord id of event-guild%} with last embed with components {_r::*}
stop
if {_s::3} = "custompagenum":
set {_m} to new modal with id "hfriends-custompagenum" named "Enter a Page Number..."
set {_r} to new components row
set {_i} to new short text input with id "number" named "Enter the number here"
set placeholder of {_i} to "You may not enter a higher number or any letter."
set min range of {_i} to 1
set max range of {_i} to 4
add {_i} to components of {_r}
set components row of {_m} to {_r}
show {_m} to the user
on modal receive:
event-string = "hfriends-custompagenum"
set {_d::1} to value of text-input with id "number"
set {_shi::*} to split "qwertyuiop[]\!@$%%^&*()_-+=asdfghhjkl;:'""zxcvbnm,./<>?" at ""
replace all {_shi::*} in {_d::1} with ""
set {_num} to {_d::1} parsed as integer
if {_num} > {friends.Pages::%discord id of event-member%::%discord id of event-guild%}:
make embed:
set title of the embed to "Error!"
set description of the embed to "The page number `%{_num}%` is higher than the available pages `%{friends.Pages::%discord id of event-member%::%discord id of event-guild%}%.`"
set embed color of the embed to red
reply with hidden last embed
stop
if "%{_d::1}%" = "":
make embed:
set title of the embed to "Error!"
set description of the embed to "You didn't input anything."
set embed color of the embed to red
reply with hidden last embed
stop
defer the interaction
set {_info::*} to split {friends.Information::%discord id of event-member%::%discord id of event-guild%} at ";"
set {_pgs} to {friends.Pages::%discord id of event-member%::%discord id of event-guild%}
set {friends.CurrentPage::%discord id of event-member%::%discord id of event-guild%} to {_num}
set {_p} to {_info::1}
make embed:
set title of the embed to "<a:distune_loading:1006642541996814336> Checking Hypixel friends of %{_info::1}%..."
delete {_prog::*}
add "<a:distune_loading:1006642541996814336> Getting new friends list from Hypixel API..." to {_prog::*}
set description of the embed to "This might take a minute if the user has too many friends.%nl%%join {_prog::*} with nl%"
set embed color of the embed to yellow
edit {friends.Embed::%discord id of event-member%::%discord id of event-guild%} with last embed
set {_n1} to System.currentTimeMillis()
set {_b2} to text from url "https://api.hypixel.net/friends?key=%{apiKey}%&uuid=%{_info::2}%"
copy json {_b2} to {_json2::*}
#broadcast "%{_b2}% | %{_json2::*}%"
# Edit this when doing buttons/dropdown
set {_page} to {friends.CurrentPage::%discord id of event-member%::%discord id of event-guild%}
set {_start} to ({_page} * 20)-20
set {_end} to {_page} * 20
broadcast "%{_page}% %{_start}% %{_end}%"
loop (({_page}*20)) times:
set {_num} to loop-number
if {_num} < {_start}:
continue
if noFormat({_json2::records::%{_num}%::uuidSender}) = {_info::2}:
delete {_json3::*}
set {_b3} to text from url "https://api.minetools.eu/uuid/%noFormat({_json2::records::%{_num}%::uuidReceiver})%"
copy json {_b3} to {_json3::*}
if {_json3::id} is not set:
stop loop
#wait 1 tick
#broadcast "%loop-number%;%noFormat({_json2::records::%{_num}%::uuidReceiver})%;%{_json3::name}%;receiver"
add "%{_num}%. **%{_json3::name}%** (Receiver)" to {_dis::%discord id of event-member%::*}
else:
delete {_json3::*}
set {_b3} to text from url "https://api.minetools.eu/uuid/%noFormat({_json2::records::%{_num}%::uuidSender})%"
copy json {_b3} to {_json3::*}
if {_json3::id} is not set:
stop loop
#wait 1 tick
#broadcast "%loop-number%;%noFormat({_json2::records::%{_num}%::uuidSender})%;%{_json3::name}%;sender"
add "%{_num}%. **%{_json3::name}%** (Sender)" to {_dis::%discord id of event-member%::*}
loop {_json2::records::*}:
set {_s} to loop-index parsed as integer
make embed:
set title of the embed to "<a:distune_loading:1006642541996814336> Checking Hypixel friends of %{_p}%..."
delete {_prog::*}
add ":white_check_mark: Got friends from the Hypixel API. The edited friend list will be displayed in a second." to {_prog::*}
set description of the embed to "This might take a minute if the user has too many friends.%nl%%join {_prog::*} with nl%"
set embed color of the embed to yellow
edit {friends.Embed::%discord id of event-member%::%discord id of event-guild%} with last embed
wait 1 second
set {_pgs} to {friends.Pages::%discord id of event-member%::%discord id of event-guild%}
set {_r::1} to new components row
if {_page} < 2:
add new disabled primary button with id "hfriends-%discord id of event-member%-back" named " " with emote "arrow_left" to components of {_r::1}
else:
add new primary button with id "hfriends-%discord id of event-member%-back" named " " with emote "arrow_left" to components of {_r::1}
add new disabled secondary button with id "hfriends-%discord id of event-member%-pageamt" named "Page %{friends.CurrentPage::%discord id of event-member%::%discord id of event-guild%}%/%{_pgs}%" to components of {_r::1}
if {_page} = {_pgs}:
add new disabled primary button with id "hfriends-%discord id of event-member%-next" named " " with emote "arrow_right" to components of {_r::1}
else:
add new primary button with id "hfriends-%discord id of event-member%-next" named " " with emote "arrow_right" to components of {_r::1}
set {_r::2} to new components row
add new success button with id "hfriends-%discord id of event-member%-custompagenum" named "Enter Page Number" to components of {_r::2}
make embed:
set title of the embed to "Hypixel - Friends list of %{_info::1}%"
set description of the embed to "%join {_dis::%discord id of event-member%::*} with nl%"
set footer of the embed to "They have %{_s}% friends. Finished action in %System.currentTimeMillis()-{_n1}%ms."
set embed color of the embed to lime
edit {friends.Embed::%discord id of event-member%::%discord id of event-guild%} with last embed with components {_r::*}
stop
function hypixel_getflag(c: string) :: string:
return ":flag_gb: English" if {_c} = "english"
return ":flag_cn: Chinese (Simplified)" if {_c} = "CHINESE_SIMPLIFIED"
return ":flag_cn: Chinese (Traditional)" if {_c} = "CHINISE_TRADITIONAL"
return ":flag_cz: Czech" if {_c} = "CZECH"
return ":flag_nl: Dutch" if {_c} = "DUTCH"
return ":flag_fi: Finnish" if {_c} = "FINNISH"
return ":flag_fr: French" if {_c} = "FRENCH"
return ":flag_de: German" if {_c} = "GERMAN"
return ":flag_gr: Greek" if {_c} = "GREEK"
return ":flag_it: Italian" if {_c} = "ITALIAN"
return ":flag_jp: Japanese" if {_c} = "JAPANESE"
return ":flag_kr: Korean" if {_c} = "KOREAN"
return ":flag_no: Norwegian" if {_c} = "NORWEGIAN"
return ":pirate_flag: (Pirate Speak)" if {_c} = "PIRATE"
return ":flag_pl: Polish" if {_c} = "POLISH"
return ":flag_pt: Portuguese (Portugal)" if {_c} = "PORTUGUESE_PT"
return ":flag_br: Portuguese (Brazil)" if {_c} = "PORTUGUESE_BR"
return ":flag_ru: Russian" if {_c} = "RUSSIAN"
return ":flag_es: Spanish" if {_c} = "SPANISH"
return ":flag_tr: Turkish" if {_c} = "TURKISH"
return ":flag_ua: Ukranian" if {_c} = "UKRAINIAN"
on slash command:
event-string = "hypixel/info"
set {_n1} to System.currentTimeMillis()
set {_p} to argument "player" as string
make embed:
set title of the embed to "<a:distune_loading:1006642541996814336> Checking Hypixel info of %{_p}%..."
delete {_prog::*}
add "<a:distune_loading:1006642541996814336> Getting account UUID from Mojang API..." to {_prog::*}
add "<a:distune_loading:1006642541996814336> Getting information from Hypixel API..." to {_prog::*}
set description of the embed to "%join {_prog::*} with nl%"
set embed color of the embed to yellow
reply with last embed and store it in {info.Embed::%discord id of event-member%}
set {_b} to text from url "https://api.minetools.eu/uuid/%{_p}%"
copy json {_b} to {_json::*}
if {_json::status} = "ERR":
make embed:
set title of the embed to ":x: Checking Hypixel info of %{_p}%..."
delete {_prog::*}
add ":x: Getting account UUID from Mojang API..." to {_prog::*}
add ":x: Getting information from Hypixel API..." to {_prog::*}
set description of the embed to "%join {_prog::*} with nl%"
set embed color of the embed to red
edit {info.Embed::%discord id of event-member%} with last embed
delete {info.Embed::%discord id of event-member%}
stop
make embed:
set title of the embed to "<a:distune_loading:1006642541996814336> Checking Hypixel info of %{_p}%..."
delete {_prog::*}
add ":white_check_mark: Got account from Mojang API. (Proper Username: %{_json::name}%)" to {_prog::*}
add "<a:distune_loading:1006642541996814336> Getting information from Hypixel API..." to {_prog::*}
set description of the embed to "%join {_prog::*} with nl%"
set embed color of the embed to yellow
edit {info.Embed::%discord id of event-member%} with last embed
set {_b2} to text from url "https://api.hypixel.net/player?key=%{apiKey}%&uuid=%{_json::id}%"
copy json {_b2} to {_json2::*}
make embed:
set title of the embed to ":white_check_mark: Checking Hypixel info of %{_p}%..."
delete {_prog::*}
add ":white_check_mark: Got account from Mojang API. (Proper Username: %{_json::name}%)" to {_prog::*}
add ":white_check_mark: Got information from Hypixel API, will display it in a second..." to {_prog::*}
set description of the embed to "%join {_prog::*} with nl%"
set embed color of the embed to lime
edit {info.Embed::%discord id of event-member%} with last embed
wait 1 second
loop {_json2::player::knownAliases::*}:
add noFormat(loop-value) to {_aka::*}
set {_r} to new components row
set {_dd} to new dropdown with id "hinfo-%discord id of event-member%-dd"
dropdownMinMax({_dd}, 1, 1)
add new option with value "hinfo-bedwars" named "BedWars" with description "Click here to get BedWars stats." with emote "bed" to options of {_dd}
add new option with value "hinfo-skywars" named "SkyWars" with description "Click here to get SkyWars stats." with emote "island" to options of {_dd}
add {_dd} to components of {_r}
set {info.Info::%discord id of event-member%} to "%{_json::name}%;%{_json::id}%"
make embed:
set title of the embed to "Hypixel - Information about %{_json::name}% - General"
set thumbnail of the embed to "https://minotar.net/helm/%{_json::id}%/100.png"
add field named "Login Information" with value "**First login:** <t:%floor({_json2::player::firstLogin}/1000)%> (<t:%floor({_json2::player::firstLogin}/1000)%:R>)%nl%**Last login:** <t:%floor({_json2::player::lastLogin}/1000)%> (<t:%floor({_json2::player::lastLogin}/1000)%:R>)%nl%**Last logout:** <t:%floor({_json2::player::lastLogout}/1000)%> (<t:%floor({_json2::player::lastLogout}/1000)%:R>)" to embed
add inline field named "Also known as" with value "%join {_aka::*} with nl%" to embed
add inline field named "Points" with value "**Achivement points:** %{_json2::player::achievementPoints}% points%nl%**Karma:** %{_json2::player::karma}%" to embed
add field named "~~---------------------------------------~~" with value " " to embed
add inline field named "Language" with value "%hypixel_getflag({_json2::player::userLanguage})%" to embed
set embed color of the embed to lime
set footer of the embed to "Got information in %System.currentTimeMillis()-{_n1}%ms."
edit {info.Embed::%discord id of event-member%} with last embed with components {_r}
stop
on dropdown click:
event-string contains "hinfo"
set {_s::*} to split event-string at "-"
if discord id of event-member != {_s::2}:
reply with hidden ":x: This is not your Hypixel Info session."
stop
if {_s::3} = "dd":
set {_sv::*} to split "%selected values%" at "-"
if {_sv::2} = "bedwars":
defer the interaction
set {_n1} to System.currentTimeMillis()
set {_i::*} to split {info.Info::%discord id of event-member%} at ";"
set {_p} to {_i::1}
make embed:
set title of the embed to "<a:distune_loading:1006642541996814336> Checking Hypixel BedWars info of %{_p}%..."
delete {_prog::*}
add "<a:distune_loading:1006642541996814336> Getting information from Hypixel API..." to {_prog::*}
set description of the embed to "%join {_prog::*} with nl%"
set embed color of the embed to yellow
edit {info.Embed::%discord id of event-member%} with last embed
set {_b} to text from url "https://api.hypixel.net/player?key=%{apiKey}%&uuid=%{_i::2}%"
copy json {_b} to {_json::*}
broadcast "%{_json::player::stats::Bedwars::*}%"
if {_json::player::stats::Bedwars::*} is not set:
make embed:
set title of the embed to ":x: Checking Hypixel BedWars info of %{_p}%..."
delete {_prog::*}
add ":x: %{_p}% never played BedWars." to {_prog::*}
set description of the embed to "%join {_prog::*} with nl%"
set embed color of the embed to red
edit {info.Embed::%discord id of event-member%} with last embed
delete {info.Embed::%discord id of event-member%}
stop
set {_r} to new components row
set {_dd} to new dropdown with id "hinfo-%discord id of event-member%-inbedwars"
dropdownMinMax({_dd}, 1, 1)
add new option with value "hinfo-overall" named "Overall" with description "Gets overall stats for BedWars." with emote "trophy" to options of {_dd}
add new default option with value "hinfo-solo" named "Solo Stats" with description "Get stats for Solo BedWars." with emote "man" to options of {_dd}
add new option with value "hinfo-doubles" named "Doubles Stats" with description "Get stats for Doubles BedWars." with emote "family_man_boy" to options of {_dd}
add new option with value "hinfo-3v3" named "3v3 Stats" with description "Get stats for 3v3 BedWars." with emote "family_man_boy" to options of {_dd}
add new option with value "hinfo-4v4" named "4v4 Stats" with description "Get stats for 4v4 BedWars." with emote "family_mmbb" to options of {_dd}
add {_dd} to components of {_r}
make embed:
set title of the embed to ":white_check_mark: Checking Hypixel BedWars info of %{_p}%..."
delete {_prog::*}
add ":white_check_mark: Got information from Hypixel API, will display it in a second..." to {_prog::*}
set description of the embed to "%join {_prog::*} with nl%"
set embed color of the embed to lime
edit {info.Embed::%discord id of event-member%} with last embed
wait 1 second
make embed:
set title of the embed to "Hypixel - Information about %{_i::1}% - Solo BedWars"
set description of the embed to "Currently displaying information about **Solo BedWars**."
add inline field named "Wins & Losses :trophy:" with value "**Wins:** %{_json::player::stats::Bedwars::eight_one_wins_bedwars} ? 0%%nl%**Winstreak:** %{_json::player::stats::Bedwars::eight_one_winstreak} ? 0%%nl%**Losses:** %{_json::player::stats::Bedwars::eight_one_losses_bedwars} ? 0%%nl%**Win/Loss ratio (WLR):** %{_json::player::stats::Bedwars::eight_one_wins_bedwars}/{_json::player::stats::Bedwars::eight_one_losses_bedwars} ? 0%" to embed
add inline field named "Resource Collection" with value "**Items Purchased:** %{_json::player::stats::Bedwars::eight_one__items_purchased_bedwars} ? 0%%nl%**Iron:** %{_json::player::stats::Bedwars::eight_one_iron_resources_collected_bedwars} ? 0%%nl%**Gold:** %{_json::player::stats::Bedwars::eight_one_gold_resources_collected_bedwars} ? 0%%nl%**Diamond:** %{_json::player::stats::Bedwars::eight_one_diamond_resources_collected_bedwars} ? 0%%nl%**Emerald:** %{_json::player::stats::Bedwars::eight_one_emerald_resources_collected_bedwars} ? 0%" to embed
add inline field named "Beds" with value "**Beds Broken:** %{_json::player::stats::Bedwars::eight_one_beds_broken_bedwars} ? 0%%nl%**Beds Lost:** %{_json::player::stats::Bedwars::eight_one_beds_lost_bedwars} ? 0%%nl%**Bed broken/lost ratio (BBLR):** %{_json::player::stats::Bedwars::eight_one_beds_broken_bedwars}/{_json::player::stats::Bedwars::eight_one_beds_lost_bedwars} ? 0%" to embed
add inline field named "Kills" with value "**Final Kills:** %{_json::player::stats::Bedwars::eight_one_final_kills_bedwars} ? 0%%nl%**Final Deaths:** %{_json::player::stats::Bedwars::eight_one_final_deaths_bedwars} ? 0%%nl%**Final Kill/Death Ratio (FKDR):** %{_json::player::stats::Bedwars::eight_one_final_kills_bedwars}/{_json::player::stats::Bedwars::eight_one_final_deaths_bedwars} ? 0%%nl%%nl%**Kills:** %{_json::player::stats::Bedwars::eight_one_kills_bedwars} ? 0% (%{_json::player::stats::Bedwars::eight_one_void_kills_bedwars} ? 0% void kills)%nl%**Deaths:** %{_json::player::stats::Bedwars::eight_one_deaths_bedwars} ? 0%%nl%**Kill/Death ratio (KDR):** %{_json::player::stats::Bedwars::eight_one_kills_bedwars}/{_json::player::stats::Bedwars::eight_one_deaths_bedwars} ? 0%" to embed
add inline field named "Games Played" with value "**%{_json::player::stats::Bedwars::eight_one_games_played_bedwars} ? 0%** games" to embed
set embed color of the embed to lime
set footer of the embed to "Got information in %System.currentTimeMillis()-{_n1}%ms."
edit {info.Embed::%discord id of event-member%} with last embed with components {_r}
stop
if {_s::3} = "inbedwars":
set {_sv::*} to split "%selected values%" at "-"
if {_sv::2} = "overall":
defer the interaction
set {_n1} to System.currentTimeMillis()
set {_i::*} to split {info.Info::%discord id of event-member%} at ";"
set {_p} to {_i::1}
make embed:
set title of the embed to "<a:distune_loading:1006642541996814336> Checking Hypixel BedWars info of %{_p}%..."
delete {_prog::*}
add "<a:distune_loading:1006642541996814336> Getting information from Hypixel API..." to {_prog::*}
set description of the embed to "%join {_prog::*} with nl%"
set embed color of the embed to yellow
edit {info.Embed::%discord id of event-member%} with last embed
set {_b} to text from url "https://api.hypixel.net/player?key=%{apiKey}%&uuid=%{_i::2}%"
copy json {_b} to {_json::*}
broadcast "%{_json::player::stats::Bedwars::*}%"
if {_json::player::stats::Bedwars::*} is not set:
make embed:
set title of the embed to ":x: Checking Hypixel BedWars info of %{_p}%..."
delete {_prog::*}
add ":x: %{_p}% never played BedWars." to {_prog::*}
set description of the embed to "%join {_prog::*} with nl%"
set embed color of the embed to red
edit {info.Embed::%discord id of event-member%} with last embed
delete {info.Embed::%discord id of event-member%}
stop
set {_r} to new components row
set {_dd} to new dropdown with id "hinfo-%discord id of event-member%-inbedwars"
dropdownMinMax({_dd}, 1, 1)
add new default option with value "hinfo-overall" named "Overall" with description "Gets overall stats for BedWars." with emote "trophy" to options of {_dd}
add new option with value "hinfo-solo" named "Solo Stats" with description "Get stats for Solo BedWars." with emote "man" to options of {_dd}
add new option with value "hinfo-doubles" named "Doubles Stats" with description "Get stats for Doubles BedWars." with emote "family_man_boy" to options of {_dd}
add new option with value "hinfo-3v3" named "3v3 Stats" with description "Get stats for 3v3 BedWars." with emote "family_man_boy" to options of {_dd}
add new option with value "hinfo-4v4" named "4v4 Stats" with description "Get stats for 4v4 BedWars." with emote "family_mmbb" to options of {_dd}
add {_dd} to components of {_r}
make embed:
set title of the embed to ":white_check_mark: Checking Hypixel BedWars info of %{_p}%..."
delete {_prog::*}
add ":white_check_mark: Got information from Hypixel API, will display it in a second..." to {_prog::*}
set description of the embed to "%join {_prog::*} with nl%"
set embed color of the embed to lime
edit {info.Embed::%discord id of event-member%} with last embed
wait 1 second
make embed:
set title of the embed to "Hypixel - Information about %{_i::1}% - BedWars"
set description of the embed to "Currently displaying information about **BedWars**."
add inline field named "Wins & Losses :trophy:" with value "**Wins:** %{_json::player::stats::Bedwars::wins_bedwars} ? 0%%nl%**Winstreak:** %{_json::player::stats::Bedwars::winstreak} ? 0%%nl%**Losses:** %{_json::player::stats::Bedwars::losses_bedwars} ? 0%%nl%**Win/Loss ratio (WLR):** %{_json::player::stats::Bedwars::wins_bedwars}/{_json::player::stats::Bedwars::losses_bedwars} ? 0%" to embed
add inline field named "Resource Collection" with value "**Items Purchased:** %{_json::player::stats::Bedwars::_items_purchased_bedwars} ? 0%%nl%**Iron:** %{_json::player::stats::Bedwars::iron_resources_collected_bedwars} ? 0%%nl%**Gold:** %{_json::player::stats::Bedwars::gold_resources_collected_bedwars} ? 0%%nl%**Diamond:** %{_json::player::stats::Bedwars::diamond_resources_collected_bedwars} ? 0%%nl%**Emerald:** %{_json::player::stats::Bedwars::emerald_resources_collected_bedwars} ? 0%" to embed
add inline field named "Beds" with value "**Beds Broken:** %{_json::player::stats::Bedwars::beds_broken_bedwars} ? 0%%nl%**Beds Lost:** %{_json::player::stats::Bedwars::beds_lost_bedwars} ? 0%%nl%**Bed broken/lost ratio (BBLR):** %{_json::player::stats::Bedwars::beds_broken_bedwars}/{_json::player::stats::Bedwars::beds_lost_bedwars} ? 0%" to embed
add inline field named "Kills" with value "**Final Kills:** %{_json::player::stats::Bedwars::final_kills_bedwars} ? 0%%nl%**Final Deaths:** %{_json::player::stats::Bedwars::final_deaths_bedwars} ? 0%%nl%**Final Kill/Death Ratio (FKDR):** %{_json::player::stats::Bedwars::final_kills_bedwars}/{_json::player::stats::Bedwars::final_deaths_bedwars} ? 0%%nl%%nl%**Kills:** %{_json::player::stats::Bedwars::kills_bedwars} ? 0% (%{_json::player::stats::Bedwars::void_kills_bedwars} ? 0% void kills)%nl%**Deaths:** %{_json::player::stats::Bedwars::deaths_bedwars} ? 0%%nl%**Kill/Death ratio (KDR):** %{_json::player::stats::Bedwars::kills_bedwars}/{_json::player::stats::Bedwars::deaths_bedwars} ? 0%" to embed
add inline field named "Games Played" with value "**%{_json::player::stats::Bedwars::games_played_bedwars} ? 0%** games" to embed
add inline field named "General" with value "**Coins:** %{_json::player::stats::Bedwars::coins} ? 0%%nl%**XP:** %{_json::player::stats::Bedwars::Experience} ? 0%%nl%**Unopened Loot Boxes:** %{_json::player::stats::Bedwars::bedwars_boxes} ? 0%%nl%**Opened loot boxes:** %{_json::player::stats::Bedwars::Bedwars_openedChests} ? 0%,%nl%**%{_json::player::stats::Bedwars::Bedwars_openedCommons} ? 0%** commons,%nl%**%{_json::player::stats::Bedwars::Bedwars_openedRares} ? 0%** rares,%nl%**%{_json::player::stats::Bedwars::Bedwars_openedEpics} ? 0%** epics,%nl%**%{_json::player::stats::Bedwars::Bedwars_openedLegendaries} ? 0%** legendaries" to embed
set embed color of the embed to lime
set footer of the embed to "Got information in %System.currentTimeMillis()-{_n1}%ms."
edit {info.Embed::%discord id of event-member%} with last embed with components {_r}
stop
if {_sv::2} = "solo":
defer the interaction
set {_n1} to System.currentTimeMillis()
set {_i::*} to split {info.Info::%discord id of event-member%} at ";"
set {_p} to {_i::1}
make embed:
set title of the embed to "<a:distune_loading:1006642541996814336> Checking Hypixel BedWars info of %{_p}%..."
delete {_prog::*}
add "<a:distune_loading:1006642541996814336> Getting information from Hypixel API..." to {_prog::*}
set description of the embed to "%join {_prog::*} with nl%"
set embed color of the embed to yellow
edit {info.Embed::%discord id of event-member%} with last embed
set {_b} to text from url "https://api.hypixel.net/player?key=%{apiKey}%&uuid=%{_i::2}%"
copy json {_b} to {_json::*}
broadcast "%{_json::player::stats::Bedwars::*}%"
if {_json::player::stats::Bedwars::*} is not set:
make embed:
set title of the embed to ":x: Checking Hypixel BedWars info of %{_p}%..."
delete {_prog::*}
add ":x: %{_p}% never played BedWars." to {_prog::*}
set description of the embed to "%join {_prog::*} with nl%"
set embed color of the embed to red
edit {info.Embed::%discord id of event-member%} with last embed
delete {info.Embed::%discord id of event-member%}
stop
set {_r} to new components row
set {_dd} to new dropdown with id "hinfo-%discord id of event-member%-inbedwars"
dropdownMinMax({_dd}, 1, 1)
add new option with value "hinfo-overall" named "Overall" with description "Gets overall stats for BedWars." with emote "trophy" to options of {_dd}
add new default option with value "hinfo-solo" named "Solo Stats" with description "Get stats for Solo BedWars." with emote "man" to options of {_dd}
add new option with value "hinfo-doubles" named "Doubles Stats" with description "Get stats for Doubles BedWars." with emote "family_man_boy" to options of {_dd}
add new option with value "hinfo-3v3" named "3v3 Stats" with description "Get stats for 3v3 BedWars." with emote "family_man_boy" to options of {_dd}
add new option with value "hinfo-4v4" named "4v4 Stats" with description "Get stats for 4v4 BedWars." with emote "family_mmbb" to options of {_dd}
add {_dd} to components of {_r}
make embed:
set title of the embed to ":white_check_mark: Checking Hypixel BedWars info of %{_p}%..."
delete {_prog::*}
add ":white_check_mark: Got information from Hypixel API, will display it in a second..." to {_prog::*}
set description of the embed to "%join {_prog::*} with nl%"
set embed color of the embed to lime
edit {info.Embed::%discord id of event-member%} with last embed
wait 1 second
make embed:
set title of the embed to "Hypixel - Information about %{_i::1}% - BedWars"
set description of the embed to "Currently displaying information about **BedWars**."
add inline field named "Wins & Losses :trophy:" with value "**Wins:** %{_json::player::stats::Bedwars::wins_bedwars} ? 0%%nl%**Winstreak:** %{_json::player::stats::Bedwars::winstreak} ? 0%%nl%**Losses:** %{_json::player::stats::Bedwars::losses_bedwars} ? 0%%nl%**Win/Loss ratio (WLR):** %{_json::player::stats::Bedwars::wins_bedwars}/{_json::player::stats::Bedwars::losses_bedwars} ? 0%" to embed
add inline field named "Resource Collection" with value "**Items Purchased:** %{_json::player::stats::Bedwars::_items_purchased_bedwars} ? 0%%nl%**Iron:** %{_json::player::stats::Bedwars::iron_resources_collected_bedwars} ? 0%%nl%**Gold:** %{_json::player::stats::Bedwars::gold_resources_collected_bedwars} ? 0%%nl%**Diamond:** %{_json::player::stats::Bedwars::diamond_resources_collected_bedwars} ? 0%%nl%**Emerald:** %{_json::player::stats::Bedwars::emerald_resources_collected_bedwars} ? 0%" to embed
add inline field named "Beds" with value "**Beds Broken:** %{_json::player::stats::Bedwars::beds_broken_bedwars} ? 0%%nl%**Beds Lost:** %{_json::player::stats::Bedwars::beds_lost_bedwars} ? 0%%nl%**Bed broken/lost ratio (BBLR):** %{_json::player::stats::Bedwars::beds_broken_bedwars}/{_json::player::stats::Bedwars::beds_lost_bedwars} ? 0%" to embed
add inline field named "Kills" with value "**Final Kills:** %{_json::player::stats::Bedwars::final_kills_bedwars} ? 0%%nl%**Final Deaths:** %{_json::player::stats::Bedwars::final_deaths_bedwars} ? 0%%nl%**Final Kill/Death Ratio (FKDR):** %{_json::player::stats::Bedwars::final_kills_bedwars}/{_json::player::stats::Bedwars::final_deaths_bedwars} ? 0%%nl%%nl%**Kills:** %{_json::player::stats::Bedwars::kills_bedwars} ? 0% (%{_json::player::stats::Bedwars::void_kills_bedwars} ? 0% void kills)%nl%**Deaths:** %{_json::player::stats::Bedwars::deaths_bedwars} ? 0%%nl%**Kill/Death ratio (KDR):** %{_json::player::stats::Bedwars::kills_bedwars}/{_json::player::stats::Bedwars::deaths_bedwars} ? 0%" to embed
add inline field named "Games Played" with value "**%{_json::player::stats::Bedwars::games_played_bedwars} ? 0%** games" to embed
set embed color of the embed to lime
set footer of the embed to "Got information in %System.currentTimeMillis()-{_n1}%ms."
edit {info.Embed::%discord id of event-member%} with last embed with components {_r}
stop
if {_sv::2} = "doubles":
defer the interaction
set {_n1} to System.currentTimeMillis()
set {_i::*} to split {info.Info::%discord id of event-member%} at ";"
set {_p} to {_i::1}
make embed:
set title of the embed to "<a:distune_loading:1006642541996814336> Checking Hypixel BedWars info of %{_p}%..."
delete {_prog::*}
add "<a:distune_loading:1006642541996814336> Getting information from Hypixel API..." to {_prog::*}
set description of the embed to "%join {_prog::*} with nl%"
set embed color of the embed to yellow
edit {info.Embed::%discord id of event-member%} with last embed
set {_b} to text from url "https://api.hypixel.net/player?key=%{apiKey}%&uuid=%{_i::2}%"
copy json {_b} to {_json::*}
broadcast "%{_json::player::stats::Bedwars::*}%"
if {_json::player::stats::Bedwars::*} is not set:
make embed:
set title of the embed to ":x: Checking Hypixel BedWars info of %{_p}%..."
delete {_prog::*}
add ":x: %{_p}% never played BedWars." to {_prog::*}
set description of the embed to "%join {_prog::*} with nl%"
set embed color of the embed to red
edit {info.Embed::%discord id of event-member%} with last embed
delete {info.Embed::%discord id of event-member%}
stop
set {_r} to new components row
set {_dd} to new dropdown with id "hinfo-%discord id of event-member%-inbedwars"
dropdownMinMax({_dd}, 1, 1)
add new option with value "hinfo-overall" named "Overall" with description "Gets overall stats for BedWars." with emote "trophy" to options of {_dd}
add new option with value "hinfo-solo" named "Solo Stats" with description "Get stats for Solo BedWars." with emote "man" to options of {_dd}
add new default option with value "hinfo-doubles" named "Doubles Stats" with description "Get stats for Doubles BedWars." with emote "family_man_boy" to options of {_dd}
add new option with value "hinfo-3v3" named "3v3 Stats" with description "Get stats for 3v3 BedWars." with emote "family_man_boy" to options of {_dd}
add new option with value "hinfo-4v4" named "4v4 Stats" with description "Get stats for 4v4 BedWars." with emote "family_mmbb" to options of {_dd}
add {_dd} to components of {_r}
make embed:
set title of the embed to ":white_check_mark: Checking Hypixel BedWars info of %{_p}%..."
delete {_prog::*}
add ":white_check_mark: Got information from Hypixel API, will display it in a second..." to {_prog::*}
set description of the embed to "%join {_prog::*} with nl%"
set embed color of the embed to lime
edit {info.Embed::%discord id of event-member%} with last embed
wait 1 second
make embed:
set title of the embed to "Hypixel - Information about %{_i::1}% - Doubles BedWars"
set description of the embed to "Currently displaying information about **Doubles BedWars**."
add inline field named "Wins & Losses :trophy:" with value "**Wins:** %{_json::player::stats::Bedwars::eight_two_wins_bedwars} ? 0%%nl%**Winstreak:** %{_json::player::stats::Bedwars::eight_two_winstreak} ? 0%%nl%**Losses:** %{_json::player::stats::Bedwars::eight_two_losses_bedwars} ? 0%%nl%**Win/Loss ratio (WLR):** %{_json::player::stats::Bedwars::eight_two_wins_bedwars}/{_json::player::stats::Bedwars::eight_two_losses_bedwars} ? 0%" to embed
add inline field named "Resource Collection" with value "**Items Purchased:** %{_json::player::stats::Bedwars::eight_two__items_purchased_bedwars} ? 0%%nl%**Iron:** %{_json::player::stats::Bedwars::eight_two_iron_resources_collected_bedwars} ? 0%%nl%**Gold:** %{_json::player::stats::Bedwars::eight_two_gold_resources_collected_bedwars} ? 0%%nl%**Diamond:** %{_json::player::stats::Bedwars::eight_two_diamond_resources_collected_bedwars} ? 0%%nl%**Emerald:** %{_json::player::stats::Bedwars::eight_two_emerald_resources_collected_bedwars} ? 0%" to embed
add inline field named "Beds" with value "**Beds Broken:** %{_json::player::stats::Bedwars::eight_two_beds_broken_bedwars} ? 0%%nl%**Beds Lost:** %{_json::player::stats::Bedwars::eight_two_beds_lost_bedwars} ? 0%%nl%**Bed broken/lost ratio (BBLR):** %{_json::player::stats::Bedwars::eight_two_beds_broken_bedwars}/{_json::player::stats::Bedwars::eight_two_beds_lost_bedwars} ? 0%" to embed
add inline field named "Kills" with value "**Final Kills:** %{_json::player::stats::Bedwars::eight_two_final_kills_bedwars} ? 0%%nl%**Final Deaths:** %{_json::player::stats::Bedwars::eight_two_final_deaths_bedwars} ? 0%%nl%**Final Kill/Death Ratio (FKDR):** %{_json::player::stats::Bedwars::eight_two_final_kills_bedwars}/{_json::player::stats::Bedwars::eight_two_final_deaths_bedwars} ? 0%%nl%%nl%**Kills:** %{_json::player::stats::Bedwars::eight_two_kills_bedwars} ? 0% (%{_json::player::stats::Bedwars::eight_two_void_kills_bedwars} ? 0% void kills)%nl%**Deaths:** %{_json::player::stats::Bedwars::eight_two_deaths_bedwars} ? 0%%nl%**Kill/Death ratio (KDR):** %{_json::player::stats::Bedwars::eight_two_kills_bedwars}/{_json::player::stats::Bedwars::eight_two_deaths_bedwars} ? 0%" to embed
add inline field named "Games Played" with value "**%{_json::player::stats::Bedwars::eight_two_games_played_bedwars} ? 0%** games" to embed
set embed color of the embed to lime
set footer of the embed to "Got information in %System.currentTimeMillis()-{_n1}%ms."
edit {info.Embed::%discord id of event-member%} with last embed with components {_r}
stop
if {_sv::2} = "3v3":
defer the interaction
set {_n1} to System.currentTimeMillis()
set {_i::*} to split {info.Info::%discord id of event-member%} at ";"
set {_p} to {_i::1}
make embed:
set title of the embed to "<a:distune_loading:1006642541996814336> Checking Hypixel BedWars info of %{_p}%..."
delete {_prog::*}
add "<a:distune_loading:1006642541996814336> Getting information from Hypixel API..." to {_prog::*}
set description of the embed to "%join {_prog::*} with nl%"
set embed color of the embed to yellow
edit {info.Embed::%discord id of event-member%} with last embed
set {_b} to text from url "https://api.hypixel.net/player?key=%{apiKey}%&uuid=%{_i::2}%"
copy json {_b} to {_json::*}
broadcast "%{_json::player::stats::Bedwars::*}%"
if {_json::player::stats::Bedwars::*} is not set:
make embed:
set title of the embed to ":x: Checking Hypixel BedWars info of %{_p}%..."
delete {_prog::*}
add ":x: %{_p}% never played BedWars." to {_prog::*}
set description of the embed to "%join {_prog::*} with nl%"
set embed color of the embed to red
edit {info.Embed::%discord id of event-member%} with last embed
delete {info.Embed::%discord id of event-member%}
stop
set {_r} to new components row
set {_dd} to new dropdown with id "hinfo-%discord id of event-member%-inbedwars"
dropdownMinMax({_dd}, 1, 1)
add new option with value "hinfo-overall" named "Overall" with description "Gets overall stats for BedWars." with emote "trophy" to options of {_dd}
add new option with value "hinfo-solo" named "Solo Stats" with description "Get stats for Solo BedWars." with emote "man" to options of {_dd}
add new option with value "hinfo-doubles" named "Doubles Stats" with description "Get stats for Doubles BedWars." with emote "family_man_boy" to options of {_dd}
add new default option with value "hinfo-3v3" named "3v3 Stats" with description "Get stats for 3v3 BedWars." with emote "family_man_boy" to options of {_dd}
add new option with value "hinfo-4v4" named "4v4 Stats" with description "Get stats for 4v4 BedWars." with emote "family_mmbb" to options of {_dd}
add {_dd} to components of {_r}
make embed:
set title of the embed to ":white_check_mark: Checking Hypixel BedWars info of %{_p}%..."
delete {_prog::*}
add ":white_check_mark: Got information from Hypixel API, will display it in a second..." to {_prog::*}
set description of the embed to "%join {_prog::*} with nl%"
set embed color of the embed to lime
edit {info.Embed::%discord id of event-member%} with last embed
wait 1 second
make embed:
set title of the embed to "Hypixel - Information about %{_i::1}% - 3v3 BedWars"
set description of the embed to "Currently displaying information about **3v3 BedWars**."
add inline field named "Wins & Losses :trophy:" with value "**Wins:** %{_json::player::stats::Bedwars::four_three_wins_bedwars} ? 0%%nl%**Winstreak:** %{_json::player::stats::Bedwars::four_three_winstreak} ? 0%%nl%**Losses:** %{_json::player::stats::Bedwars::four_three_losses_bedwars} ? 0%%nl%**Win/Loss ratio (WLR):** %{_json::player::stats::Bedwars::four_three_wins_bedwars}/{_json::player::stats::Bedwars::four_three_losses_bedwars} ? 0%" to embed
add inline field named "Resource Collection" with value "**Items Purchased:** %{_json::player::stats::Bedwars::four_three__items_purchased_bedwars} ? 0%%nl%**Iron:** %{_json::player::stats::Bedwars::four_three_iron_resources_collected_bedwars} ? 0%%nl%**Gold:** %{_json::player::stats::Bedwars::four_three_gold_resources_collected_bedwars} ? 0%%nl%**Diamond:** %{_json::player::stats::Bedwars::four_three_diamond_resources_collected_bedwars} ? 0%%nl%**Emerald:** %{_json::player::stats::Bedwars::four_three_emerald_resources_collected_bedwars} ? 0%" to embed
add inline field named "Beds" with value "**Beds Broken:** %{_json::player::stats::Bedwars::four_three_beds_broken_bedwars} ? 0%%nl%**Beds Lost:** %{_json::player::stats::Bedwars::four_three_beds_lost_bedwars} ? 0%%nl%**Bed broken/lost ratio (BBLR):** %{_json::player::stats::Bedwars::four_three_beds_broken_bedwars}/{_json::player::stats::Bedwars::four_three_beds_lost_bedwars} ? 0%" to embed
add inline field named "Kills" with value "**Final Kills:** %{_json::player::stats::Bedwars::four_three_final_kills_bedwars} ? 0%%nl%**Final Deaths:** %{_json::player::stats::Bedwars::four_three_final_deaths_bedwars} ? 0%%nl%**Final Kill/Death Ratio (FKDR):** %{_json::player::stats::Bedwars::four_three_final_kills_bedwars}/{_json::player::stats::Bedwars::four_three_final_deaths_bedwars} ? 0%%nl%%nl%**Kills:** %{_json::player::stats::Bedwars::four_three_kills_bedwars} ? 0% (%{_json::player::stats::Bedwars::four_three_void_kills_bedwars} ? 0% void kills)%nl%**Deaths:** %{_json::player::stats::Bedwars::four_three_deaths_bedwars} ? 0%%nl%**Kill/Death ratio (KDR):** %{_json::player::stats::Bedwars::four_three_kills_bedwars}/{_json::player::stats::Bedwars::four_three_deaths_bedwars} ? 0%" to embed
add inline field named "Games Played" with value "**%{_json::player::stats::Bedwars::four_three_games_played_bedwars} ? 0%** games" to embed
set embed color of the embed to lime
set footer of the embed to "Got information in %System.currentTimeMillis()-{_n1}%ms."
edit {info.Embed::%discord id of event-member%} with last embed with components {_r}
stop
if {_sv::2} = "4v4":
defer the interaction
set {_n1} to System.currentTimeMillis()
set {_i::*} to split {info.Info::%discord id of event-member%} at ";"