Compare commits
1469 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7a552106ff | ||
|
|
39933fedaa | ||
|
|
65dca9a9a6 | ||
|
|
b87134ebfb | ||
|
|
3f5dfa8a27 | ||
|
|
cb5ec9372b | ||
|
|
7d77fdf08c | ||
|
|
726f7fcd36 | ||
|
|
9a035f2d2c | ||
|
|
392b756c6b | ||
|
|
1639b7e1cc | ||
|
|
401e3004ab | ||
|
|
93add2d2f1 | ||
|
|
652fa1b1b6 | ||
|
|
7f40b104e7 | ||
|
|
3677ac051d | ||
|
|
8973f778c1 | ||
|
|
11fce9102a | ||
|
|
6ab56c8fad | ||
|
|
847a489024 | ||
|
|
7824e51028 | ||
|
|
10ca88fb1f | ||
|
|
957e3fa779 | ||
|
|
cbd336f624 | ||
|
|
50fb8578fc | ||
|
|
8ff17d181b | ||
|
|
fb72352bca | ||
|
|
1c98eb6271 | ||
|
|
cf8a96b4a6 | ||
|
|
199faf028a | ||
|
|
78990c6024 | ||
|
|
2ef06dc681 | ||
|
|
f22d4b9d5f | ||
|
|
53ef051937 | ||
|
|
26b1e04059 | ||
|
|
2a669e3167 | ||
|
|
6f7ec411e6 | ||
|
|
e818ae3aa5 | ||
|
|
7a480f030f | ||
|
|
fd8645d2b9 | ||
|
|
5baf6a411e | ||
|
|
a1ac5987a1 | ||
|
|
83de6a5013 | ||
|
|
d677c993e7 | ||
|
|
0acad735c6 | ||
|
|
f120fd36cd | ||
|
|
78444645ab | ||
|
|
cc71e2746d | ||
|
|
c3b6a9dfea | ||
|
|
e1559924f5 | ||
|
|
0d5202ee17 | ||
|
|
d221cb34f2 | ||
|
|
f9c7d94bff | ||
|
|
74ebc2630d | ||
|
|
f9b2b68405 | ||
|
|
b68db933d8 | ||
|
|
9e009e058e | ||
|
|
f07f016340 | ||
|
|
573c1634d2 | ||
|
|
6effeba808 | ||
|
|
2c82ecdb72 | ||
|
|
008d72abb1 | ||
|
|
f61738539f | ||
|
|
595f254d6f | ||
|
|
8cf312cfde | ||
|
|
452a735cd5 | ||
|
|
246e734917 | ||
|
|
c202ae1a9e | ||
|
|
9bc2aed8c5 | ||
|
|
e75eb72d6e | ||
|
|
8e7ec75d30 | ||
|
|
a7fff80e15 | ||
|
|
9f877bbaf5 | ||
|
|
15e2db76f1 | ||
|
|
a5352aa557 | ||
|
|
16c3cae86b | ||
|
|
85fe2291e0 | ||
|
|
363cec9713 | ||
|
|
5cd3dacce5 | ||
|
|
04d82efb54 | ||
|
|
94601f0297 | ||
|
|
35985663a9 | ||
|
|
c405228a6d | ||
|
|
cdb2dcc936 | ||
|
|
125858a958 | ||
|
|
069da09920 | ||
|
|
8a741fc26e | ||
|
|
80fe6c75aa | ||
|
|
c1f8616371 | ||
|
|
9d802a7c14 | ||
|
|
eda6d7521c | ||
|
|
1bb4de61b7 | ||
|
|
b91b993954 | ||
|
|
c68889c0c4 | ||
|
|
fc60dc23c3 | ||
|
|
29eef12081 | ||
|
|
7ed2ff4048 | ||
|
|
2b35024787 | ||
|
|
8c9f8776d0 | ||
|
|
42c6da3056 | ||
|
|
03640d758e | ||
|
|
28e4a4d28e | ||
|
|
25abdae5f8 | ||
|
|
71c1b27e71 | ||
|
|
5a11502df5 | ||
|
|
6a39a977de | ||
|
|
963df9b514 | ||
|
|
d48061d495 | ||
|
|
a6d78b2fcb | ||
|
|
e94886f4f3 | ||
|
|
281e0f8ae6 | ||
|
|
ba5757fe05 | ||
|
|
3a608264f7 | ||
|
|
419bbfed93 | ||
|
|
3d6e8cc082 | ||
|
|
229b2dc89f | ||
|
|
01aae9ac17 | ||
|
|
c5a1881d43 | ||
|
|
0427689f5d | ||
|
|
ecda552e8f | ||
|
|
5c23a810d0 | ||
|
|
4d06604292 | ||
|
|
31cf1612db | ||
|
|
96426febde | ||
|
|
2740c546e6 | ||
|
|
406e92ff1c | ||
|
|
6c8b697455 | ||
|
|
ca1dd18dfa | ||
|
|
b308a8bc25 | ||
|
|
162efd08f6 | ||
|
|
5c5a53fdd2 | ||
|
|
2892ac5a8a | ||
|
|
0553e9fe98 | ||
|
|
5cb7d83e00 | ||
|
|
89146c9594 | ||
|
|
64eaee9a25 | ||
|
|
2747184924 | ||
|
|
ac58acb802 | ||
|
|
6735336e23 | ||
|
|
d6109a767e | ||
|
|
92903f3fbd | ||
|
|
8142e592e1 | ||
|
|
130845ed68 | ||
|
|
ae0703e2ca | ||
|
|
30b283dffc | ||
|
|
096573bbc4 | ||
|
|
b0e2696162 | ||
|
|
09bf327640 | ||
|
|
53fc632cea | ||
|
|
ab04197641 | ||
|
|
68d2ffbf8e | ||
|
|
3af0867311 | ||
|
|
9979b986d2 | ||
|
|
a28dce1853 | ||
|
|
a75daeb528 | ||
|
|
bda3745505 | ||
|
|
193a9e75e4 | ||
|
|
26ce5fa1c8 | ||
|
|
f6dc9ec5d1 | ||
|
|
40788383ff | ||
|
|
dc3b28ce5d | ||
|
|
35ac2de233 | ||
|
|
ce3e3741cc | ||
|
|
0cb46d4935 | ||
|
|
a24e769c30 | ||
|
|
300121fbe3 | ||
|
|
e5123a9947 | ||
|
|
f918ea18eb | ||
|
|
2b4848577f | ||
|
|
6f785661e3 | ||
|
|
be3396002e | ||
|
|
c22bd793df | ||
|
|
8493e8fa75 | ||
|
|
9cb51bb885 | ||
|
|
72128884bf | ||
|
|
b4ac77f5b7 | ||
|
|
c875911021 | ||
|
|
4f7cc97bdc | ||
|
|
69e6d0f7c6 | ||
|
|
bfdf4f37d8 | ||
|
|
d4a7e2b348 | ||
|
|
ed9f8b9e15 | ||
|
|
8b1697b5e3 | ||
|
|
33fb98e9bb | ||
|
|
3a7daa069a | ||
|
|
33fb3d6768 | ||
|
|
8ea8225417 | ||
|
|
b2e7001316 | ||
|
|
68cae30881 | ||
|
|
ba6d58961b | ||
|
|
146dab68dd | ||
|
|
6f69aa4921 | ||
|
|
06fd342049 | ||
|
|
a3d4e5f44a | ||
|
|
deea115da8 | ||
|
|
bdb1b357da | ||
|
|
97e30ecbbf | ||
|
|
ba8cec0b51 | ||
|
|
72b1be5fb4 | ||
|
|
255723f08d | ||
|
|
543d481b8b | ||
|
|
7595021c81 | ||
|
|
a0cda209c2 | ||
|
|
b175e56e56 | ||
|
|
c671573c80 | ||
|
|
296a938e34 | ||
|
|
e8064daf2f | ||
|
|
0a360344fb | ||
|
|
ea4a5b8637 | ||
|
|
e9ba6542a1 | ||
|
|
89c990554d | ||
|
|
dfc97ef593 | ||
|
|
6ce62d55e0 | ||
|
|
75182dba10 | ||
|
|
dd2350c2a0 | ||
|
|
fb129559fa | ||
|
|
8b001a53ba | ||
|
|
e06634b74c | ||
|
|
76c7dfe078 | ||
|
|
c6fd963db1 | ||
|
|
fd14ec18a2 | ||
|
|
3f2cbee6b8 | ||
|
|
a757d51a60 | ||
|
|
2c85286414 | ||
|
|
a2afb31ec6 | ||
|
|
8a9b4c529f | ||
|
|
24854897ec | ||
|
|
9e8bd70a4b | ||
|
|
f64ca9a29a | ||
|
|
09fbb7890c | ||
|
|
195a8939fb | ||
|
|
d32f3701fd | ||
|
|
43cc708223 | ||
|
|
3fd83e6637 | ||
|
|
b9e39124da | ||
|
|
10c8f8c279 | ||
|
|
a24cb12aab | ||
|
|
c83d0c9b23 | ||
|
|
352eba5565 | ||
|
|
76617a9913 | ||
|
|
2625889d8d | ||
|
|
9ff8b81517 | ||
|
|
703fecf8b8 | ||
|
|
bca1b11d70 | ||
|
|
0d8be5a478 | ||
|
|
8e7ae1db06 | ||
|
|
f86f420adb | ||
|
|
a334681f06 | ||
|
|
56a52b2763 | ||
|
|
10c8667f8b | ||
|
|
29593e7861 | ||
|
|
82652e45f7 | ||
|
|
b237fcc9e3 | ||
|
|
fe70972e19 | ||
|
|
0e8e32d31d | ||
|
|
94c78bea55 | ||
|
|
9e40e3d19c | ||
|
|
02dd6a5d39 | ||
|
|
cb85df34af | ||
|
|
2104810692 | ||
|
|
08d6382411 | ||
|
|
f2f9abfdd0 | ||
|
|
c96a4af95f | ||
|
|
f48636d98b | ||
|
|
cf923c43cf | ||
|
|
767786846c | ||
|
|
130f1083c6 | ||
|
|
bf4e07bebe | ||
|
|
741bbb7399 | ||
|
|
ef16fbc686 | ||
|
|
c11c75bfd3 | ||
|
|
a597c1dd0e | ||
|
|
3f472bdc40 | ||
|
|
9dd30c883d | ||
|
|
9bbb319808 | ||
|
|
86e9259ad1 | ||
|
|
2cbb78af39 | ||
|
|
b17c944508 | ||
|
|
6a8fa3028a | ||
|
|
be5b9896db | ||
|
|
5d283f504f | ||
|
|
be12f99ab8 | ||
|
|
a70950d72c | ||
|
|
bf06c8af0b | ||
|
|
f75137e87c | ||
|
|
4ff99c82ff | ||
|
|
34e4f5a1b8 | ||
|
|
f4db0def1e | ||
|
|
4156ba9d22 | ||
|
|
5b895b0c99 | ||
|
|
e127ba9614 | ||
|
|
b725ae3cd9 | ||
|
|
b7ce8c9429 | ||
|
|
28051a3f0d | ||
|
|
55b541c860 | ||
|
|
514d658532 | ||
|
|
1ad0f269c0 | ||
|
|
7160c1600e | ||
|
|
b1996f487f | ||
|
|
8d0d9ec29a | ||
|
|
a22aecabdc | ||
|
|
f21976d41d | ||
|
|
b0aad2a2b0 | ||
|
|
4a9a72d0d3 | ||
|
|
02c4312e49 | ||
|
|
f50f1ea0c3 | ||
|
|
f2a5354476 | ||
|
|
f5698c7668 | ||
|
|
2acc57a931 | ||
|
|
d77a4ea834 | ||
|
|
a0e4a95028 | ||
|
|
656cce4851 | ||
|
|
99073c9120 | ||
|
|
750dfaeebd | ||
|
|
082dbb6c33 | ||
|
|
4ae9459ca3 | ||
|
|
21e1be211f | ||
|
|
112ea391ba | ||
|
|
9436646633 | ||
|
|
f94ccbbc52 | ||
|
|
59e62442c1 | ||
|
|
f38ceefd5e | ||
|
|
d71177ab94 | ||
|
|
c0e89f0e58 | ||
|
|
449c7a5761 | ||
|
|
041f12bb6a | ||
|
|
8dfdad4e03 | ||
|
|
4d1a1e42e3 | ||
|
|
2cb0babb37 | ||
|
|
458d27cc85 | ||
|
|
69dfc4cd5b | ||
|
|
93108ca0ae | ||
|
|
c2ab5cda57 | ||
|
|
62f475ac3a | ||
|
|
a61ccae038 | ||
|
|
1376039b5a | ||
|
|
7a4549c566 | ||
|
|
d2d9f16ad9 | ||
|
|
4a16b9f70f | ||
|
|
bed9752a9f | ||
|
|
f79ca4162e | ||
|
|
19c7a5ce74 | ||
|
|
173e8f1fb0 | ||
|
|
58a5f2039e | ||
|
|
8342df2e05 | ||
|
|
97ab945c46 | ||
|
|
6335ae17a5 | ||
|
|
390c5e8425 | ||
|
|
146648e9d0 | ||
|
|
6deb57e556 | ||
|
|
87e0d14136 | ||
|
|
3adc7ccee6 | ||
|
|
82bbd93d76 | ||
|
|
43b19a6fb5 | ||
|
|
fbe9d230a1 | ||
|
|
839830b8b8 | ||
|
|
91041260f1 | ||
|
|
c163bee076 | ||
|
|
9776868727 | ||
|
|
2c45f58400 | ||
|
|
cab3722e80 | ||
|
|
f0334dc100 | ||
|
|
87b50297b9 | ||
|
|
405e740de9 | ||
|
|
a7022b3b46 | ||
|
|
7b2d40855d | ||
|
|
222f874a87 | ||
|
|
8ee2b231e8 | ||
|
|
75d193c9b1 | ||
|
|
012fc231f1 | ||
|
|
c9e163de83 | ||
|
|
f049408f05 | ||
|
|
598e438398 | ||
|
|
1e7bc3c1f9 | ||
|
|
9b423f2df2 | ||
|
|
03002b03ea | ||
|
|
a9d0b0705e | ||
|
|
bd8af1fc68 | ||
|
|
e11fc24d23 | ||
|
|
46306ae7d5 | ||
|
|
736d302650 | ||
|
|
2a5f9e3668 | ||
|
|
109b83ca69 | ||
|
|
f088c970fe | ||
|
|
a4f38c414b | ||
|
|
e23ad07d0d | ||
|
|
07e8c66ba0 | ||
|
|
49a6c6e7e2 | ||
|
|
da6a2908bb | ||
|
|
85c2a97d26 | ||
|
|
b6441c4eaa | ||
|
|
c5e5bbe80b | ||
|
|
a68c7b1de2 | ||
|
|
c86ef37d02 | ||
|
|
aec11909a2 | ||
|
|
ed452ff2b5 | ||
|
|
d525743e78 | ||
|
|
2d7cc8de55 | ||
|
|
59311b26d5 | ||
|
|
ac9a374461 | ||
|
|
e25bb385e1 | ||
|
|
651268fa55 | ||
|
|
c2e1dee7c7 | ||
|
|
b7c403420c | ||
|
|
2d31a64025 | ||
|
|
b05e4de148 | ||
|
|
85b10de093 | ||
|
|
4095ae6cf5 | ||
|
|
6d891e6330 | ||
|
|
60e1f8d991 | ||
|
|
d556fa4b58 | ||
|
|
3152dafd5e | ||
|
|
59bf747fbf | ||
|
|
5a99ef4855 | ||
|
|
867c7dd2ee | ||
|
|
3398653ae0 | ||
|
|
039be72d77 | ||
|
|
c82bf91b14 | ||
|
|
84ea5cf5fa | ||
|
|
070890f172 | ||
|
|
2bb9a46dc6 | ||
|
|
05fa1f4854 | ||
|
|
e0011bae01 | ||
|
|
d05850226c | ||
|
|
2642970bea | ||
|
|
a6762a7e8b | ||
|
|
509c8991b7 | ||
|
|
906b287b97 | ||
|
|
1f7afbfb34 | ||
|
|
d74419a01d | ||
|
|
73c64458c7 | ||
|
|
0644133798 | ||
|
|
5445a9790e | ||
|
|
b279a94a6d | ||
|
|
cee114a07f | ||
|
|
bd322f6680 | ||
|
|
71cd1efdd8 | ||
|
|
72c2cd51a4 | ||
|
|
36eaa61008 | ||
|
|
67a5fa291c | ||
|
|
ab2be55083 | ||
|
|
ef7a0313a1 | ||
|
|
4c258a0b87 | ||
|
|
5204c6abc3 | ||
|
|
48a64510e9 | ||
|
|
af2e0bbba1 | ||
|
|
f7a03f2c10 | ||
|
|
82a9a5faf0 | ||
|
|
4b61c771c5 | ||
|
|
b79506d18c | ||
|
|
3ab0b48f98 | ||
|
|
1c76d05ab4 | ||
|
|
5fc393b81f | ||
|
|
5d09fdf3a6 | ||
|
|
77973d94ab | ||
|
|
7e3c91bf53 | ||
|
|
d38e490f8a | ||
|
|
c8b39ed685 | ||
|
|
3f6950fe71 | ||
|
|
83892f11b9 | ||
|
|
54a3256072 | ||
|
|
b44da1a8b8 | ||
|
|
4c4389b392 | ||
|
|
e40a59fe14 | ||
|
|
9b6a672239 | ||
|
|
d6505e8712 | ||
|
|
7ff1b4c701 | ||
|
|
4d446f736b | ||
|
|
0a737f14f1 | ||
|
|
006a4ca2e7 | ||
|
|
ad833e1307 | ||
|
|
5df56ce183 | ||
|
|
4eceb937a5 | ||
|
|
9f49b149a9 | ||
|
|
5f6357d8ad | ||
|
|
b180092e21 | ||
|
|
9b625de5a8 | ||
|
|
654a8a2416 | ||
|
|
75303b6c19 | ||
|
|
22cf2993b1 | ||
|
|
8b0ee12c3c | ||
|
|
4e8c0eff4d | ||
|
|
75e9745233 | ||
|
|
4dc8934412 | ||
|
|
6fbdd2cf12 | ||
|
|
9497aeaf0b | ||
|
|
88cec812c6 | ||
|
|
7760f0c11d | ||
|
|
9ce9540cbd | ||
|
|
1652d39e04 | ||
|
|
072c4580b0 | ||
|
|
d182599c5c | ||
|
|
c2278f81c5 | ||
|
|
7e5d29041f | ||
|
|
38c339beff | ||
|
|
82a143d74b | ||
|
|
d546ed563a | ||
|
|
66f90d3560 | ||
|
|
72b21300e4 | ||
|
|
6be7a05df2 | ||
|
|
808296d51c | ||
|
|
ada0094065 | ||
|
|
5b5f5306e3 | ||
|
|
f6b4b38c0c | ||
|
|
d1d34abdf1 | ||
|
|
0e20bcfc9a | ||
|
|
6bece53c71 | ||
|
|
209fc0d628 | ||
|
|
9513982930 | ||
|
|
1c7fc61431 | ||
|
|
e18a0ada24 | ||
|
|
97dc352390 | ||
|
|
f0455cb004 | ||
|
|
6737eb432c | ||
|
|
4c926f8610 | ||
|
|
6e0ddfbe3e | ||
|
|
7ddec14f25 | ||
|
|
303dbd572d | ||
|
|
281d8d474d | ||
|
|
6b95254035 | ||
|
|
11fb585997 | ||
|
|
4687805988 | ||
|
|
dfa7c58942 | ||
|
|
1b00df88f8 | ||
|
|
2693530116 | ||
|
|
3ab7d38e3a | ||
|
|
696ccb58d4 | ||
|
|
065a6bb22c | ||
|
|
847e97ea9d | ||
|
|
097cf42f56 | ||
|
|
b274a7b660 | ||
|
|
c9e8416ab1 | ||
|
|
72c8d2d323 | ||
|
|
181c6bb485 | ||
|
|
c9804ceb05 | ||
|
|
1ccbb01fdb | ||
|
|
ab639897eb | ||
|
|
ac8a90a5eb | ||
|
|
65f8396e34 | ||
|
|
5753db788c | ||
|
|
7a12a6af08 | ||
|
|
4584244c83 | ||
|
|
e0b6c0f633 | ||
|
|
e71ce2a15d | ||
|
|
0889b19e1b | ||
|
|
dd82942af8 | ||
|
|
91ee6ee9a5 | ||
|
|
1b8c4bdda3 | ||
|
|
a1282a264d | ||
|
|
887cf26741 | ||
|
|
44f116c006 | ||
|
|
4e7fef54b5 | ||
|
|
59742edb97 | ||
|
|
cee22293cf | ||
|
|
ba1d7d199b | ||
|
|
abf0c09e5b | ||
|
|
16220ec67b | ||
|
|
b7064f12c8 | ||
|
|
d6ebfa4146 | ||
|
|
9a7a2d4d4e | ||
|
|
ede113901d | ||
|
|
4adf354889 | ||
|
|
3d7cf403b5 | ||
|
|
daa4689890 | ||
|
|
e5ab5214cd | ||
|
|
606147b38c | ||
|
|
70e32ebbc6 | ||
|
|
02e348bece | ||
|
|
e5764b8c42 | ||
|
|
7c5a5adcfa | ||
|
|
3c77feb590 | ||
|
|
013064cf5d | ||
|
|
ad387ab051 | ||
|
|
d001ad1115 | ||
|
|
04722d14ad | ||
|
|
c57dc14bb9 | ||
|
|
59d214e7d6 | ||
|
|
5cd0bab3a2 | ||
|
|
8fb3aeda91 | ||
|
|
c1467e4a08 | ||
|
|
6e3508c890 | ||
|
|
840cf5f383 | ||
|
|
b9fbc89089 | ||
|
|
a588815192 | ||
|
|
dc6d6767dd | ||
|
|
4ebf8603a0 | ||
|
|
f807766598 | ||
|
|
f7403ab348 | ||
|
|
c59e7d68a5 | ||
|
|
0bc2fb1a3e | ||
|
|
bb6ab6866c | ||
|
|
d85a602301 | ||
|
|
8a6d18ec6c | ||
|
|
cac8532f41 | ||
|
|
3adc5c632b | ||
|
|
b19ef6ba80 | ||
|
|
97a2350410 | ||
|
|
cf8bbcec78 | ||
|
|
f005f55c00 | ||
|
|
ed65509e6f | ||
|
|
e94a888261 | ||
|
|
55d6d0af07 | ||
|
|
6ffb0a2d99 | ||
|
|
cd171804f1 | ||
|
|
295e88a89a | ||
|
|
76f2ea3202 | ||
|
|
3a5dc59b03 | ||
|
|
b64e7159cf | ||
|
|
aa0637d237 | ||
|
|
1e9198525c | ||
|
|
8b7d07b988 | ||
|
|
c6f2db6e54 | ||
|
|
3efa60702d | ||
|
|
2b04af204a | ||
|
|
1a14d92c00 | ||
|
|
02853f554e | ||
|
|
1c0ca30c4e | ||
|
|
fbe6154e54 | ||
|
|
21f8cd0d21 | ||
|
|
d82cdb7d89 | ||
|
|
d863d559d9 | ||
|
|
bd8cc48818 | ||
|
|
0282ada6dc | ||
|
|
a7421244b6 | ||
|
|
cc9ebc0d95 | ||
|
|
231ca28b22 | ||
|
|
1a96fa143a | ||
|
|
f89c176e38 | ||
|
|
5784a2e12c | ||
|
|
8a96a78b25 | ||
|
|
965bf9d3d8 | ||
|
|
c5517d237b | ||
|
|
2dd271ebf3 | ||
|
|
48a453456e | ||
|
|
d47236291e | ||
|
|
fc46756281 | ||
|
|
69623072da | ||
|
|
2a15c34b72 | ||
|
|
38595bb1d0 | ||
|
|
b6c4664636 | ||
|
|
042dc8cbbb | ||
|
|
5b88891555 | ||
|
|
b5fd95a996 | ||
|
|
a2d3d1ae86 | ||
|
|
27ad976c0b | ||
|
|
a2ff33800d | ||
|
|
31ff3602f5 | ||
|
|
844f4bd4ea | ||
|
|
8a8606fd53 | ||
|
|
8007a77ba0 | ||
|
|
83019b9c25 | ||
|
|
3b8ffbdde3 | ||
|
|
ebfa0fdd9c | ||
|
|
85a0b10860 | ||
|
|
99eef07fe0 | ||
|
|
745c48c74a | ||
|
|
a0db6e89bd | ||
|
|
7d8566c67d | ||
|
|
100db9898d | ||
|
|
7e9479d0e8 | ||
|
|
8ba4a1ed21 | ||
|
|
8d0fdd07e3 | ||
|
|
7a0f4ef4dd | ||
|
|
643e3f8c4a | ||
|
|
3de190b620 | ||
|
|
303b121f2b | ||
|
|
0770e1dc63 | ||
|
|
c420508f2e | ||
|
|
681834fcfc | ||
|
|
3e3b9ee50a | ||
|
|
980abe1304 | ||
|
|
3636c764ca | ||
|
|
d8104b53ab | ||
|
|
7a2ccf0ac9 | ||
|
|
a51e4d6440 | ||
|
|
fe7efa6b84 | ||
|
|
c4f8648535 | ||
|
|
8bde70bdec | ||
|
|
0999fdfb48 | ||
|
|
e74d464184 | ||
|
|
f2b8dc70f6 | ||
|
|
e77dd007a0 | ||
|
|
8413d0d661 | ||
|
|
1438fba6ba | ||
|
|
632fa3cb31 | ||
|
|
bdf2310618 | ||
|
|
bdbc20e686 | ||
|
|
6dbc1b4edc | ||
|
|
7f07743f28 | ||
|
|
cc5b2946d7 | ||
|
|
6d766f9150 | ||
|
|
d9c5710b6f | ||
|
|
14509bd92f | ||
|
|
a43e5fb2a5 | ||
|
|
8f660ce36a | ||
|
|
7068178610 | ||
|
|
fdcb948a61 | ||
|
|
43679a7b38 | ||
|
|
1125ffd5fb | ||
|
|
b8cf0cfe05 | ||
|
|
36994799bd | ||
|
|
b4a25bfc97 | ||
|
|
39cef6b5fd | ||
|
|
8de3748f1a | ||
|
|
e031eb1532 | ||
|
|
7eae616892 | ||
|
|
42756339f9 | ||
|
|
e0df9cc738 | ||
|
|
fbbdb9f488 | ||
|
|
8b4926aab2 | ||
|
|
7cc51d680e | ||
|
|
35f932c377 | ||
|
|
7b811d9cb7 | ||
|
|
6f78671f02 | ||
|
|
ba9672f87d | ||
|
|
e731d4bce0 | ||
|
|
71bfe01285 | ||
|
|
ceb6037591 | ||
|
|
55977585ac | ||
|
|
e811da3aeb | ||
|
|
3a56c0da11 | ||
|
|
ae815985fb | ||
|
|
304c588dbb | ||
|
|
5ccb9dbdfa | ||
|
|
e373e26fff | ||
|
|
841821abe3 | ||
|
|
94b89ede03 | ||
|
|
4e6842bcd3 | ||
|
|
e725604500 | ||
|
|
c12e4e8e7c | ||
|
|
5cc7acfe0d | ||
|
|
081da47b71 | ||
|
|
9431db7e8b | ||
|
|
6489ad6cc5 | ||
|
|
4484231a8c | ||
|
|
9d292592e4 | ||
|
|
08e3948db3 | ||
|
|
eadf88e6b8 | ||
|
|
5ae930edc5 | ||
|
|
01fa3085bc | ||
|
|
f721b21ddb | ||
|
|
92c437888b | ||
|
|
72cbcc18f7 | ||
|
|
e2a550321e | ||
|
|
6c23b8c9bb | ||
|
|
86bdd4b19f | ||
|
|
2535568163 | ||
|
|
af03da1913 | ||
|
|
3d47b3a014 | ||
|
|
a6fe1d419f | ||
|
|
5671288155 | ||
|
|
6963935348 | ||
|
|
431ecf8a67 | ||
|
|
ca0f0f5693 | ||
|
|
3d010c42cf | ||
|
|
66d7b6906b | ||
|
|
d0d75bfaf7 | ||
|
|
586ce7b151 | ||
|
|
85611bf069 | ||
|
|
7519b7724f | ||
|
|
8f642f44a9 | ||
|
|
06c3abc283 | ||
|
|
f6e0dea5f2 | ||
|
|
8f0beeb150 | ||
|
|
16e1f5b9b3 | ||
|
|
ac854a8f20 | ||
|
|
5c5c98dde9 | ||
|
|
1eb7e87493 | ||
|
|
815eed8320 | ||
|
|
f5dc5d75e3 | ||
|
|
19eac6445a | ||
|
|
e0bfe15fcb | ||
|
|
7a2be533d9 | ||
|
|
9ff1848a1f | ||
|
|
4a7d6ea2d1 | ||
|
|
40d6a6ab95 | ||
|
|
0f92e0b22e | ||
|
|
a460e3d3cc | ||
|
|
df636bc32b | ||
|
|
b3b542f3b2 | ||
|
|
c53e8164f1 | ||
|
|
e6da414968 | ||
|
|
569852042c | ||
|
|
546aed85fd | ||
|
|
58409100b3 | ||
|
|
b9f7493e95 | ||
|
|
5fce950a42 | ||
|
|
2a0bff749a | ||
|
|
91d146f68b | ||
|
|
0b281a20ac | ||
|
|
92f583a467 | ||
|
|
a08d86c07c | ||
|
|
dc3a2ca96a | ||
|
|
ec6c8c7527 | ||
|
|
cab29c3340 | ||
|
|
0940478cd7 | ||
|
|
a5e3c2a84f | ||
|
|
578ee5bdc1 | ||
|
|
f26484b13b | ||
|
|
af2eaa72ad | ||
|
|
a533de3dd1 | ||
|
|
0b4ace9c80 | ||
|
|
0cf1f11c20 | ||
|
|
a46e2249c6 | ||
|
|
b5b18ac525 | ||
|
|
bf6ff1954c | ||
|
|
af7c114970 | ||
|
|
d42bc8a872 | ||
|
|
4d745c1842 | ||
|
|
59b35bdb4b | ||
|
|
7c68ecb8c2 | ||
|
|
18b8a86a7d | ||
|
|
b3784dea10 | ||
|
|
56676c52e1 | ||
|
|
518fbe150a | ||
|
|
2f14e96228 | ||
|
|
500164c391 | ||
|
|
f87ded15ac | ||
|
|
e047a9a5ee | ||
|
|
9785e85b07 | ||
|
|
6cf18befd8 | ||
|
|
fdc1e11f74 | ||
|
|
0cc33da8e4 | ||
|
|
4a878d1b50 | ||
|
|
bf11d80665 | ||
|
|
bf38422661 | ||
|
|
2419033d09 | ||
|
|
f2ff1ccc05 | ||
|
|
62eb40a56c | ||
|
|
1f3a9023d4 | ||
|
|
f1894436d7 | ||
|
|
faf3a35958 | ||
|
|
c4ab4e085a | ||
|
|
96eb486661 | ||
|
|
e178c724f9 | ||
|
|
5523443501 | ||
|
|
1eb6218641 | ||
|
|
0350d41e1a | ||
|
|
50bde9375d | ||
|
|
8cfdb109e3 | ||
|
|
944f8fc65a | ||
|
|
d367426644 | ||
|
|
fc214ac44a | ||
|
|
bd8a412ef4 | ||
|
|
c08d5290b9 | ||
|
|
62adda7083 | ||
|
|
14166c1e35 | ||
|
|
2e2614b951 | ||
|
|
db436aeb7f | ||
|
|
eabaf6dd5c | ||
|
|
214b84d0c5 | ||
|
|
79d5d67b55 | ||
|
|
fb03036b91 | ||
|
|
4bdbb6e0b9 | ||
|
|
b64fa332eb | ||
|
|
ab739a4850 | ||
|
|
a162f4a323 | ||
|
|
d4abc84584 | ||
|
|
497ec1bbe7 | ||
|
|
c6f28a8aca | ||
|
|
7329c95314 | ||
|
|
0137556f69 | ||
|
|
056a467ce1 | ||
|
|
f56c566887 | ||
|
|
682c83832d | ||
|
|
f8615d5246 | ||
|
|
56ca4a5c75 | ||
|
|
42c8fb8685 | ||
|
|
b6a543b0a7 | ||
|
|
710ee00e4f | ||
|
|
9a9eb334f0 | ||
|
|
07edce3df3 | ||
|
|
80a4137dca | ||
|
|
af3b5553e3 | ||
|
|
e95dc39327 | ||
|
|
c0132ecb21 | ||
|
|
ff011a9c5e | ||
|
|
11b0c7879a | ||
|
|
93598e51ea | ||
|
|
2d9fb1e1e4 | ||
|
|
d4064b395c | ||
|
|
60187df58c | ||
|
|
a2dd22f0cf | ||
|
|
6cb0929f41 | ||
|
|
ee66d0c252 | ||
|
|
9eb96dc820 | ||
|
|
f7324ab62a | ||
|
|
f6d0e45746 | ||
|
|
748fd7c1b2 | ||
|
|
003aa8b3d7 | ||
|
|
d3e9bdf2dc | ||
|
|
5cfc4857ec | ||
|
|
81ef854db2 | ||
|
|
1d7ad8af31 | ||
|
|
a5c432157f | ||
|
|
e16f97acc0 | ||
|
|
c7fd92fbaf | ||
|
|
887a494509 | ||
|
|
8367b1090f | ||
|
|
c75c7dbcbb | ||
|
|
65ad656adb | ||
|
|
9215058332 | ||
|
|
4646648917 | ||
|
|
cdff88174f | ||
|
|
0b4cc1e792 | ||
|
|
6fc9dd126b | ||
|
|
0558b63cfc | ||
|
|
b2723f9203 | ||
|
|
bcfc8cf9a5 | ||
|
|
a44b1dead0 | ||
|
|
438816feaa | ||
|
|
e67f0d7c96 | ||
|
|
c192f4d3ce | ||
|
|
54441cb672 | ||
|
|
0db2933daf | ||
|
|
0b9a96a7fd | ||
|
|
fa214e1041 | ||
|
|
07b8749e0b | ||
|
|
eb196cca70 | ||
|
|
4e30f59b15 | ||
|
|
2fcd755161 | ||
|
|
9940454f7e | ||
|
|
b94be60fd7 | ||
|
|
7daceb3cbe | ||
|
|
48c8993667 | ||
|
|
73766c256e | ||
|
|
9b992b4886 | ||
|
|
b2cacd77e5 | ||
|
|
5181a4cc02 | ||
|
|
e7370ea6d5 | ||
|
|
187824a8dd | ||
|
|
97491e3ea2 | ||
|
|
1e0da3ab8a | ||
|
|
53a95f78a3 | ||
|
|
5dfbc8e718 | ||
|
|
f30066308b | ||
|
|
c37e32b0be | ||
|
|
697f3d0265 | ||
|
|
d0e2de5fd1 | ||
|
|
554d9c1e2c | ||
|
|
23de50f36c | ||
|
|
69642b5cd2 | ||
|
|
006753ace9 | ||
|
|
83503483ec | ||
|
|
4e015d21d7 | ||
|
|
6060f53e00 | ||
|
|
ee2f8a0811 | ||
|
|
7afba16cde | ||
|
|
fe965a5cf7 | ||
|
|
bd4fda3094 | ||
|
|
16faa926ae | ||
|
|
e5884de59b | ||
|
|
e15a0e00a8 | ||
|
|
1787f67ab3 | ||
|
|
33712ea1a6 | ||
|
|
8d1dd4b175 | ||
|
|
2a91fcae27 | ||
|
|
d09da0f9a4 | ||
|
|
e9a1aee13b | ||
|
|
a9f5aa9f05 | ||
|
|
e8ed580814 | ||
|
|
125b245131 | ||
|
|
6b8d9d3882 | ||
|
|
89231560ee | ||
|
|
838e2103b9 | ||
|
|
b7d0d365b6 | ||
|
|
1ca7ca2fe2 | ||
|
|
971db6625b | ||
|
|
5bba1ab9c3 | ||
|
|
e3f835c9ca | ||
|
|
a939d29c39 | ||
|
|
115389e272 | ||
|
|
1e0969d42c | ||
|
|
511ae6e13b | ||
|
|
db81e6cce9 | ||
|
|
36c1d871ec | ||
|
|
17b63d09ef | ||
|
|
3df08c5e13 | ||
|
|
e80909c2b1 | ||
|
|
03042cc239 | ||
|
|
a806d96bb0 | ||
|
|
e25908a13c | ||
|
|
005f8ef35c | ||
|
|
e1b2ccf3d5 | ||
|
|
9b6f48e58c | ||
|
|
6ddd228b5d | ||
|
|
22dacda281 | ||
|
|
229d3f2a3f | ||
|
|
362fcab0d4 | ||
|
|
2fb0b90b22 | ||
|
|
e807f2c2ff | ||
|
|
441e8ee984 | ||
|
|
1591a24ded | ||
|
|
42fc89d6c4 | ||
|
|
db428212ca | ||
|
|
d53f92f573 | ||
|
|
1aec456d89 | ||
|
|
1d5abe70e4 | ||
|
|
d056d4c6d9 | ||
|
|
665c15fb1f | ||
|
|
eca21ae266 | ||
|
|
49f7b78aee | ||
|
|
68e676d04e | ||
|
|
e332f77432 | ||
|
|
aec2285430 | ||
|
|
63b9d1f96f | ||
|
|
0eab70c78d | ||
|
|
c094a0e5f1 | ||
|
|
607d633d7f | ||
|
|
6b09db43d9 | ||
|
|
949ad0acf0 | ||
|
|
582930ec5c | ||
|
|
c11a6f2c75 | ||
|
|
46960abbbe | ||
|
|
7feaefdd4e | ||
|
|
d47e62d152 | ||
|
|
5734822931 | ||
|
|
072cd9c7a6 | ||
|
|
f8dbd302ab | ||
|
|
6ef8fdfd9b | ||
|
|
b9767b0839 | ||
|
|
1386a468d3 | ||
|
|
5e4d38fe85 | ||
|
|
0d2d05691b | ||
|
|
c2475ebaae | ||
|
|
a58783f3a4 | ||
|
|
d36cac1271 | ||
|
|
08e18bab64 | ||
|
|
342cdb7230 | ||
|
|
c88c5b83e9 | ||
|
|
c6706a848c | ||
|
|
33eec6f6cb | ||
|
|
08fd46c32f | ||
|
|
dba704dd54 | ||
|
|
934f522bb4 | ||
|
|
3cc4a46926 | ||
|
|
6163477aee | ||
|
|
534cf4f50c | ||
|
|
00e1f841b4 | ||
|
|
7ed0d5a7ee | ||
|
|
9564eeab7d | ||
|
|
53a00f79c8 | ||
|
|
76886f1bf8 | ||
|
|
28b1c755fa | ||
|
|
ef24b5fbec | ||
|
|
054d967b70 | ||
|
|
e2bd886eb9 | ||
|
|
d07e8deefd | ||
|
|
26d712dcbd | ||
|
|
c95896e9bf | ||
|
|
490d0d0a67 | ||
|
|
82135650fe | ||
|
|
04a965c3b9 | ||
|
|
910adbca11 | ||
|
|
69761c6428 | ||
|
|
0973651870 | ||
|
|
13155d68fb | ||
|
|
c13e5249d1 | ||
|
|
4725f4a123 | ||
|
|
294372941e | ||
|
|
b6b0ba7e77 | ||
|
|
aad650f31a | ||
|
|
c84fdc3f4a | ||
|
|
31fcd95da8 | ||
|
|
10ab3d75d1 | ||
|
|
c36911206f | ||
|
|
7795782912 | ||
|
|
1b234138f9 | ||
|
|
c799669d7d | ||
|
|
391ef46195 | ||
|
|
efdcd8367a | ||
|
|
09421955e9 | ||
|
|
067b5b3a4d | ||
|
|
a9eed621fd | ||
|
|
b39bd971cc | ||
|
|
ff02659975 | ||
|
|
8d82d737a4 | ||
|
|
8c6d068770 | ||
|
|
3ffadfcafa | ||
|
|
5ee7157e9a | ||
|
|
c8833f5bb9 | ||
|
|
0a7176a758 | ||
|
|
c98592047d | ||
|
|
2eb0772e68 | ||
|
|
e4aad8b597 | ||
|
|
67f440e357 | ||
|
|
ad47502c73 | ||
|
|
d7d118b1e2 | ||
|
|
f232803c73 | ||
|
|
7f5dda93fc | ||
|
|
0b20165986 | ||
|
|
9067f4ebab | ||
|
|
2e663bc932 | ||
|
|
3c39c70f43 | ||
|
|
8f1813dbe2 | ||
|
|
e07dc31703 | ||
|
|
85f456cd07 | ||
|
|
453ec9e9a5 | ||
|
|
2924ed188d | ||
|
|
3a8ee9fee0 | ||
|
|
7ece888c64 | ||
|
|
ce10b5407f | ||
|
|
44d5a37026 | ||
|
|
dc697f6ed5 | ||
|
|
5d43b6f6e0 | ||
|
|
32c58155bf | ||
|
|
b76b1793d3 | ||
|
|
03c49ccd9f | ||
|
|
3de4153c87 | ||
|
|
07f5d67b8b | ||
|
|
29c491fae9 | ||
|
|
78e67fea31 | ||
|
|
c559c9cb56 | ||
|
|
b6b68f20b1 | ||
|
|
0f558eb317 | ||
|
|
bfd2888ad8 | ||
|
|
5a56449886 | ||
|
|
b9379a2ab4 | ||
|
|
e56c2d94eb | ||
|
|
3fc63b57d9 | ||
|
|
762a383ace | ||
|
|
db5bb91fa4 | ||
|
|
9e13ec1b1c | ||
|
|
c82daf0fba | ||
|
|
8b855b2676 | ||
|
|
93d5acda5d | ||
|
|
fb0ef99d83 | ||
|
|
4198f1e245 | ||
|
|
c687cef65d | ||
|
|
da08e3504c | ||
|
|
305e17568f | ||
|
|
1d9416440f | ||
|
|
b79e1fbf74 | ||
|
|
ca940b3497 | ||
|
|
4aba749b3d | ||
|
|
e51f2c8469 | ||
|
|
266bbef903 | ||
|
|
d13b38f572 | ||
|
|
738e593b53 | ||
|
|
9e75a2db7a | ||
|
|
c4835f5981 | ||
|
|
785b895d61 | ||
|
|
c4f3f59b6f | ||
|
|
f9b5d1d15a | ||
|
|
7dd6d95d8c | ||
|
|
3af62f2f25 | ||
|
|
78dfaa6f7b | ||
|
|
16f1dd8e5f | ||
|
|
ece9abb817 | ||
|
|
7e05b76ea7 | ||
|
|
7be9777fb3 | ||
|
|
533e54db43 | ||
|
|
0fa5160c57 | ||
|
|
a0be7a635b | ||
|
|
c522fd1769 | ||
|
|
0e77468d6f | ||
|
|
e2ebdf20a9 | ||
|
|
7a09a2b1bc | ||
|
|
ba46d948cc | ||
|
|
924309a5de | ||
|
|
3f58aacb9d | ||
|
|
a894d14632 | ||
|
|
aebe60d27c | ||
|
|
2b558c00fe | ||
|
|
8ff2f3d7fb | ||
|
|
1b6e261f7c | ||
|
|
b5f4ed98fa | ||
|
|
f18c5e7d2b | ||
|
|
a9f8e9ed24 | ||
|
|
a6b436a475 | ||
|
|
b480ea457f | ||
|
|
7638a89f28 | ||
|
|
c47c4eaf34 | ||
|
|
3b38f70655 | ||
|
|
f7cf03c239 | ||
|
|
484f275a11 | ||
|
|
4abfa70453 | ||
|
|
ba7eb974da | ||
|
|
ec6c295947 | ||
|
|
912dba9158 | ||
|
|
83f72a0cf9 | ||
|
|
58a539a789 | ||
|
|
be29fe5575 | ||
|
|
8909529a9d | ||
|
|
5e96768fe8 | ||
|
|
ec25c6f348 | ||
|
|
190131f355 | ||
|
|
8cb9613fd6 | ||
|
|
ad598590b6 | ||
|
|
872320b304 | ||
|
|
cd899df118 | ||
|
|
c0489f793e | ||
|
|
815c9bab79 | ||
|
|
e5b6ddbf5e | ||
|
|
a6bfb77584 | ||
|
|
0d0b8affbc | ||
|
|
6dfa336a85 | ||
|
|
aefcc0b8e3 | ||
|
|
ea5b80a0c9 | ||
|
|
75eb635b13 | ||
|
|
7a6360cef0 | ||
|
|
3c6e940efc | ||
|
|
54c4898a0d | ||
|
|
d5d7d39707 | ||
|
|
cce9730378 | ||
|
|
51b3e76fb8 | ||
|
|
9307b66c5e | ||
|
|
31b1d96a84 | ||
|
|
02988986a2 | ||
|
|
ea98a2f924 | ||
|
|
03fda46dd7 | ||
|
|
382186910b | ||
|
|
62ce8ed52b | ||
|
|
1283bf8c6b | ||
|
|
ef4eb4ba13 | ||
|
|
282ff6c668 | ||
|
|
54e6c9a261 | ||
|
|
2dbfd349a8 | ||
|
|
6c7445ad32 | ||
|
|
accb85661a | ||
|
|
5ef680e020 | ||
|
|
c50176085e | ||
|
|
c6272c7f25 | ||
|
|
b77e99fc7d | ||
|
|
3fd5b0535c | ||
|
|
3a9868a0f2 | ||
|
|
d2ef685262 | ||
|
|
4d4d250b36 | ||
|
|
d90f276e0b | ||
|
|
43405fe89f | ||
|
|
c574adae44 | ||
|
|
955e8cc151 | ||
|
|
d46240f783 | ||
|
|
78b8a51a18 | ||
|
|
9e66fa1a3b | ||
|
|
61ad916579 | ||
|
|
9af336d63e | ||
|
|
18bd5f2f53 | ||
|
|
d0262a9119 | ||
|
|
b99a458f84 | ||
|
|
e537ce6f3a | ||
|
|
1bf00c9e83 | ||
|
|
2d345c6469 | ||
|
|
fc437b138d | ||
|
|
ef3aed7938 | ||
|
|
2eff728c2f | ||
|
|
cc5177ac04 | ||
|
|
3a6870b74b | ||
|
|
368a4677c8 | ||
|
|
777fb0761e | ||
|
|
5577bc0e23 | ||
|
|
cf2e696da3 | ||
|
|
2d999cc2e2 | ||
|
|
6c27898446 | ||
|
|
d528716b5b | ||
|
|
ff64355163 | ||
|
|
19f7bc920d | ||
|
|
bf5f86f022 | ||
|
|
238f238cd7 | ||
|
|
ed5d625d7d | ||
|
|
14abfb442b | ||
|
|
9d0f60fe56 | ||
|
|
5059e7b165 | ||
|
|
29dd178715 | ||
|
|
4dd6b05bd0 | ||
|
|
3311bcd428 | ||
|
|
aa435eac9a | ||
|
|
f0de290dc6 | ||
|
|
551bb13cbc | ||
|
|
9d34f839e8 | ||
|
|
abca391493 | ||
|
|
c0aa638537 | ||
|
|
e49bddd10c | ||
|
|
3604b0d8d8 | ||
|
|
4fbd8556f3 | ||
|
|
644b68b367 | ||
|
|
d228b1075a | ||
|
|
bd1414ee2d | ||
|
|
0efbc1a10f | ||
|
|
c53c3f43c3 | ||
|
|
1ac1bc2013 | ||
|
|
f6f6c17f6f | ||
|
|
3ab5ee8471 | ||
|
|
d5890dff43 | ||
|
|
285c85fb57 | ||
|
|
facc052cdd | ||
|
|
0185759ab0 | ||
|
|
f1350e78e6 | ||
|
|
933ddb5363 | ||
|
|
79d1607f40 | ||
|
|
e9e1473610 | ||
|
|
afdbd74165 | ||
|
|
50a2fa99bc | ||
|
|
50163ca1b0 | ||
|
|
1eb970fca4 | ||
|
|
25b88c1005 | ||
|
|
d76bd5f338 | ||
|
|
8d19b9ae07 | ||
|
|
bf5d3c8364 | ||
|
|
ec11cf7035 | ||
|
|
c3aaa9a238 | ||
|
|
1c75ed6255 | ||
|
|
c0d39f3624 | ||
|
|
a155cc0d96 | ||
|
|
57b76642d1 | ||
|
|
6e73bcb554 | ||
|
|
14387062bd | ||
|
|
e79450e605 | ||
|
|
e16ac8095f | ||
|
|
851d61dea5 | ||
|
|
0e7c0b941f | ||
|
|
f0c5d94391 | ||
|
|
8f3cfb4d7d | ||
|
|
db5e8f10c2 | ||
|
|
77468a9574 | ||
|
|
672e23b84d | ||
|
|
2d71e87849 | ||
|
|
240e5d3e69 | ||
|
|
fa957c6ba5 | ||
|
|
e6a0ac250a | ||
|
|
328c19a53b | ||
|
|
2f72f5e7b8 | ||
|
|
10c9722598 | ||
|
|
6e0f853773 | ||
|
|
40d92b47bc | ||
|
|
c6429f2e2f | ||
|
|
9be36aee38 | ||
|
|
2c19a2d8c7 | ||
|
|
78ce7607bd | ||
|
|
36c10da591 | ||
|
|
186a361170 | ||
|
|
c89834af75 | ||
|
|
a54a55baa5 | ||
|
|
6bfb153179 | ||
|
|
b9359d190c | ||
|
|
43edd6267f | ||
|
|
da0b8ef955 | ||
|
|
b8d7eb80dd | ||
|
|
9122349d92 | ||
|
|
67a768d7c2 | ||
|
|
5f148159a2 | ||
|
|
90a5283549 | ||
|
|
692a47f118 | ||
|
|
06e30e9276 | ||
|
|
c4c78a96a7 | ||
|
|
84489d22ef | ||
|
|
eda0ae4c0e | ||
|
|
6fe655f830 | ||
|
|
4d5b830a13 | ||
|
|
164a0efbfe | ||
|
|
de4232e11e | ||
|
|
60197e3959 | ||
|
|
ff9bc202a7 | ||
|
|
e7b88863d1 | ||
|
|
e47b792177 | ||
|
|
1c1ba347cf | ||
|
|
313c0c36c5 | ||
|
|
4bbb27b79b | ||
|
|
8d26f6969c | ||
|
|
5ce89ae72e | ||
|
|
9820dd0352 | ||
|
|
8d3001adcf | ||
|
|
967985c80e | ||
|
|
a8d1dc1606 | ||
|
|
409088c721 | ||
|
|
0d621717df | ||
|
|
6ad176f789 | ||
|
|
dfa8578f8f | ||
|
|
827e5e16ad | ||
|
|
07ba3dabbc | ||
|
|
1223e98552 | ||
|
|
bc25e0644e | ||
|
|
acf15f0d99 | ||
|
|
91507db519 | ||
|
|
e540c2cd02 | ||
|
|
61a724a226 | ||
|
|
3cfae8eaf9 | ||
|
|
cb719f01ae | ||
|
|
6895e66cc0 | ||
|
|
1f17ff6ec3 | ||
|
|
4b8901e99d | ||
|
|
c1fdacd46d | ||
|
|
1c272f9066 | ||
|
|
ec4ad872a1 | ||
|
|
9e08cc4a0b | ||
|
|
8061d72b1d | ||
|
|
588e0bcea1 | ||
|
|
ee118e3ee8 | ||
|
|
6d81eddca1 | ||
|
|
9b2591317f | ||
|
|
4f08e4f300 | ||
|
|
29d16437af | ||
|
|
8fdf2c42a8 | ||
|
|
1b33f84593 | ||
|
|
52c0ac730c | ||
|
|
e54918b832 | ||
|
|
d02ded46b2 | ||
|
|
44bfa8449b | ||
|
|
dddc0ffe22 | ||
|
|
fb6c090295 | ||
|
|
9275f74558 | ||
|
|
e59f5fcc13 | ||
|
|
4b36a903f1 | ||
|
|
bfec1f497d | ||
|
|
6c021cd07a | ||
|
|
7489e6c79f | ||
|
|
ef74e3240b | ||
|
|
7eee000df0 | ||
|
|
8e075a7b13 | ||
|
|
016cadfe24 | ||
|
|
c32ae83467 | ||
|
|
8e2b702ed1 | ||
|
|
2b72a53fe8 | ||
|
|
93e57c6ba7 | ||
|
|
fb0399d8d6 | ||
|
|
9d44db47d0 | ||
|
|
2552062b9d | ||
|
|
1954198f71 | ||
|
|
758fee0a57 | ||
|
|
2193105643 | ||
|
|
6a44bb7773 | ||
|
|
d9a67f8682 | ||
|
|
c54929d0ee | ||
|
|
f6d9e7f624 | ||
|
|
9496307009 | ||
|
|
667bc275df | ||
|
|
60cc08daf8 | ||
|
|
78511f9b3e | ||
|
|
6ea63342af | ||
|
|
8d2bb6162e | ||
|
|
49c5e8688b | ||
|
|
7bc151fc48 | ||
|
|
d462b0822d | ||
|
|
29a1b3947d | ||
|
|
a60cf66747 | ||
|
|
6f5ca7248b | ||
|
|
0ca8a931d4 | ||
|
|
0588c5df1d | ||
|
|
0471d4fa1b | ||
|
|
8a316f7db8 | ||
|
|
c55c8ca7db | ||
|
|
10b0e40be3 | ||
|
|
8e53bf8cf9 | ||
|
|
4814cb00a0 | ||
|
|
f373b5e969 | ||
|
|
7907bedf15 | ||
|
|
c798fff761 | ||
|
|
1276b76a91 | ||
|
|
f126d3f868 | ||
|
|
c2cb2ae091 | ||
|
|
88bff41e9a | ||
|
|
7738951911 | ||
|
|
869c9987ab | ||
|
|
83597f2d9b | ||
|
|
901cc399d4 | ||
|
|
c35a9d0afc | ||
|
|
9733a8d465 | ||
|
|
a7c9578ee5 | ||
|
|
9bc30cc2bf | ||
|
|
6bce81e2f8 | ||
|
|
54d109226a | ||
|
|
b1f82ae79d | ||
|
|
96fbc9334c | ||
|
|
4f7f675a8a | ||
|
|
fd385774f6 | ||
|
|
fbbd751bed | ||
|
|
f45a3b7a74 | ||
|
|
895d06d714 | ||
|
|
e051c81221 |
172 changed files with 9851 additions and 5394 deletions
5
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
5
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
blank_issues_enabled: false
|
||||
contact_links:
|
||||
- name: BBN Holding Discord Support
|
||||
url: https://discord.gg/nPwjaJk
|
||||
about: Please ask questions here.
|
||||
28
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
28
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
---
|
||||
name: "💡 Feature request"
|
||||
about: Submit your idea for a change in the codebase.
|
||||
---
|
||||
|
||||
# Feature request
|
||||
|
||||
<!--
|
||||
This issue should serve for you to present or pitch an idea to the maintainers - but remember that it would be better if you were to submit a PR instead 🤗
|
||||
-->
|
||||
|
||||
## Why it is needed
|
||||
|
||||
<!--
|
||||
Please tell us a bit more of why you want this feature to be added, what's its origin.
|
||||
-->
|
||||
|
||||
## Possible implementation
|
||||
|
||||
<!--
|
||||
It really helps if you could describe from a technical POV how this new feature would work, which code it rely on, etc.
|
||||
-->
|
||||
|
||||
### Code sample
|
||||
|
||||
<!--
|
||||
Please show how the new code could work, if doable.
|
||||
-->
|
||||
13
.github/dependabot.yml
vendored
Normal file
13
.github/dependabot.yml
vendored
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: maven
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: monthly
|
||||
time: "13:00"
|
||||
open-pull-requests-limit: 99
|
||||
target-branch: greg-dev
|
||||
assignees:
|
||||
- GregTCLTK
|
||||
labels:
|
||||
- pending-deploy
|
||||
37
.github/workflows/maven.yml
vendored
37
.github/workflows/maven.yml
vendored
|
|
@ -3,35 +3,36 @@ name: Hadder
|
|||
on: [push]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Set up JDK 1.13
|
||||
uses: actions/setup-java@v1
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2.3.4
|
||||
- name: Set up JDK 15
|
||||
uses: actions/setup-java@v1.4.3
|
||||
with:
|
||||
java-version: 1.13
|
||||
java-version: '15'
|
||||
- name: Build with Maven
|
||||
run: mvn -B package --file pom.xml
|
||||
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
needs: build
|
||||
if: github.ref == 'refs/heads/master'
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Set up JDK 1.13
|
||||
uses: actions/setup-java@v1
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
needs: build
|
||||
if: github.ref == 'refs/heads/master'
|
||||
steps:
|
||||
- uses: actions/checkout@v2.3.4
|
||||
- name: Set up JDK 15
|
||||
uses: actions/setup-java@v1.4.3
|
||||
with:
|
||||
java-version: 1.13
|
||||
java-version: '15'
|
||||
- name: Build Final Jar
|
||||
run: mvn clean compile assembly:single
|
||||
- name: Copy folder content recursively to remote
|
||||
uses: garygrossgarten/github-action-scp@release
|
||||
with:
|
||||
local: ./target/Hadder-Build.jar
|
||||
remote: /home/Bots/Hadder-Build.jar
|
||||
remote: /root/bots/Hadder/Hadder-Build.jar
|
||||
host: ${{ secrets.HOST }}
|
||||
port: ${{ secrets.PORT }}
|
||||
username: ${{ secrets.USERNAME }}
|
||||
password: ${{ secrets.PASSWORD }}
|
||||
- name: executing remote ssh commands using password
|
||||
|
|
@ -41,7 +42,7 @@ jobs:
|
|||
username: ${{ secrets.USERNAME }}
|
||||
password: ${{ secrets.PASSWORD }}
|
||||
port: ${{ secrets.PORT }}
|
||||
script: /home/Bots/deploy.sh
|
||||
script: /root/bots/Hadder/deploy.sh
|
||||
- name: Send Webhook Notification
|
||||
if: always()
|
||||
env:
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ If a community member engages in unacceptable behavior, the community organizers
|
|||
|
||||
## 7. Reporting Guidelines
|
||||
|
||||
If you are subject to or witness unacceptable behavior, or have any other concerns, please notify a community organizer as soon as possible. admin@bigbotnetwork.com.
|
||||
If you are subject to or witness unacceptable behavior, or have any other concerns, please notify a community organizer as soon as possible. admin@bbn.one.
|
||||
|
||||
|
||||
|
||||
|
|
@ -65,7 +65,7 @@ Additionally, community organizers are available to help community members engag
|
|||
|
||||
## 8. Addressing Grievances
|
||||
|
||||
If you feel you have been falsely or unfairly accused of violating this Code of Conduct, you should notify BigBotNetwork with a concise description of your grievance. Your grievance will be handled in accordance with our existing governing policies.
|
||||
If you feel you have been falsely or unfairly accused of violating this Code of Conduct, you should notify BBN with a concise description of your grievance. Your grievance will be handled in accordance with our existing governing policies.
|
||||
|
||||
|
||||
|
||||
|
|
@ -77,7 +77,7 @@ This code of conduct and its related procedures also applies to unacceptable beh
|
|||
|
||||
## 10. Contact info
|
||||
|
||||
admin@bigbotnetwork.com
|
||||
admin@bbn.one
|
||||
|
||||
## 11. License and attribution
|
||||
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ further defined and clarified by project maintainers.
|
|||
### Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||
reported by contacting the project team on [Discord](https://discordapp.com/invite/Vf4zCYn). All
|
||||
reported by contacting the project team on [Discord](https://discordapp.com/invite/nPwjaJk). All
|
||||
complaints will be reviewed and investigated and will result in a response that
|
||||
is deemed necessary and appropriate to the circumstances. The project team is
|
||||
obligated to maintain confidentiality with regard to the reporter of an incident.
|
||||
|
|
|
|||
2
Dockerfile
Normal file
2
Dockerfile
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
FROM debian:buster
|
||||
WORKDIR /home/Hadder
|
||||
674
LICENSE
674
LICENSE
|
|
@ -1,21 +1,661 @@
|
|||
MIT License
|
||||
GNU AFFERO GENERAL PUBLIC LICENSE
|
||||
Version 3, 19 November 2007
|
||||
|
||||
Copyright (c) 2019 Big Bot Network
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
Preamble
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
The GNU Affero General Public License is a free, copyleft license for
|
||||
software and other kinds of works, specifically designed to ensure
|
||||
cooperation with the community in the case of network server software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
our General Public Licenses are intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
Developers that use our General Public Licenses protect your rights
|
||||
with two steps: (1) assert copyright on the software, and (2) offer
|
||||
you this License which gives you legal permission to copy, distribute
|
||||
and/or modify the software.
|
||||
|
||||
A secondary benefit of defending all users' freedom is that
|
||||
improvements made in alternate versions of the program, if they
|
||||
receive widespread use, become available for other developers to
|
||||
incorporate. Many developers of free software are heartened and
|
||||
encouraged by the resulting cooperation. However, in the case of
|
||||
software used on network servers, this result may fail to come about.
|
||||
The GNU General Public License permits making a modified version and
|
||||
letting the public access it on a server without ever releasing its
|
||||
source code to the public.
|
||||
|
||||
The GNU Affero General Public License is designed specifically to
|
||||
ensure that, in such cases, the modified source code becomes available
|
||||
to the community. It requires the operator of a network server to
|
||||
provide the source code of the modified version running there to the
|
||||
users of that server. Therefore, public use of a modified version, on
|
||||
a publicly accessible server, gives the public access to the source
|
||||
code of the modified version.
|
||||
|
||||
An older license, called the Affero General Public License and
|
||||
published by Affero, was designed to accomplish similar goals. This is
|
||||
a different license, not a version of the Affero GPL, but Affero has
|
||||
released a new version of the Affero GPL which permits relicensing under
|
||||
this license.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU Affero General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Remote Network Interaction; Use with the GNU General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, if you modify the
|
||||
Program, your modified version must prominently offer all users
|
||||
interacting with it remotely through a computer network (if your version
|
||||
supports such interaction) an opportunity to receive the Corresponding
|
||||
Source of your version by providing access to the Corresponding Source
|
||||
from a network server at no charge, through some standard or customary
|
||||
means of facilitating copying of software. This Corresponding Source
|
||||
shall include the Corresponding Source for any work covered by version 3
|
||||
of the GNU General Public License that is incorporated pursuant to the
|
||||
following paragraph.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the work with which it is combined will remain governed by version
|
||||
3 of the GNU General Public License.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU Affero General Public License from time to time. Such new versions
|
||||
will be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU Affero General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU Affero General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU Affero General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published
|
||||
by the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If your software can interact with users remotely through a computer
|
||||
network, you should also make sure that it provides a way for users to
|
||||
get its source. For example, if your program is a web application, its
|
||||
interface could display a "Source" link that leads users to an archive
|
||||
of the code. There are many ways you could offer source, and different
|
||||
solutions will be better for different programs; see section 13 for the
|
||||
specific requirements.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU AGPL, see
|
||||
<https://www.gnu.org/licenses/>.
|
||||
|
|
|
|||
60
README.md
60
README.md
|
|
@ -2,22 +2,60 @@
|
|||
|
||||
Hadder Discord is a multi-purpose Discord bot with 100% uptime.
|
||||
|
||||
<a href="https://discord.gg/58My2dM"><img src="https://discordapp.com/api/guilds/448554629282922527/embed.png"/></a>
|
||||
[](https://github.com/BigBotNetwork/Hadder)
|
||||
[](https://www.codacy.com/gh/BigBotNetwork/Hadder?utm_source=github.com&utm_medium=referral&utm_content=BigBotNetwork/Hadder&utm_campaign=Badge_Grade)
|
||||
<a href="https://discord.gg/nPwjaJk"><img src="https://discord.com/api/guilds/757966278936756345/embed.png"/></a>
|
||||
[](https://github.com/BBN-Holding/Hadder)
|
||||
[](https://www.codacy.com/gh/BBN-Holding/Hadder?utm_source=github.com&utm_medium=referral&utm_content=BBN-Holding/Hadder&utm_campaign=Badge_Grade)
|
||||
[](https://www.codefactor.io/repository/github/bigbotnetwork/hadder)
|
||||
[](https://bbn.crowdin.com/hadder)
|
||||
[](https://github.com/BigBotNetwork/Hadder/issues)
|
||||
[](https://github.com/BigBotNetwork/Hadder/blob/master/LICENSE)
|
||||
|
||||
<a href="https://discordextremelist.xyz/bots/Hadder"><img src="https://discordextremelist.xyz/api/bot/637002314162372639/widget"/></a>
|
||||
[](https://top.gg/bot/637002314162372639)
|
||||
[](https://botlist.space/bot/637002314162372639?utm_source=bls&utm_medium=widget&utm_campaign=637002314162372639)
|
||||
[](https://github.com/BBN-Holding/Hadder/issues)
|
||||
[](https://github.com/BBN-Holding/Hadder/blob/master/LICENSE)
|
||||
[](https://wakatime.com/badge/github/BBN-Holding/Hadder)
|
||||
|
||||
## Hadder Team
|
||||
### Developer
|
||||
Skidder#6775 <br>
|
||||
Hax#6775
|
||||
|
||||
### Designer
|
||||
TopComp#1288
|
||||
## A few commands
|
||||
| **Command** | **Description** |
|
||||
|----------------|---------------------------------------------------------------|
|
||||
| h.about | Shows information about Hadder |
|
||||
| h.avatar | Sends the avatar of the specified Member |
|
||||
| h.ban | Bans one or more users from the server |
|
||||
| h.bass | Change the bass for the song which is played at the moment |
|
||||
| h.clear | Deletes the specified number of messages |
|
||||
| h.clyde | Sends a message as a webhook named Clyde |
|
||||
| h.code | Shows information about a invite code |
|
||||
| h.corona | Shows the newest stats of COVID-19 |
|
||||
| h.echo | Sends your voice through Hadder |
|
||||
| h.editrules | Edits the rules message |
|
||||
| h.equals | Checks if two strings are equal |
|
||||
| h.feedback | Sends feedback directly to the developers |
|
||||
| h.gif | Looks for a GIF on Giphy |
|
||||
| h.github | Displays information about a GitHub user profile |
|
||||
| h.help | Shows each command and explains its usage |
|
||||
| h.info | Shows information about the playing song |
|
||||
| h.invite | Shows the invitation link to invite Hadder to your server |
|
||||
| h.invitedetect | Activate or deactivate the Discord invite link detection |
|
||||
| h.join | Joins your voice channel |
|
||||
| h.kick | Kicks one or more user from the server |
|
||||
| h.language | Sets the new primary language for a user |
|
||||
| h.loop | Repeats a song/queue |
|
||||
| h.meme | Sends you a random meme |
|
||||
| h.moveall | Moves all users in the source channel to the target channel |
|
||||
| h.nick | Rename a one or more user |
|
||||
| h.pause | Pause the playing song |
|
||||
| h.ping | Shows the ping to the Discord API |
|
||||
| h.play | Plays the specified song |
|
||||
| h.prefix | Sets the Guild-Prefix |
|
||||
| h.profile | Shows some information about the specified user |
|
||||
| h.queue | Shows the music queue |
|
||||
| h.regionchange | Changes the server region to locked regions |
|
||||
| h.role | Adds and removes one or more role(s) from one or more user(s) |
|
||||
| h.rules | Setup the rules on your Discord server |
|
||||
| h.screenshare | Shows you the link to share your screen |
|
||||
| h.serverstats | Shows information about a server |
|
||||
| h.skip | Skips the currently playing song |
|
||||
| h.starboard | Sets the starboard channel |
|
||||
| h.stop | Stops the song |
|
||||
| h.volume | Change the volume of the music |
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
base_url: 'https://bigbotnetwork.com'
|
||||
base_url: 'https://bbn.one'
|
||||
commit_message: 'New %language% translation'
|
||||
files:
|
||||
- source: /src/main/resources/Translations/Translations_en.properties
|
||||
|
|
|
|||
|
|
@ -1,25 +1,17 @@
|
|||
{
|
||||
"Owners":
|
||||
[],
|
||||
"Database":{"IP":"",
|
||||
"Owners": [
|
||||
],
|
||||
"Database": {
|
||||
"IP": "",
|
||||
"Port": 6775,
|
||||
"DBName": "",
|
||||
"Username": "",
|
||||
"Password": ""},
|
||||
"Password": ""
|
||||
},
|
||||
"Tokens": {
|
||||
"BotToken": "",
|
||||
"Giphy": "",
|
||||
"GitHub": "",
|
||||
"MythicalBotList": "",
|
||||
"BotsForDiscord": "",
|
||||
"DiscordBotList": "",
|
||||
"DiscordBestBots": "",
|
||||
"DiscordBoats": "",
|
||||
"YetAnotherBotList": "",
|
||||
"DiscordExtremeList": "",
|
||||
"DiscordBotReviews": "",
|
||||
"DiscordBots": "",
|
||||
"BotListSpace": ""
|
||||
"GitHub": ""
|
||||
},
|
||||
"Clyde": ""
|
||||
}
|
||||
|
|
|
|||
268
pom.xml
268
pom.xml
|
|
@ -1,150 +1,138 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
|
||||
<groupId>Hadder</groupId>
|
||||
<artifactId>Hadder</artifactId>
|
||||
<version>0.1-BETA</version>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>Hadder</groupId>
|
||||
<artifactId>Hadder</artifactId>
|
||||
<version>2.0.4</version>
|
||||
<name>Hadder</name>
|
||||
<inceptionYear>2019</inceptionYear>
|
||||
<description>Hadder is a multi-purpose Discord bot.</description>
|
||||
<url>https://github.com/BBN-Holding/Hadder</url>
|
||||
|
||||
<name>Hadder</name>
|
||||
<licenses>
|
||||
<license>
|
||||
<name>GNU Affero General Public License v3.0</name>
|
||||
<url>https://www.gnu.org/licenses/agpl-3.0.en.html</url>
|
||||
<distribution>repo</distribution>
|
||||
</license>
|
||||
</licenses>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<maven.compiler.source>1.13</maven.compiler.source>
|
||||
<maven.compiler.target>1.13</maven.compiler.target>
|
||||
</properties>
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<maven.compiler.source>1.15</maven.compiler.source>
|
||||
<maven.compiler.target>1.15</maven.compiler.target>
|
||||
<maven.build.timestamp.format>yyyy-MM-dd'T'HH:mm:ss'Z'</maven.build.timestamp.format>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>net.dv8tion</groupId>
|
||||
<artifactId>JDA</artifactId>
|
||||
<version>4.0.0_79</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.json</groupId>
|
||||
<artifactId>json</artifactId>
|
||||
<version>20190722</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.rethinkdb</groupId>
|
||||
<artifactId>rethinkdb-driver</artifactId>
|
||||
<version>2.3.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.code.gson</groupId>
|
||||
<artifactId>gson</artifactId>
|
||||
<version>2.8.6</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-api</artifactId>
|
||||
<version>1.7.30</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-simple</artifactId>
|
||||
<version>1.7.30</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>club.minnced</groupId>
|
||||
<artifactId>discord-webhooks</artifactId>
|
||||
<version>0.1.8</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.kohsuke</groupId>
|
||||
<artifactId>github-api</artifactId>
|
||||
<version>1.101</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.sedmelluq</groupId>
|
||||
<artifactId>lavaplayer</artifactId>
|
||||
<version>1.3.32</version>
|
||||
</dependency>
|
||||
<developers>
|
||||
<developer>
|
||||
<id>Hax#6775</id>
|
||||
<name>Hax</name>
|
||||
<email>hax@bbn.one</email>
|
||||
<url>https://bbn.one/</url>
|
||||
<timezone>Europe/Berlin</timezone>
|
||||
<properties>
|
||||
<picUrl>https://cdn.discordapp.com/avatars/261083609148948488/f2c9efc629ef65fffa634f0d63cd467e.webp
|
||||
</picUrl>
|
||||
</properties>
|
||||
</developer>
|
||||
<developer>
|
||||
<id>Skidder#6775</id>
|
||||
<name>Greg</name>
|
||||
<email>skidder@bbn.one</email>
|
||||
<url>https://bbn.one/</url>
|
||||
<timezone>Europe/Berlin</timezone>
|
||||
<properties>
|
||||
<picUrl>https://cdn.discordapp.com/avatars/401817301919465482/a_f81bd03e3862de579dec59241714d86d.gif
|
||||
</picUrl>
|
||||
</properties>
|
||||
</developer>
|
||||
</developers>
|
||||
|
||||
</dependencies>
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>jcenter</id>
|
||||
<name>jcenter-bintray</name>
|
||||
<url>https://jcenter.bintray.com</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>dv8tion</id>
|
||||
<name>m2-dv8tion</name>
|
||||
<url>https://m2.dv8tion.net/releases</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>jcenter</id>
|
||||
<name>jcenter-bintray</name>
|
||||
<url>https://jcenter.bintray.com</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-model</artifactId>
|
||||
<version>3.8.6</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.dv8tion</groupId>
|
||||
<artifactId>JDA</artifactId>
|
||||
<version>4.4.0_352</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.json</groupId>
|
||||
<artifactId>json</artifactId>
|
||||
<version>20220924</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-simple</artifactId>
|
||||
<version>2.0.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>club.minnced</groupId>
|
||||
<artifactId>discord-webhooks</artifactId>
|
||||
<version>0.8.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.kohsuke</groupId>
|
||||
<artifactId>github-api</artifactId>
|
||||
<version>1.313</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.sedmelluq</groupId>
|
||||
<artifactId>lavaplayer</artifactId>
|
||||
<version>1.3.78</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mongodb</groupId>
|
||||
<artifactId>mongodb-driver-sync</artifactId>
|
||||
<version>4.7.1</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<pluginManagement>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-clean-plugin</artifactId>
|
||||
<version>3.1.0</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<version>3.1.0</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.8.1</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>2.22.2</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<version>3.2.0</version>
|
||||
<configuration>
|
||||
<finalName>Hadder-Build</finalName>
|
||||
<archive>
|
||||
<manifest>
|
||||
<mainClass>com.bbn.hadder.Hadder</mainClass>
|
||||
</manifest>
|
||||
</archive>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-install-plugin</artifactId>
|
||||
<version>2.5.2</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-deploy-plugin</artifactId>
|
||||
<version>2.8.2</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-site-plugin</artifactId>
|
||||
<version>3.8.2</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-project-info-reports-plugin</artifactId>
|
||||
<version>3.0.0</version>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<configuration>
|
||||
<source>13</source>
|
||||
<target>13</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<configuration>
|
||||
<finalName>Hadder-Build</finalName>
|
||||
<archive>
|
||||
<manifest>
|
||||
<mainClass>com.bbn.hadder.Hadder</mainClass>
|
||||
</manifest>
|
||||
</archive>
|
||||
<descriptorRefs>
|
||||
<descriptorRef>jar-with-dependencies</descriptorRef>
|
||||
</descriptorRefs>
|
||||
<appendAssemblyId>false</appendAssemblyId>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<configuration>
|
||||
<source>15</source>
|
||||
<target>15</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<configuration>
|
||||
<finalName>Hadder-Build</finalName>
|
||||
<archive>
|
||||
<manifest>
|
||||
<mainClass>one.bbn.hadder.Hadder</mainClass>
|
||||
</manifest>
|
||||
</archive>
|
||||
<descriptorRefs>
|
||||
<descriptorRef>jar-with-dependencies</descriptorRef>
|
||||
</descriptorRefs>
|
||||
<appendAssemblyId>false</appendAssemblyId>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
|
|
|||
|
|
@ -1,109 +0,0 @@
|
|||
package com.bbn.hadder;
|
||||
|
||||
import com.bbn.hadder.commands.general.*;
|
||||
import com.bbn.hadder.commands.misc.*;
|
||||
import com.bbn.hadder.commands.moderation.*;
|
||||
import com.bbn.hadder.commands.nsfw.*;
|
||||
import com.bbn.hadder.commands.owner.*;
|
||||
import com.bbn.hadder.commands.fun.*;
|
||||
import com.bbn.hadder.commands.settings.*;
|
||||
import com.bbn.hadder.commands.music.*;
|
||||
import com.bbn.hadder.core.*;
|
||||
import com.bbn.hadder.listener.*;
|
||||
import net.dv8tion.jda.api.entities.Activity;
|
||||
import net.dv8tion.jda.api.sharding.DefaultShardManagerBuilder;
|
||||
import net.dv8tion.jda.api.sharding.ShardManager;
|
||||
|
||||
import javax.security.auth.login.LoginException;
|
||||
import java.util.List;
|
||||
|
||||
public class Hadder {
|
||||
|
||||
public static ShardManager shardManager;
|
||||
|
||||
public static void main(String[] args) {
|
||||
startBot();
|
||||
}
|
||||
|
||||
private static void startBot() {
|
||||
Config config = new Config("./config.json");
|
||||
if (!config.fileExists()) config.create();
|
||||
config.load();
|
||||
|
||||
Rethink rethink = new Rethink(config);
|
||||
rethink.connect();
|
||||
|
||||
DefaultShardManagerBuilder builder = new DefaultShardManagerBuilder();
|
||||
|
||||
builder.setAutoReconnect(true);
|
||||
builder.setShardsTotal(1);
|
||||
builder.setActivity(Activity.streaming("on the BigBotNetwork", "https://twitch.tv/BigBotNetwork"));
|
||||
builder.setToken(config.getBotToken());
|
||||
|
||||
HelpCommand helpCommand = new HelpCommand();
|
||||
|
||||
CommandHandler commandHandler = new CommandHandler(
|
||||
List.of(
|
||||
helpCommand,
|
||||
new TestCommand(),
|
||||
new BanCommand(),
|
||||
new UserPrefixCommand(),
|
||||
new ShutdownCommand(),
|
||||
new KickCommand(),
|
||||
new PingCommand(),
|
||||
new GifCommand(),
|
||||
new ClearCommand(),
|
||||
new GitHubCommand(),
|
||||
new RebootCommand(),
|
||||
new EqualsCommand(),
|
||||
new InviteCommand(),
|
||||
new NickCommand(),
|
||||
new PrefixCommand(),
|
||||
new BlowjobCommand(),
|
||||
new PornCommand(),
|
||||
new AnalCommand(),
|
||||
new CumCommand(),
|
||||
new TransCommand(),
|
||||
new PussyCommand(),
|
||||
new BoobsCommand(),
|
||||
new FeetCommand(),
|
||||
new EroticCommand(),
|
||||
new RoleCommand(),
|
||||
new RulesCommand(),
|
||||
new FeedbackCommand(),
|
||||
new AvatarCommand(),
|
||||
new EvalCommand(),
|
||||
new JoinCommand(),
|
||||
new LeaveCommand(),
|
||||
new GuildLeaveCommand(),
|
||||
new MemeCommand(),
|
||||
new InviteDetectCommand(),
|
||||
new BDSMCommand(),
|
||||
new FingeringCommand(),
|
||||
new LickingCommand(),
|
||||
new SpankCommand(),
|
||||
new RandomPornCommand(),
|
||||
new SoloCommand(),
|
||||
new RegionChangeCommand(),
|
||||
new AboutCommand(),
|
||||
new LanguageCommand(),
|
||||
new ClydeCommand(),
|
||||
new StarBoardCommand()), config, helpCommand);
|
||||
|
||||
builder.addEventListeners(
|
||||
new MentionListener(rethink),
|
||||
new PrivateMessageListener(rethink),
|
||||
new CommandListener(rethink, commandHandler),
|
||||
new GuildListener(rethink, config),
|
||||
new ReadyListener(rethink, config),
|
||||
new InviteLinkListener(rethink),
|
||||
new RulesListener(rethink),
|
||||
new StarboardListener(rethink));
|
||||
|
||||
try {
|
||||
shardManager = builder.build();
|
||||
} catch (LoginException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,221 +0,0 @@
|
|||
package com.bbn.hadder;
|
||||
|
||||
import com.bbn.hadder.core.Config;
|
||||
import com.rethinkdb.RethinkDB;
|
||||
import com.rethinkdb.gen.exc.ReqlOpFailedError;
|
||||
import com.rethinkdb.net.Connection;
|
||||
import com.rethinkdb.net.Cursor;
|
||||
import org.json.JSONArray;
|
||||
|
||||
import java.util.NoSuchElementException;
|
||||
|
||||
/*
|
||||
* @author Skidder / GregTCLTK
|
||||
*/
|
||||
|
||||
public class Rethink {
|
||||
private RethinkDB r = RethinkDB.r;
|
||||
private Connection conn;
|
||||
private Config config;
|
||||
|
||||
Rethink(Config config) {
|
||||
this.config = config;
|
||||
}
|
||||
|
||||
public void connect() {
|
||||
try {
|
||||
conn = r.connection()
|
||||
.hostname(config.getDatabaseIP())
|
||||
.db(config.getDatabaseName())
|
||||
.port(config.getDatabasePort())
|
||||
.user(config.getDatabaseUsername(), config.getDatabasePassword())
|
||||
.connect();
|
||||
System.out.println("DB CONNECTED");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
System.out.println("DB CONNECTION FAILED");
|
||||
}
|
||||
}
|
||||
|
||||
public void disconnect() {
|
||||
conn.close();
|
||||
System.out.println("DISCONNECTED");
|
||||
}
|
||||
|
||||
private JSONArray getAsArray(String table, String where, String value) {
|
||||
try {
|
||||
String string = r.table(table).filter(row -> row.g(where.toLowerCase()).eq(value)).coerceTo("array").toJson().run(conn);
|
||||
return new JSONArray(string);
|
||||
} catch (NoSuchElementException e) {
|
||||
return null;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return new JSONArray();
|
||||
}
|
||||
|
||||
public Object get(String table, String where, String value, String column) {
|
||||
JSONArray array = this.getAsArray(table, where, value);
|
||||
if (array.length()>0)
|
||||
if (array.getJSONObject(0).has(column))
|
||||
return array.getJSONObject(0).get(column);
|
||||
else return null;
|
||||
else return null;
|
||||
}
|
||||
|
||||
public String update(String table, String wherevalue, String what, String whatvalue) {
|
||||
String out = "";
|
||||
try {
|
||||
Cursor cursor = r.table(table).get(wherevalue).update(r.hashMap(what, whatvalue)).run(conn);
|
||||
out=cursor.toString();
|
||||
} catch (ClassCastException ignored) {}
|
||||
return out;
|
||||
}
|
||||
|
||||
public String insert(String table, Object object) {
|
||||
String out = "";
|
||||
try {
|
||||
Cursor cursor = r.table(table).insert(object).run(conn);
|
||||
out = cursor.next().toString();
|
||||
} catch (ClassCastException ignored) {}
|
||||
return out;
|
||||
}
|
||||
|
||||
public void remove(String table, String where, String wherevalue) {
|
||||
r.table(table).filter(row -> row.g(where.toLowerCase()).eq(wherevalue)).delete().run(conn);
|
||||
}
|
||||
|
||||
public void setup() {
|
||||
try {
|
||||
r.dbCreate("Hadder").run(conn);
|
||||
} catch (ReqlOpFailedError e) {
|
||||
System.out.println(e.getMessage());
|
||||
}
|
||||
try {
|
||||
r.tableCreate("server").run(conn);
|
||||
} catch (ReqlOpFailedError e) {
|
||||
System.out.println(e.getMessage());
|
||||
}
|
||||
try {
|
||||
r.tableCreate("user").run(conn);
|
||||
} catch (ReqlOpFailedError e) {
|
||||
System.out.println(e.getMessage());
|
||||
}
|
||||
try {
|
||||
r.tableCreate("stars").run(conn);
|
||||
} catch (ReqlOpFailedError e) {
|
||||
System.out.println(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public void setUserPrefix(String prefix, String userid) {
|
||||
this.update("user", userid, "prefix", prefix);
|
||||
}
|
||||
|
||||
public String getUserPrefix(String id) {
|
||||
return (String) this.get("user", "id", id, "prefix");
|
||||
}
|
||||
|
||||
public void setGuildPrefix(String prefix, String guildid) {
|
||||
this.update("server", guildid, "prefix", prefix);
|
||||
}
|
||||
|
||||
public String getGuildPrefix(String id) {
|
||||
return (String) this.get("server", "id", id, "prefix");
|
||||
}
|
||||
|
||||
public void insertGuild(String id) {
|
||||
this.insert("server", r.hashMap("id", id)
|
||||
.with("prefix", "h.")
|
||||
.with("message_id", "")
|
||||
.with("role_id", "")
|
||||
.with("invite_detect", false)
|
||||
.with("starboard", "")
|
||||
.with("neededstars", "4")
|
||||
);
|
||||
}
|
||||
|
||||
public void insertUser(String id) {
|
||||
this.insert("user", r.hashMap("id", id).with("prefix", "h.").with("language", "en"));
|
||||
}
|
||||
|
||||
public void setNeededstars(String stars, String guildid) {
|
||||
this.update("server", guildid, "neededstars", stars);
|
||||
}
|
||||
|
||||
public String getNeededstars(String guildid) {
|
||||
return (String) this.get("server", "id", guildid, "neededstars");
|
||||
}
|
||||
|
||||
public void setStarboardChannel(String guildid, String channelid) {
|
||||
this.update("server", guildid, "starboard", channelid);
|
||||
}
|
||||
|
||||
public String getStarboardChannel(String guildid) {
|
||||
return (String) this.get("server", "id", guildid, "starboard");
|
||||
}
|
||||
|
||||
public boolean hasStarboardChannel(String guildid) {
|
||||
return !this.get("server", "id", guildid, "starboard").equals("");
|
||||
}
|
||||
|
||||
public void insertStarboardMessage(String messageid, String guildid, String starboardmessageid) {
|
||||
this.insert("stars", r.hashMap("id", messageid).with("guild", guildid).with("starboardmsg", starboardmessageid));
|
||||
}
|
||||
|
||||
public String getStarboardMessage(String messageid) {
|
||||
return (String) this.get("stars", "id", messageid, "starboardmsg");
|
||||
}
|
||||
|
||||
public void removeStarboardMessage(String messageid) {
|
||||
this.remove("stars", "id", messageid);
|
||||
}
|
||||
|
||||
public boolean hasStarboardMessage(String messageid) {
|
||||
return this.get("stars", "id", messageid, "guild") != null;
|
||||
}
|
||||
|
||||
public void updateRules(String guild_id, String message_id, String role_id, String accept_emote, String decline_emote) {
|
||||
this.update("server", guild_id, "message_id", message_id);
|
||||
this.update("server", guild_id, "role_id", role_id);
|
||||
this.update("server", guild_id, "accept_emote", accept_emote);
|
||||
this.update("server", guild_id, "decline_emote", decline_emote);
|
||||
}
|
||||
|
||||
public String getRulesMID(String guild_id) {
|
||||
return (String) this.get("server", "id", guild_id, "message_id");
|
||||
}
|
||||
|
||||
public String getRulesRID(String guild_id) {
|
||||
return (String) this.get("server", "id", guild_id, "role_id");
|
||||
}
|
||||
|
||||
public String getRulesAEmote(String guild_id) {
|
||||
return this.get("server", "id", guild_id, "accept_emote").toString().replaceAll("\"", "");
|
||||
}
|
||||
|
||||
public String getRulesDEmote(String guild_id) {
|
||||
return this.get("server", "id", guild_id, "decline_emote").toString().replaceAll("\"", "");
|
||||
}
|
||||
|
||||
public void setInviteDetection(String guild_id, boolean b) {
|
||||
try {
|
||||
r.table("server").get(guild_id).update(r.hashMap("invite_detect", b)).run(conn);
|
||||
} catch (ClassCastException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public Boolean getInviteDetection(String guild_id) {
|
||||
return (Boolean) this.get("server", "id", guild_id, "invite_detect");
|
||||
}
|
||||
|
||||
public void setLanguage(String user_id, String language) {
|
||||
this.update("users", user_id, "language", language);
|
||||
}
|
||||
|
||||
public String getLanguage(String user_id) {
|
||||
return (String) this.get("user", "id", user_id, "language");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
package com.bbn.hadder.commands;
|
||||
|
||||
/*
|
||||
* @author Skidder / GregTCLTK
|
||||
*/
|
||||
|
||||
public interface Command {
|
||||
void executed(String[] args, CommandEvent event);
|
||||
String[] labels();
|
||||
String description();
|
||||
String usage();
|
||||
}
|
||||
|
|
@ -1,50 +0,0 @@
|
|||
package com.bbn.hadder.commands;
|
||||
|
||||
import com.bbn.hadder.Rethink;
|
||||
import com.bbn.hadder.commands.general.HelpCommand;
|
||||
import com.bbn.hadder.core.CommandHandler;
|
||||
import com.bbn.hadder.core.Config;
|
||||
import com.bbn.hadder.utils.MessageEditor;
|
||||
import net.dv8tion.jda.api.JDA;
|
||||
import net.dv8tion.jda.api.entities.Message;
|
||||
import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class CommandEvent extends MessageReceivedEvent {
|
||||
|
||||
private Rethink rethink;
|
||||
private Config config;
|
||||
private CommandHandler commandHandler;
|
||||
private HelpCommand helpCommand;
|
||||
private MessageEditor messageEditor;
|
||||
|
||||
public CommandEvent(@Nonnull JDA api, long responseNumber, @Nonnull Message message, Rethink rethink, Config config, CommandHandler commandHandler, HelpCommand helpCommand, MessageEditor messageEditor) {
|
||||
super(api, responseNumber, message);
|
||||
this.rethink = rethink;
|
||||
this.config = config;
|
||||
this.commandHandler = commandHandler;
|
||||
this.helpCommand = helpCommand;
|
||||
this.messageEditor = messageEditor;
|
||||
}
|
||||
|
||||
public Rethink getRethink() {
|
||||
return rethink;
|
||||
}
|
||||
|
||||
public Config getConfig() {
|
||||
return config;
|
||||
}
|
||||
|
||||
public HelpCommand getHelpCommand() {
|
||||
return helpCommand;
|
||||
}
|
||||
|
||||
public CommandHandler getCommandHandler() {
|
||||
return commandHandler;
|
||||
}
|
||||
|
||||
public MessageEditor getMessageEditor() {
|
||||
return messageEditor;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,71 +0,0 @@
|
|||
package com.bbn.hadder.commands.fun;
|
||||
|
||||
/*
|
||||
* @author Skidder / GregTCLTK
|
||||
*/
|
||||
|
||||
import com.bbn.hadder.commands.Command;
|
||||
import com.bbn.hadder.commands.CommandEvent;
|
||||
import com.bbn.hadder.utils.MessageEditor;
|
||||
import net.dv8tion.jda.api.entities.Member;
|
||||
|
||||
public class AvatarCommand implements Command {
|
||||
|
||||
@Override
|
||||
public void executed(String[] args, CommandEvent event) {
|
||||
if (args.length == 0) {
|
||||
Member member = event.getMember();
|
||||
event.getTextChannel().sendMessage(
|
||||
event.getMessageEditor().getMessage(
|
||||
MessageEditor.MessageType.INFO,
|
||||
"commands.fun.avatar.success.title",
|
||||
member.getUser().getAsTag(),
|
||||
"",
|
||||
"")
|
||||
.setImage(member.getUser().getAvatarUrl())
|
||||
.setFooter(member.getUser().getAsTag())
|
||||
.build()).queue();
|
||||
} else if (event.getMessage().getMentionedMembers().size() == 1) {
|
||||
Member member = event.getMessage().getMentionedMembers().get(0);
|
||||
event.getTextChannel().sendMessage(
|
||||
event.getMessageEditor().getMessage(
|
||||
MessageEditor.MessageType.INFO,
|
||||
"commands.fun.avatar.success.title",
|
||||
member.getUser().getAsTag(),
|
||||
"",
|
||||
"")
|
||||
.setImage(member.getUser().getAvatarUrl())
|
||||
.setFooter(member.getUser().getAsTag())
|
||||
.build()).queue();
|
||||
} else if (args[0].length() == 18){
|
||||
Member member = event.getGuild().getMemberById(args[0]);
|
||||
event.getTextChannel().sendMessage(
|
||||
event.getMessageEditor().getMessage(
|
||||
MessageEditor.MessageType.INFO,
|
||||
"commands.fun.avatar.success.title",
|
||||
member.getUser().getAsTag(),
|
||||
"",
|
||||
"")
|
||||
.setImage(member.getUser().getAvatarUrl())
|
||||
.setFooter(member.getUser().getAsTag())
|
||||
.build()).queue();
|
||||
} else {
|
||||
event.getHelpCommand().sendHelp(this, event);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] labels() {
|
||||
return new String[]{"avatar"};
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "commands.fun.avatar.help.description";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String usage() {
|
||||
return "[@User]/[ID]";
|
||||
}
|
||||
}
|
||||
|
|
@ -1,77 +0,0 @@
|
|||
package com.bbn.hadder.commands.fun;
|
||||
|
||||
/*
|
||||
* @author Skidder / GregTCLTK
|
||||
*/
|
||||
|
||||
import club.minnced.discord.webhook.WebhookClient;
|
||||
import club.minnced.discord.webhook.WebhookClientBuilder;
|
||||
import com.bbn.hadder.commands.Command;
|
||||
import com.bbn.hadder.commands.CommandEvent;
|
||||
import com.bbn.hadder.core.Perm;
|
||||
import com.bbn.hadder.core.Perms;
|
||||
import com.bbn.hadder.utils.MessageEditor;
|
||||
import net.dv8tion.jda.api.Permission;
|
||||
import net.dv8tion.jda.api.entities.Icon;
|
||||
import net.dv8tion.jda.api.entities.TextChannel;
|
||||
import net.dv8tion.jda.api.entities.Webhook;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.net.URL;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
@Perms(Perm.MANAGE_WEBHOOKS)
|
||||
public class ClydeCommand implements Command {
|
||||
|
||||
@Override
|
||||
public void executed(String[] args, CommandEvent event) {
|
||||
if (args.length > 0) {
|
||||
if (event.getGuild().getSelfMember().hasPermission(Permission.MANAGE_WEBHOOKS)) {
|
||||
TextChannel channel = event.getMessage().getTextChannel();
|
||||
String content = event.getMessage().getContentRaw().replace(event.getRethink().getGuildPrefix(event.getGuild().getId()), "").replace(event.getRethink().getUserPrefix(event.getAuthor().getId()), "").replace("clyde", "");
|
||||
|
||||
Webhook webhook = channel.createWebhook(event.getConfig().getClydeName()).complete();
|
||||
try {
|
||||
InputStream s = new URL("https://discordapp.com/assets/f78426a064bc9dd24847519259bc42af.png").openStream();
|
||||
webhook.getManager().setAvatar(Icon.from(s)).queue();
|
||||
|
||||
WebhookClientBuilder builder = new WebhookClientBuilder(webhook.getUrl());
|
||||
|
||||
WebhookClient client = builder.build();
|
||||
try {
|
||||
TimeUnit.SECONDS.sleep(1);
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
client.send(content);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
try {
|
||||
TimeUnit.SECONDS.sleep(2);
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
webhook.delete().queue();
|
||||
} else {
|
||||
event.getTextChannel().sendMessage(event.getMessageEditor().getMessage(MessageEditor.MessageType.NO_SELF_PERMISSION).build()).queue();
|
||||
}
|
||||
} else event.getHelpCommand().sendHelp(this, event);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] labels() {
|
||||
return new String[]{"clyde"};
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "commands.fun.clyde.help.description";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String usage() {
|
||||
return "content";
|
||||
}
|
||||
}
|
||||
|
|
@ -1,61 +0,0 @@
|
|||
package com.bbn.hadder.commands.fun;
|
||||
|
||||
/*
|
||||
* @author Skidder / GregTCLTK
|
||||
*/
|
||||
|
||||
import com.bbn.hadder.commands.Command;
|
||||
import com.bbn.hadder.commands.CommandEvent;
|
||||
import com.bbn.hadder.utils.MessageEditor;
|
||||
import okhttp3.OkHttpClient;
|
||||
import okhttp3.Request;
|
||||
import okhttp3.Response;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.awt.*;
|
||||
import java.io.IOException;
|
||||
|
||||
public class MemeCommand implements Command {
|
||||
|
||||
@Override
|
||||
public void executed(String[] args, CommandEvent event) {
|
||||
|
||||
OkHttpClient client = new OkHttpClient();
|
||||
Request request = new Request.Builder().url("https://some-random-api.ml/meme").build();
|
||||
|
||||
try {
|
||||
Response response = client.newCall(request).execute();
|
||||
JSONObject json = new JSONObject(response.body().string());
|
||||
String url = json.get("image").toString();
|
||||
event.getTextChannel().sendMessage(
|
||||
event.getMessageEditor().getMessage(MessageEditor.MessageType.INFO,
|
||||
"commands.fun.meme.success.title", "")
|
||||
.setImage(url)
|
||||
.build()).queue();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
event.getTextChannel().sendMessage(
|
||||
event.getMessageEditor().getMessage(
|
||||
MessageEditor.MessageType.ERROR,
|
||||
"error",
|
||||
"commands.fun.meme.api.error")
|
||||
.setColor(Color.RED)
|
||||
.build()).queue();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] labels() {
|
||||
return new String[]{"meme"};
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "commands.fun.meme.help.description";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String usage() {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
|
@ -1,39 +0,0 @@
|
|||
package com.bbn.hadder.commands.general;
|
||||
|
||||
/*
|
||||
* @author Skidder / GregTCLTK
|
||||
*/
|
||||
|
||||
import com.bbn.hadder.commands.Command;
|
||||
import com.bbn.hadder.commands.CommandEvent;
|
||||
import com.bbn.hadder.utils.MessageEditor;
|
||||
|
||||
public class AboutCommand implements Command {
|
||||
|
||||
@Override
|
||||
public void executed(String[] args, CommandEvent event) {
|
||||
event.getTextChannel().sendMessage(
|
||||
event.getMessageEditor().getMessage(
|
||||
MessageEditor.MessageType.INFO,
|
||||
"commands.general.about.success.title",
|
||||
"commands.general.about.success.description")
|
||||
.addField(event.getMessageEditor().getTerm("commands.general.about.success.field.one.title"), event.getMessageEditor().getTerm("commands.general.about.success.field.one.description", "(https://donatebot.io/checkout/448554629282922527?buyer=" + event.getAuthor().getId() + "). :smiley:", ""), true)
|
||||
.setThumbnail("https://bigbotnetwork.com/images/Hadder.png")
|
||||
.build()).queue();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] labels() {
|
||||
return new String[]{"about", "info"};
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "commands.general.about.help.description";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String usage() {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
|
@ -1,55 +0,0 @@
|
|||
package com.bbn.hadder.commands.general;
|
||||
|
||||
import com.bbn.hadder.commands.Command;
|
||||
import com.bbn.hadder.commands.CommandEvent;
|
||||
import com.bbn.hadder.utils.EventWaiter;
|
||||
import com.bbn.hadder.utils.MessageEditor;
|
||||
|
||||
/*
|
||||
* @author Skidder / GregTCLTK
|
||||
*/
|
||||
|
||||
public class EqualsCommand implements Command {
|
||||
|
||||
@Override
|
||||
public void executed(String[] args, CommandEvent event) {
|
||||
event.getChannel().sendMessage(
|
||||
event.getMessageEditor().getMessage(
|
||||
MessageEditor.MessageType.INFO,
|
||||
"commands.general.equals.string.first.request", "")
|
||||
.build()).queue();
|
||||
new EventWaiter().newOnMessageEventWaiter(msgevent -> {
|
||||
String firstString = msgevent.getMessage().getContentRaw();
|
||||
event.getChannel().sendMessage(
|
||||
event.getMessageEditor().getMessage(
|
||||
MessageEditor.MessageType.INFO,
|
||||
"commands.general.equals.string.second.request",
|
||||
"").build()).queue();
|
||||
new EventWaiter().newOnMessageEventWaiter(msgevent2 -> {
|
||||
String secondString = msgevent2.getMessage().getContentRaw();
|
||||
event.getChannel().sendMessage(
|
||||
event.getMessageEditor().getMessage(MessageEditor.MessageType.INFO)
|
||||
.setTitle((firstString.equals(secondString)) ? event.getMessageEditor().getTerm( "commands.general.equals.string.equals.true") : event.getMessageEditor().getTerm( "commands.general.equals.string.equals.false"))
|
||||
.addField(event.getMessageEditor().getTerm( "commands.general.equals.string.first"), firstString, false)
|
||||
.addField(event.getMessageEditor().getTerm( "commands.general.equals.string.second"), secondString, false)
|
||||
.addField(event.getMessageEditor().getTerm( "commands.general.equals.string.result"), String.valueOf(firstString.equals(secondString)), false)
|
||||
.build()).queue();
|
||||
}, event.getJDA(), event.getAuthor());
|
||||
}, event.getJDA(), event.getAuthor());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] labels() {
|
||||
return new String[]{"equals"};
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "commands.general.equals.help.description";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String usage() {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
|
@ -1,87 +0,0 @@
|
|||
package com.bbn.hadder.commands.general;
|
||||
|
||||
import com.bbn.hadder.commands.Command;
|
||||
import com.bbn.hadder.commands.CommandEvent;
|
||||
import com.bbn.hadder.utils.MessageEditor;
|
||||
import net.dv8tion.jda.api.EmbedBuilder;
|
||||
import net.dv8tion.jda.api.Permission;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class HelpCommand implements Command {
|
||||
|
||||
@Override
|
||||
public void executed(String[] args, CommandEvent event) {
|
||||
if (event.getGuild().getSelfMember().hasPermission(Permission.MESSAGE_EMBED_LINKS)) {
|
||||
if (args.length == 0) {
|
||||
HashMap<String, ArrayList<Command>> hashMap = new HashMap<>();
|
||||
for (Command cmd : event.getCommandHandler().getCommandList()) {
|
||||
if (!hashMap.containsKey(cmd.getClass().getPackageName())) {
|
||||
ArrayList<Command> cmdlist = new ArrayList<>();
|
||||
cmdlist.add(cmd);
|
||||
hashMap.put(cmd.getClass().getPackageName(), cmdlist);
|
||||
} else {
|
||||
hashMap.get(cmd.getClass().getPackageName()).add(cmd);
|
||||
}
|
||||
}
|
||||
EmbedBuilder eb = new EmbedBuilder();
|
||||
for (Map.Entry<String, ArrayList<Command>> entry : hashMap.entrySet()) {
|
||||
if (!entry.getKey().endsWith("owner") || (entry.getKey().endsWith("owner") && (event.getAuthor().getId().equals("477141528981012511") ||
|
||||
event.getAuthor().getId().equals("261083609148948488")))) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (int i = 0; i < entry.getValue().size(); i++) {
|
||||
Command cmd = entry.getValue().get(i);
|
||||
sb.append("`").append(cmd.labels()[0]).append("`");
|
||||
if (i < entry.getValue().size() - 1) sb.append(", ");
|
||||
}
|
||||
String[] ps = entry.getKey().split("\\.");
|
||||
eb.addField(ps[ps.length - 1], sb.toString(), false);
|
||||
}
|
||||
}
|
||||
event.getMessageEditor().getMessage(MessageEditor.MessageType.INFO);
|
||||
event.getChannel().sendMessage(eb.build()).queue();
|
||||
} else {
|
||||
for (Command cmd : event.getCommandHandler().getCommandList()) {
|
||||
for (String label : cmd.labels()) {
|
||||
if (label.equalsIgnoreCase(args[0])) {
|
||||
sendHelp(cmd, event);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
event.getTextChannel().sendMessage(event.getMessageEditor().getTerm("commands.general.help.error.description")).queue();
|
||||
}
|
||||
}
|
||||
|
||||
public void sendHelp(Command cmd, CommandEvent event) {
|
||||
if (!cmd.getClass().getPackageName().endsWith("owner") || (cmd.getClass().getPackageName().endsWith("owner") &&
|
||||
(event.getAuthor().getId().equals("477141528981012511") || event.getAuthor().getId().equals("261083609148948488")))) {
|
||||
String name = cmd.labels()[0];
|
||||
event.getChannel().sendMessage(event.getMessageEditor().getMessage(
|
||||
MessageEditor.MessageType.INFO, "", cmd.description())
|
||||
.setTitle(name.replaceFirst(String.valueOf(name.charAt(0)), String.valueOf(name.charAt(0)).toUpperCase()))
|
||||
.addField(MessageEditor.getTerm(event, "commands.general.help.field.usage", "", ""),
|
||||
event.getRethink().getUserPrefix(event.getAuthor().getId()) + cmd.labels()[0] + " " + event.getMessageEditor().getTerm(cmd.usage()), false)
|
||||
.build()).queue();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] labels() {
|
||||
return new String[]{"help"};
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "commands.general.help.help.description";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String usage() {
|
||||
return "commands.general.help.help.label";
|
||||
}
|
||||
}
|
||||
|
|
@ -1,42 +0,0 @@
|
|||
package com.bbn.hadder.commands.general;
|
||||
|
||||
import com.bbn.hadder.Hadder;
|
||||
import com.bbn.hadder.commands.Command;
|
||||
import com.bbn.hadder.commands.CommandEvent;
|
||||
import com.bbn.hadder.utils.MessageEditor;
|
||||
|
||||
/*
|
||||
* @author Skidder / GregTCLTK
|
||||
*/
|
||||
|
||||
public class InviteCommand implements Command {
|
||||
|
||||
@Override
|
||||
public void executed(String[] args, CommandEvent event) {
|
||||
event.getTextChannel().sendMessage(
|
||||
event.getMessageEditor().getMessage(
|
||||
MessageEditor.MessageType.INFO,
|
||||
"commands.general.invite.success.title",
|
||||
"",
|
||||
"commands.general.invite.success.description",
|
||||
"(https://discordapp.com/oauth2/authorize?client_id="
|
||||
+ Hadder.shardManager.getGuilds().get(0).getSelfMember().getId()
|
||||
+ "&scope=bot&permissions=470133879)")
|
||||
.build()).queue();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] labels() {
|
||||
return new String[]{"invite"};
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "commands.general.invite.help.description";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String usage() {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
|
@ -1,36 +0,0 @@
|
|||
package com.bbn.hadder.commands.general;
|
||||
|
||||
/*
|
||||
* @author Skidder / GregTCLTK
|
||||
*/
|
||||
|
||||
import com.bbn.hadder.commands.Command;
|
||||
import com.bbn.hadder.commands.CommandEvent;
|
||||
import com.bbn.hadder.utils.MessageEditor;
|
||||
|
||||
public class PingCommand implements Command {
|
||||
|
||||
@Override
|
||||
public void executed(String[] args, CommandEvent event) {
|
||||
event.getJDA().getRestPing().queue(ping -> event.getTextChannel().sendMessage(event.getMessageEditor()
|
||||
.getMessage(MessageEditor.MessageType.INFO)
|
||||
.setTitle("Ping")
|
||||
.setDescription(String.valueOf(ping))
|
||||
.build()).queue());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] labels() {
|
||||
return new String[]{"ping"};
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "commands.general.ping.help.description";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String usage() {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
|
@ -1,69 +0,0 @@
|
|||
package com.bbn.hadder.commands.misc;
|
||||
|
||||
/*
|
||||
* @author Skidder / GregTCLTK
|
||||
*/
|
||||
|
||||
import com.bbn.hadder.commands.Command;
|
||||
import com.bbn.hadder.commands.CommandEvent;
|
||||
import com.bbn.hadder.utils.EventWaiter;
|
||||
import com.bbn.hadder.utils.MessageEditor;
|
||||
import org.kohsuke.github.GHIssue;
|
||||
import org.kohsuke.github.GHRepository;
|
||||
import org.kohsuke.github.GitHub;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class FeedbackCommand implements Command {
|
||||
|
||||
@Override
|
||||
public void executed(String[] args, CommandEvent event) {
|
||||
event.getTextChannel().sendMessage(
|
||||
event.getMessageEditor().getMessage(
|
||||
MessageEditor.MessageType.INFO,
|
||||
"commands.misc.feedback.title.request.title",
|
||||
"commands.misc.feedback.title.request.description")
|
||||
.build()).queue();
|
||||
new EventWaiter().newOnMessageEventWaiter(event1 -> {
|
||||
String title = event1.getMessage().getContentDisplay();
|
||||
event1.getChannel().sendMessage(event.getMessageEditor().getMessage(
|
||||
MessageEditor.MessageType.INFO,
|
||||
"commands.misc.feedback.description.request.title",
|
||||
"commands.misc.feedback.description.request.description")
|
||||
.build()).queue();
|
||||
new EventWaiter().newOnMessageEventWaiter(event2 -> {
|
||||
String description = event2.getMessage().getContentDisplay();
|
||||
try {
|
||||
GitHub connection = GitHub.connectUsingOAuth(event.getConfig().getGitHubToken());
|
||||
GHRepository Hadder = connection.getOrganization("BigBotNetwork").getRepository("Hadder");
|
||||
GHIssue issue = Hadder.createIssue(title).body("<strong>Feedback by " + event.getAuthor().getAsTag() + "</strong><br>" + description).label("feedback").create();
|
||||
event.getTextChannel().sendMessage(
|
||||
event.getMessageEditor().getMessage(
|
||||
MessageEditor.MessageType.INFO,
|
||||
"commands.misc.feedback.success.title",
|
||||
"")
|
||||
.setDescription(issue.getHtmlUrl().toString())
|
||||
.build()).queue();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}, event.getJDA(), event.getAuthor());
|
||||
}, event.getJDA(), event.getAuthor());
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] labels() {
|
||||
return new String[]{"feedback"};
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "commands.misc.feedback.help.description";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String usage() {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
|
@ -1,104 +0,0 @@
|
|||
package com.bbn.hadder.commands.misc;
|
||||
|
||||
/*
|
||||
* @author Skidder / GregTCLTK
|
||||
*/
|
||||
|
||||
import com.bbn.hadder.commands.Command;
|
||||
import com.bbn.hadder.commands.CommandEvent;
|
||||
import com.bbn.hadder.utils.MessageEditor;
|
||||
import okhttp3.OkHttpClient;
|
||||
import okhttp3.Request;
|
||||
import okhttp3.Response;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class GitHubCommand implements Command {
|
||||
|
||||
@Override
|
||||
public void executed(String[] args, CommandEvent event) {
|
||||
if (args.length > 0) {
|
||||
if (args[0].equals("link")) {
|
||||
event.getTextChannel().sendMessage(
|
||||
event.getMessageEditor().getMessage(
|
||||
MessageEditor.MessageType.INFO,
|
||||
"commands.misc.github.link.title",
|
||||
"")
|
||||
.setDescription("https://github.com/login/oauth/authorize?client_id=25321f690bb1b6952942")
|
||||
.build()
|
||||
).queue();
|
||||
} else {
|
||||
Request request = new Request.Builder().url("https://api.github.com/users/" + args[0]).build();
|
||||
try {
|
||||
|
||||
Response response = new OkHttpClient().newCall(request).execute();
|
||||
JSONObject json = new JSONObject(response.body().string());
|
||||
|
||||
String nickname = json.getString("name");
|
||||
String bio = "None";
|
||||
String location = "None";
|
||||
String website = "None";
|
||||
try {
|
||||
bio = json.getString("bio");
|
||||
} catch (JSONException ignored) {
|
||||
}
|
||||
try {
|
||||
location = json.getString("location");
|
||||
} catch (JSONException ignored) {
|
||||
}
|
||||
|
||||
if (!json.getString("blog").equals("")) website = json.getString("blog");
|
||||
|
||||
event.getTextChannel().sendMessage(event.getMessageEditor().getMessage(MessageEditor.MessageType.INFO)
|
||||
.setAuthor(event.getMessageEditor().getTerm("commands.misc.github.success.title", nickname + " (" + args[0] + ")", ""), "https://github.com/" + args[0] + "", "https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png")
|
||||
.setThumbnail(json.getString("avatar_url"))
|
||||
.addField(event.getMessageEditor().getTerm("commands.misc.github.success.bio"), bio, false)
|
||||
.addField(event.getMessageEditor().getTerm("commands.misc.github.success.location"), location, true)
|
||||
.addField(event.getMessageEditor().getTerm("commands.misc.github.success.website"), website, true)
|
||||
.addField(event.getMessageEditor().getTerm("commands.misc.github.success.repositories"), String.valueOf(json.getInt("public_repos")), true)
|
||||
.addField(event.getMessageEditor().getTerm("commands.misc.github.success.gists"), String.valueOf(json.getInt("public_gists")), true)
|
||||
.addField(event.getMessageEditor().getTerm("commands.misc.github.success.followers"), String.valueOf(json.getInt("followers")), true)
|
||||
.addField(event.getMessageEditor().getTerm("commands.misc.github.success.following"), String.valueOf(json.getInt("following")), true)
|
||||
.build()).queue();
|
||||
|
||||
} catch (IOException | NullPointerException e) {
|
||||
event.getTextChannel().sendMessage(
|
||||
event.getMessageEditor().getMessage(
|
||||
MessageEditor.MessageType.ERROR,
|
||||
"",
|
||||
"commands.misc.github.api.error.description")
|
||||
.build()
|
||||
).queue();
|
||||
} catch (JSONException e) {
|
||||
event.getTextChannel().sendMessage(event.getMessageEditor().getMessage(MessageEditor.MessageType.WARNING, "","commands.misc.github.user.error.description").build()).queue();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
event.getTextChannel().sendMessage(
|
||||
event.getMessageEditor().getMessage(
|
||||
MessageEditor.MessageType.INFO,
|
||||
"commands.misc.github.connect.title",
|
||||
"",
|
||||
"commands.misc.github.connect.description",
|
||||
"(https://github.com/login/oauth/authorize?client_id=25321f690bb1b6952942)")
|
||||
.build()).queue();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] labels() {
|
||||
return new String[]{"github"};
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "commands.misc.github.help.description";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String usage() {
|
||||
return "username";
|
||||
}
|
||||
}
|
||||
|
|
@ -1,87 +0,0 @@
|
|||
package com.bbn.hadder.commands.misc;
|
||||
|
||||
import com.bbn.hadder.commands.Command;
|
||||
import com.bbn.hadder.commands.CommandEvent;
|
||||
import com.bbn.hadder.utils.EventWaiter;
|
||||
import com.bbn.hadder.utils.MessageEditor;
|
||||
import com.bbn.hadder.utils.MessageEditor.MessageType;
|
||||
|
||||
import net.dv8tion.jda.api.EmbedBuilder;
|
||||
import net.dv8tion.jda.api.entities.VoiceChannel;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ScreenShareCommand implements Command {
|
||||
|
||||
@Override
|
||||
public void executed(String[] args, CommandEvent event) {
|
||||
if (args.length>0) {
|
||||
if (args[0].matches("[0-9]*")&&args.length==1) {
|
||||
for (VoiceChannel vc : event.getGuild().getVoiceChannels()) {
|
||||
try {
|
||||
if (vc.getIdLong() == Long.parseLong(args[0])) {
|
||||
event.getChannel().sendMessage(event.getMessageEditor().getMessage(
|
||||
MessageEditor.MessageType.INFO,
|
||||
"commands.misc.screenshare.success.title", "")
|
||||
.setDescription("http://discordapp.com/channels/" + event.getGuild().getId() + "/" + vc.getId() + "/").build()).queue();
|
||||
return;
|
||||
}
|
||||
} catch (NumberFormatException e) {
|
||||
event.getChannel().sendMessage(event.getMessageEditor().getMessage(MessageEditor.MessageType.ERROR, "commands.misc.screenshare.id.error.title", "commands.misc.screenshare.id.error.description").build()).queue();
|
||||
event.getHelpCommand().sendHelp(this, event);
|
||||
return;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
List<VoiceChannel> vcs = event.getGuild().getVoiceChannelsByName(String.join(" ", args), true);
|
||||
if (vcs.size() > 1) {
|
||||
EmbedBuilder eb = event.getMessageEditor().getMessage(MessageType.ERROR, "commands.misc.screenshare.channel.error.title", "commands.misc.screenshare.channel.error.description");
|
||||
for (int i = 0; i < vcs.size(); i++) {
|
||||
VoiceChannel voiceChannel = vcs.get(i);
|
||||
eb.addField(i + ": " + voiceChannel.getName(), voiceChannel.getId(), false);
|
||||
}
|
||||
event.getChannel().sendMessage(event.getMessageEditor().getMessage(MessageEditor.MessageType.WARNING).build()).queue();
|
||||
new EventWaiter().newOnMessageEventWaiter(msgevent -> {
|
||||
try {
|
||||
int i = Integer.parseInt(msgevent.getMessage().getContentRaw());
|
||||
if (vcs.size() > i) {
|
||||
event.getChannel().sendMessage(event.getMessageEditor().getMessage(MessageEditor.MessageType.INFO, "commands.misc.screenshare.success.title", "")
|
||||
.setDescription("http://discordapp.com/channels/" + event.getGuild().getId() + "/" + vcs.get(i).getId() + "/").build()).queue();
|
||||
} else {
|
||||
|
||||
event.getChannel().sendMessage(event.getMessageEditor().getMessage(MessageEditor.MessageType.ERROR, "commands.misc.screenshare.number.error.title", "").build()).queue();
|
||||
event.getHelpCommand().sendHelp(this, event);
|
||||
}
|
||||
} catch (NumberFormatException e) {
|
||||
event.getChannel().sendMessage(event.getMessageEditor().getMessage(MessageEditor.MessageType.ERROR, "commands.misc.screenshare.id.error.title", "commands.misc.screenshare.number.error.description").build()).queue();
|
||||
event.getHelpCommand().sendHelp(this, event);
|
||||
}
|
||||
}, event.getJDA(), event.getAuthor());
|
||||
} else if (vcs.size()==0) {
|
||||
event.getChannel().sendMessage(event.getMessageEditor().getMessage(MessageEditor.MessageType.ERROR, "commands.misc.screenshare.channel.existing.error", "commands.misc.screenshare.channel.existing.description").build()).queue();
|
||||
event.getHelpCommand().sendHelp(this, event);
|
||||
} else {
|
||||
event.getChannel().sendMessage(event.getMessageEditor().getMessage(MessageEditor.MessageType.INFO, "commands.misc.screenshare.success.title", "")
|
||||
.setDescription("http://discordapp.com/channels/" + event.getGuild().getId() + "/" + vcs.get(0).getId() + "/").build()).queue();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
event.getHelpCommand().sendHelp(this, event);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] labels() {
|
||||
return new String[]{"screenshare"};
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "commands.misc.screenshare.help.description";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String usage() {
|
||||
return "vc-name/id";
|
||||
}
|
||||
}
|
||||
|
|
@ -1,97 +0,0 @@
|
|||
package com.bbn.hadder.commands.moderation;
|
||||
|
||||
/*
|
||||
* @author Skidder / GregTCLTK
|
||||
*/
|
||||
|
||||
import com.bbn.hadder.commands.Command;
|
||||
import com.bbn.hadder.commands.CommandEvent;
|
||||
import com.bbn.hadder.core.Perm;
|
||||
import com.bbn.hadder.core.Perms;
|
||||
import com.bbn.hadder.utils.MessageEditor;
|
||||
import net.dv8tion.jda.api.entities.Member;
|
||||
|
||||
@Perms(Perm.BAN_MEMBERS)
|
||||
public class BanCommand implements Command {
|
||||
|
||||
@Override
|
||||
public void executed(String[] args, CommandEvent event) {
|
||||
if (event.getMessage().getMentionedMembers().size() == 1) {
|
||||
Member victim = event.getMessage().getMentionedMembers().get(0);
|
||||
if (!event.getAuthor().getId().equals(victim.getId())) {
|
||||
if (!event.getJDA().getSelfUser().getId().equals(victim.getId())) {
|
||||
if (event.getGuild().getSelfMember().canInteract(victim)) {
|
||||
event.getGuild().ban(victim, 0, "Banned by " + event.getAuthor().getAsTag()).queue();
|
||||
event.getTextChannel().sendMessage(
|
||||
event.getMessageEditor().getMessage(
|
||||
MessageEditor.MessageType.INFO,
|
||||
"commands.moderation.ban.success.title",
|
||||
"✅",
|
||||
"commands.moderation.ban.success.description",
|
||||
victim.getUser().getName() + ".").build()).queue();
|
||||
} else {
|
||||
event.getTextChannel().sendMessage(event.getMessageEditor().getMessage(MessageEditor.MessageType.NO_SELF_PERMISSION).build()).queue();
|
||||
}
|
||||
} else {
|
||||
event.getTextChannel().sendMessage(
|
||||
event.getMessageEditor().getMessage(
|
||||
MessageEditor.MessageType.WARNING,
|
||||
"commands.moderation.ban.error.title",
|
||||
"commands.moderation.ban.myself.error.description").build()).queue();
|
||||
}
|
||||
} else {
|
||||
event.getTextChannel().sendMessage
|
||||
(event.getMessageEditor().getMessage(
|
||||
MessageEditor.MessageType.WARNING,
|
||||
"commands.moderation.ban.error.title",
|
||||
"commands.moderation.ban.yourself.error.description").build()).queue();
|
||||
}
|
||||
} else if (event.getMessage().getMentionedMembers().size() == 0) {
|
||||
event.getHelpCommand().sendHelp(this, event);
|
||||
} else if (event.getMessage().getMentionedMembers().size() > 1) {
|
||||
for (int i = 0; i < event.getMessage().getMentionedMembers().size(); i++) {
|
||||
Member member = event.getMessage().getMentionedMembers().get(i);
|
||||
if (!event.getAuthor().getId().equals(member.getId())) {
|
||||
if (!event.getJDA().getSelfUser().getId().equals(member.getId())) {
|
||||
if (event.getGuild().getSelfMember().canInteract(member)) {
|
||||
event.getGuild().ban(member, 0).reason("Mass Ban by " + event.getAuthor().getAsTag()).queue();
|
||||
} else {
|
||||
event.getTextChannel().sendMessage(event.getMessageEditor().getMessage(MessageEditor.MessageType.NO_SELF_PERMISSION).build()).queue();
|
||||
}
|
||||
} else {
|
||||
event.getTextChannel().sendMessage(
|
||||
event.getMessageEditor().getMessage(
|
||||
MessageEditor.MessageType.WARNING,
|
||||
"commands.moderation.ban.error.title",
|
||||
"commands.moderation.ban.myself.error.description").build()).queue();
|
||||
}
|
||||
} else {
|
||||
event.getTextChannel().sendMessage(event.getMessageEditor().getMessage(
|
||||
MessageEditor.MessageType.WARNING,
|
||||
"commands.moderation.ban.error.title",
|
||||
"commands.moderation.ban.yourself.error.description").build()).queue();
|
||||
}
|
||||
}
|
||||
event.getTextChannel().sendMessage(event.getMessageEditor().getMessage(MessageEditor.MessageType.INFO,
|
||||
"commands.moderation.ban.success.title",
|
||||
"✅",
|
||||
"commands.moderation.ban.massban.success.description",
|
||||
String.valueOf(event.getMessage().getMentionedMembers().size())).build()).queue();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] labels() {
|
||||
return new String[]{"ban"};
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "commands.moderation.ban.help.description";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String usage() {
|
||||
return "user";
|
||||
}
|
||||
}
|
||||
|
|
@ -1,90 +0,0 @@
|
|||
package com.bbn.hadder.commands.moderation;
|
||||
|
||||
/*
|
||||
* @author Skidder / GregTCLTK
|
||||
*/
|
||||
|
||||
import com.bbn.hadder.commands.Command;
|
||||
import com.bbn.hadder.commands.CommandEvent;
|
||||
import com.bbn.hadder.core.Perm;
|
||||
import com.bbn.hadder.core.Perms;
|
||||
import com.bbn.hadder.utils.MessageEditor;
|
||||
import net.dv8tion.jda.api.Permission;
|
||||
import net.dv8tion.jda.api.entities.Message;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
@Perms(Perm.MANAGE_MESSAGES)
|
||||
public class ClearCommand implements Command {
|
||||
|
||||
@Override
|
||||
public void executed(String[] args, CommandEvent event) {
|
||||
if (args.length > 0) {
|
||||
if (event.getGuild().getSelfMember().hasPermission(Permission.MESSAGE_MANAGE)) {
|
||||
if (args[0].equals("all")) {
|
||||
List<Message> msg = event.getTextChannel().getIterableHistory().complete();
|
||||
for (Message message : msg) {
|
||||
message.delete().queue();
|
||||
}
|
||||
Message message = event.getTextChannel().sendMessage(event.getMessageEditor().getMessage(
|
||||
MessageEditor.MessageType.INFO,
|
||||
"commands.moderation.lear.all.success.title",
|
||||
"",
|
||||
"commands.moderation.lear.all.success.description",
|
||||
String.valueOf(msg.size()))
|
||||
.build()).complete();
|
||||
try {
|
||||
TimeUnit.SECONDS.sleep(3);
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
message.delete().queue();
|
||||
} else {
|
||||
try {
|
||||
int nbToDelete = Integer.parseInt(args[0]);
|
||||
if (nbToDelete < 1 || nbToDelete > 99) {
|
||||
event.getTextChannel().sendMessage(event.getMessageEditor().getMessage(MessageEditor.MessageType.WARNING, "", "commands.moderation.clear.number.error.description").build()).queue();
|
||||
} else {
|
||||
List<Message> history = event.getTextChannel().getHistory().retrievePast(nbToDelete + 1).complete();
|
||||
List<Message> msgToDelete = new ArrayList<>(history);
|
||||
event.getTextChannel().deleteMessages(msgToDelete).queue();
|
||||
Message msg = event.getTextChannel().sendMessage(event.getMessageEditor().getMessage(MessageEditor.MessageType.INFO, "", "", "commands.moderation.clear.success.description", String.valueOf(nbToDelete)).build()).complete();
|
||||
try {
|
||||
TimeUnit.SECONDS.sleep(2);
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
msg.delete().queue();
|
||||
}
|
||||
} catch (NumberFormatException e) {
|
||||
event.getHelpCommand().sendHelp(this, event);
|
||||
} catch (IllegalArgumentException e) {
|
||||
event.getTextChannel().sendMessage(event.getMessageEditor().getMessage(MessageEditor.MessageType.WARNING, "commands.moderation.clear.message.error.title", "commands.moderation.clear.message.error.description")
|
||||
.build()).queue();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
event.getTextChannel().sendMessage(event.getMessageEditor().getMessage(MessageEditor.MessageType.NO_SELF_PERMISSION).build()).queue();
|
||||
}
|
||||
} else {
|
||||
event.getHelpCommand().sendHelp(this, event);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] labels() {
|
||||
return new String[]{"clear"};
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "commands.moderation.clear.help.description";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String usage() {
|
||||
return "number";
|
||||
}
|
||||
}
|
||||
|
|
@ -1,75 +0,0 @@
|
|||
package com.bbn.hadder.commands.moderation;
|
||||
|
||||
/*
|
||||
* @author Skidder / GregTCLTK
|
||||
*/
|
||||
|
||||
import com.bbn.hadder.commands.Command;
|
||||
import com.bbn.hadder.commands.CommandEvent;
|
||||
import com.bbn.hadder.core.Perm;
|
||||
import com.bbn.hadder.core.Perms;
|
||||
import com.bbn.hadder.utils.MessageEditor;
|
||||
|
||||
@Perms(Perm.MANAGE_SERVER)
|
||||
public class InviteDetectCommand implements Command {
|
||||
|
||||
@Override
|
||||
public void executed(String[] args, CommandEvent event) {
|
||||
if (args.length == 1) {
|
||||
String opinion = args[0].toLowerCase();
|
||||
switch (opinion) {
|
||||
case "on":
|
||||
if (!event.getRethink().getInviteDetection(event.getGuild().getId())) {
|
||||
event.getRethink().setInviteDetection(event.getGuild().getId(), true);
|
||||
event.getTextChannel().sendMessage(
|
||||
event.getMessageEditor().getMessage(
|
||||
MessageEditor.MessageType.INFO,
|
||||
"commands.moderation.invitedetect.activate.success.title",
|
||||
"commands.moderation.invitedetect.activate.success.description")
|
||||
.build()).queue();
|
||||
} else {
|
||||
event.getTextChannel().sendMessage(event.getMessageEditor().getMessage(
|
||||
MessageEditor.MessageType.WARNING,
|
||||
"commands.moderation.invitedetect.activate.error.title",
|
||||
"commands.moderation.invitedetect.activate.error.description")
|
||||
.build()).queue();
|
||||
}
|
||||
break;
|
||||
|
||||
case "off":
|
||||
if (event.getRethink().getInviteDetection(event.getGuild().getId())) {
|
||||
event.getRethink().setInviteDetection(event.getGuild().getId(), false);
|
||||
event.getTextChannel().sendMessage(event.getMessageEditor().getMessage(
|
||||
MessageEditor.MessageType.INFO,
|
||||
"commands.moderation.invitedetect.deactivate.success.title",
|
||||
"commands.moderation.invitedetect.deactivate.success.description")
|
||||
.build()).queue();
|
||||
} else {
|
||||
event.getTextChannel().sendMessage(event.getMessageEditor().getMessage(
|
||||
MessageEditor.MessageType.WARNING,
|
||||
"commands.moderation.invitedetect.deactivate.error.title",
|
||||
"commands.moderation.invitedetect.deactivate.error.description")
|
||||
.build()).queue();
|
||||
}
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
event.getHelpCommand().sendHelp(this, event);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] labels() {
|
||||
return new String[]{"invitedetect", "detectinvite"};
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "commands.moderation.invitedetect.help.description";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String usage() {
|
||||
return "<on/off>";
|
||||
}
|
||||
}
|
||||
|
|
@ -1,82 +0,0 @@
|
|||
package com.bbn.hadder.commands.moderation;
|
||||
|
||||
/*
|
||||
* @author Skidder / GregTCLTK
|
||||
*/
|
||||
|
||||
import com.bbn.hadder.commands.Command;
|
||||
import com.bbn.hadder.commands.CommandEvent;
|
||||
import com.bbn.hadder.core.Perm;
|
||||
import com.bbn.hadder.core.Perms;
|
||||
import com.bbn.hadder.utils.MessageEditor;
|
||||
import net.dv8tion.jda.api.entities.Member;
|
||||
|
||||
@Perms(Perm.KICK_MEMBERS)
|
||||
public class KickCommand implements Command {
|
||||
|
||||
@Override
|
||||
public void executed(String[] args, CommandEvent event) {
|
||||
if (event.getMessage().getMentionedMembers().size() == 1) {
|
||||
Member victim = event.getMessage().getMentionedMembers().get(0);
|
||||
if (!event.getAuthor().getId().equals(victim.getId())) {
|
||||
if (!event.getJDA().getSelfUser().getId().equals(victim.getId())) {
|
||||
if (event.getGuild().getSelfMember().canInteract(victim)) {
|
||||
event.getGuild().kick(victim, "Kicked by " + event.getAuthor().getAsTag()).queue();
|
||||
event.getTextChannel().sendMessage(
|
||||
event.getMessageEditor().getMessage(
|
||||
MessageEditor.MessageType.INFO,
|
||||
"commands.moderation.kick.success.title",
|
||||
"✅",
|
||||
"commands.moderation.kick.success.description",
|
||||
victim.getUser().getName()).build()).queue();
|
||||
} else {
|
||||
event.getTextChannel().sendMessage(event.getMessageEditor().getMessage(MessageEditor.MessageType.NO_SELF_PERMISSION).build()).queue();
|
||||
}
|
||||
} else {
|
||||
event.getTextChannel().sendMessage(
|
||||
event.getMessageEditor().getMessage(
|
||||
MessageEditor.MessageType.WARNING,
|
||||
"commands.moderation.kick.error.title",
|
||||
"commands.moderation.kick.myself.error.description").build()).queue();
|
||||
}
|
||||
} else {
|
||||
event.getTextChannel().sendMessage(event.getMessageEditor().getMessage(MessageEditor.MessageType.WARNING, "commands.moderation.kick.error.title", "commands.moderation.kick.yourself.error.description").build()).queue();
|
||||
}
|
||||
} else if (event.getMessage().getMentionedMembers().size() == 0) {
|
||||
event.getHelpCommand().sendHelp(this, event);
|
||||
} else if (event.getMessage().getMentionedMembers().size() > 1) {
|
||||
for (int i = 0; i < event.getMessage().getMentionedMembers().size(); i++) {
|
||||
Member member = event.getMessage().getMentionedMembers().get(i);
|
||||
if (!event.getAuthor().getId().equals(member.getId())) {
|
||||
if (!event.getJDA().getSelfUser().getId().equals(member.getId())) {
|
||||
if (event.getGuild().getSelfMember().canInteract(member)) {
|
||||
event.getGuild().kick(member).reason("Mass Kicked by " + event.getAuthor().getAsTag()).queue();
|
||||
} else {
|
||||
event.getTextChannel().sendMessage(event.getMessageEditor().getMessage(MessageEditor.MessageType.NO_SELF_PERMISSION).build()).queue();
|
||||
}
|
||||
} else {
|
||||
event.getTextChannel().sendMessage(event.getMessageEditor().getMessage(MessageEditor.MessageType.WARNING, "commands.moderation.kick.error.title", "commands.moderation.kick.myself.error.description").build()).queue();
|
||||
}
|
||||
} else {
|
||||
event.getTextChannel().sendMessage(event.getMessageEditor().getMessage(MessageEditor.MessageType.WARNING, "commands.moderation.kick.error.title", "commands.moderation.kick.yourself.error.description").build()).queue();
|
||||
}
|
||||
}
|
||||
event.getTextChannel().sendMessage(event.getMessageEditor().getMessage(MessageEditor.MessageType.INFO, "commands.moderation.kick.success.title", "✅", "commands.moderation.kick.masskick.success.description", String.valueOf(event.getMessage().getMentionedMembers().size())).build()).queue();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] labels() {
|
||||
return new String[]{"kick"};
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "commands.moderation.kick.help.description";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String usage() {
|
||||
return "user";
|
||||
}
|
||||
}
|
||||
|
|
@ -1,110 +0,0 @@
|
|||
package com.bbn.hadder.commands.moderation;
|
||||
|
||||
/*
|
||||
* @author Skidder / GregTCLTK
|
||||
*/
|
||||
|
||||
import com.bbn.hadder.commands.Command;
|
||||
import com.bbn.hadder.commands.CommandEvent;
|
||||
import com.bbn.hadder.core.Perm;
|
||||
import com.bbn.hadder.core.Perms;
|
||||
import com.bbn.hadder.utils.MessageEditor;
|
||||
import net.dv8tion.jda.api.Permission;
|
||||
import net.dv8tion.jda.api.entities.Member;
|
||||
|
||||
@Perms(Perm.CHANGE_NICKNAME)
|
||||
public class NickCommand implements Command {
|
||||
|
||||
@Override
|
||||
public void executed(String[] args, CommandEvent event) {
|
||||
if (event.getGuild().getSelfMember().hasPermission(Permission.NICKNAME_MANAGE)) {
|
||||
if (event.getMessage().getMentionedMembers().size() == 1) {
|
||||
if (!event.getMessage().getMentionedMembers().get(0).getId().equals(event.getGuild().getSelfMember().getId())) {
|
||||
if (event.getGuild().getSelfMember().canInteract(event.getMessage().getMentionedMembers().get(0))) {
|
||||
if (args.length > 1) {
|
||||
if (event.getMessage().getContentRaw().startsWith(event.getRethink().getUserPrefix(event.getMember().getId()))) {
|
||||
event.getGuild().modifyNickname(event.getMessage().getMentionedMembers().get(0), event.getMessage().getContentRaw().replaceFirst(event.getRethink().getUserPrefix(event.getMember().getId()) + "nick " + args[0], "")).reason("Nicked by " + event.getAuthor().getAsTag()).queue();
|
||||
event.getTextChannel().sendMessage(
|
||||
event.getMessageEditor().getMessage(
|
||||
MessageEditor.MessageType.INFO,
|
||||
"commands.moderation.nick.success.title",
|
||||
"✅",
|
||||
"commands.moderation.nick.success.description",
|
||||
event.getMessage().getMentionedMembers().get(0).getUser().getAsTag()
|
||||
).build()).queue();
|
||||
} else if (event.getMessage().getContentRaw().startsWith(event.getRethink().getGuildPrefix(event.getGuild().getId()))) {
|
||||
event.getGuild().modifyNickname(event.getMessage().getMentionedMembers().get(0), event.getMessage().getContentRaw().replaceFirst(event.getRethink().getGuildPrefix(event.getGuild().getId()) + "nick " + args[0], "")).reason("Nicked by " + event.getAuthor().getAsTag()).queue();
|
||||
event.getTextChannel().sendMessage(
|
||||
event.getMessageEditor().getMessage(
|
||||
MessageEditor.MessageType.INFO,
|
||||
"commands.moderation.nick.success.title",
|
||||
"✅",
|
||||
"commands.moderation.nick.success.description", event.getMessage().getMentionedMembers().get(0).getUser().getAsTag()
|
||||
).build()).queue();
|
||||
}
|
||||
} else {
|
||||
event.getHelpCommand().sendHelp(this, event);
|
||||
}
|
||||
} else {
|
||||
event.getTextChannel().sendMessage(event.getMessageEditor().getMessage(MessageEditor.MessageType.NO_SELF_PERMISSION).build()).queue();
|
||||
}
|
||||
} else {
|
||||
if (event.getMessage().getContentRaw().startsWith(event.getRethink().getUserPrefix(event.getMember().getId()))) {
|
||||
event.getGuild().getSelfMember().modifyNickname(event.getMessage().getContentRaw().replaceFirst(event.getRethink().getUserPrefix(event.getMember().getId()) + "nick " + args[0], "")).reason("Nicked by " + event.getAuthor().getAsTag()).queue();
|
||||
event.getTextChannel().sendMessage(
|
||||
event.getMessageEditor().getMessage(
|
||||
MessageEditor.MessageType.INFO,
|
||||
"commands.moderation.nick.success.title",
|
||||
"✅",
|
||||
"commands.moderation.nick.myself.success.description",
|
||||
"").build()).queue();
|
||||
} else if (event.getMessage().getContentRaw().startsWith(event.getRethink().getGuildPrefix(event.getGuild().getId()))) {
|
||||
event.getGuild().getSelfMember().modifyNickname(event.getMessage().getContentRaw().replaceFirst(event.getRethink().getGuildPrefix(event.getGuild().getId()) + "nick " + args[0], "")).reason("Nicked by " + event.getAuthor().getAsTag()).queue();
|
||||
event.getTextChannel().sendMessage(
|
||||
event.getMessageEditor().getMessage(
|
||||
MessageEditor.MessageType.INFO,
|
||||
"commands.moderation.nick.success.title",
|
||||
"✅",
|
||||
"commands.moderation.nick.myself.success.description", ""
|
||||
).build()).queue();
|
||||
}
|
||||
}
|
||||
} else if (event.getMessage().getMentionedMembers().size() == 0) {
|
||||
event.getHelpCommand().sendHelp(this, event);
|
||||
} else {
|
||||
for (int i = 0; i < event.getMessage().getMentionedMembers().size(); i++) {
|
||||
Member member = event.getMessage().getMentionedMembers().get(i);
|
||||
if (!event.getJDA().getSelfUser().getId().equals(member.getId())) {
|
||||
event.getGuild().modifyNickname(member, args[args.length - 1]).reason("Mass Nicked by " + event.getAuthor().getAsTag()).queue();
|
||||
} else {
|
||||
event.getGuild().getSelfMember().modifyNickname(args[args.length - 1]).reason("Mass Nicked by " + event.getAuthor().getAsTag()).queue();
|
||||
}
|
||||
}
|
||||
event.getTextChannel().sendMessage(
|
||||
event.getMessageEditor().getMessage(
|
||||
MessageEditor.MessageType.INFO,
|
||||
"commands.moderation.nick.success.title",
|
||||
"✅",
|
||||
"commands.moderation.nick.myself.success.description", String.valueOf(event.getMessage().getMentionedMembers().size())
|
||||
).build()).queue();
|
||||
}
|
||||
} else {
|
||||
event.getTextChannel().sendMessage(event.getMessageEditor().getMessage(MessageEditor.MessageType.NO_SELF_PERMISSION).build()).queue();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] labels() {
|
||||
return new String[]{"nick"};
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "commands.moderation.nick.help.description";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String usage() {
|
||||
return "user+nickname";
|
||||
}
|
||||
}
|
||||
|
|
@ -1,51 +0,0 @@
|
|||
package com.bbn.hadder.commands.moderation;
|
||||
|
||||
import com.bbn.hadder.commands.Command;
|
||||
import com.bbn.hadder.commands.CommandEvent;
|
||||
import com.bbn.hadder.core.Perm;
|
||||
import com.bbn.hadder.core.Perms;
|
||||
import com.bbn.hadder.utils.MessageEditor;
|
||||
|
||||
@Perms(Perm.MANAGE_SERVER)
|
||||
public class PrefixCommand implements Command {
|
||||
|
||||
@Override
|
||||
public void executed(String[] args, CommandEvent event) {
|
||||
if (args.length == 1) {
|
||||
if (!args[0].contains("\"")) {
|
||||
|
||||
event.getRethink().setGuildPrefix(args[0], event.getGuild().getId());
|
||||
event.getTextChannel().sendMessage(event.getMessageEditor().getMessage(
|
||||
MessageEditor.MessageType.INFO,
|
||||
"commands.moderation.prefix.success.title",
|
||||
"✅",
|
||||
"commands.moderation.prefix.success.description",
|
||||
args[0]).build()
|
||||
).queue();
|
||||
} else {
|
||||
event.getTextChannel().sendMessage(
|
||||
event.getMessageEditor().getMessage(
|
||||
MessageEditor.MessageType.WARNING,
|
||||
"",
|
||||
"commands.moderation.prefix.error.description").build()).queue();
|
||||
}
|
||||
} else {
|
||||
event.getHelpCommand().sendHelp(this, event);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] labels() {
|
||||
return new String[]{"prefix"};
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "commands.moderation.prefix.help.description";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String usage() {
|
||||
return "prefix";
|
||||
}
|
||||
}
|
||||
|
|
@ -1,100 +0,0 @@
|
|||
package com.bbn.hadder.commands.moderation;
|
||||
|
||||
import com.bbn.hadder.commands.Command;
|
||||
import com.bbn.hadder.commands.CommandEvent;
|
||||
import com.bbn.hadder.core.Perm;
|
||||
import com.bbn.hadder.core.Perms;
|
||||
import com.bbn.hadder.utils.MessageEditor;
|
||||
import net.dv8tion.jda.api.Permission;
|
||||
import net.dv8tion.jda.api.entities.Member;
|
||||
import net.dv8tion.jda.api.entities.Role;
|
||||
|
||||
@Perms(Perm.MANAGE_ROLES)
|
||||
public class RoleCommand implements Command {
|
||||
|
||||
@Override
|
||||
public void executed(String[] args, CommandEvent event) {
|
||||
if (args.length > 0) {
|
||||
if (event.getMember().hasPermission(Permission.MANAGE_ROLES)) {
|
||||
|
||||
String action = args[0].toLowerCase();
|
||||
switch (action) {
|
||||
case "add":
|
||||
if (event.getMessage().getMentionedMembers().size() > 0 && event.getMessage().getMentionedRoles().size() > 0) {
|
||||
for (Member member : event.getMessage().getMentionedMembers()) {
|
||||
for (Role role : event.getMessage().getMentionedRoles()) {
|
||||
if (event.getGuild().getSelfMember().canInteract(member)) {
|
||||
if (event.getGuild().getSelfMember().canInteract(role)) {
|
||||
event.getGuild().addRoleToMember(member, role).reason("Role added by " + event.getAuthor().getAsTag()).queue();
|
||||
} else {
|
||||
event.getTextChannel().sendMessage(event.getMessageEditor().getMessage(MessageEditor.MessageType.NO_SELF_PERMISSION).build()).queue();
|
||||
}
|
||||
} else {
|
||||
event.getTextChannel().sendMessage(event.getMessageEditor().getMessage(MessageEditor.MessageType.NO_SELF_PERMISSION).build()).queue();
|
||||
}
|
||||
}
|
||||
}
|
||||
event.getChannel().sendMessage(
|
||||
event.getMessageEditor().getMessage(
|
||||
MessageEditor.MessageType.INFO,
|
||||
"commands.moderation.role.add.success.title",
|
||||
"✅",
|
||||
"",
|
||||
"commands.moderation.role.add.success.description",
|
||||
String.valueOf(event.getMessage().getMentionedRoles().size()),
|
||||
String.valueOf(event.getMessage().getMentionedMembers().size()))
|
||||
.build()).queue();
|
||||
}
|
||||
break;
|
||||
|
||||
case "remove":
|
||||
if (event.getMessage().getMentionedMembers().size() > 0 && event.getMessage().getMentionedRoles().size() > 0) {
|
||||
for (Member member : event.getMessage().getMentionedMembers()) {
|
||||
for (Role role : event.getMessage().getMentionedRoles()) {
|
||||
if (event.getGuild().getSelfMember().canInteract(member)) {
|
||||
if (event.getGuild().getSelfMember().canInteract(role)) {
|
||||
event.getGuild().removeRoleFromMember(member, role).reason("Role removed by " + event.getAuthor().getAsTag()).queue();
|
||||
} else {
|
||||
event.getTextChannel().sendMessage(event.getMessageEditor().getMessage(MessageEditor.MessageType.NO_SELF_PERMISSION).build()).queue();
|
||||
}
|
||||
} else {
|
||||
event.getTextChannel().sendMessage(event.getMessageEditor().getMessage(MessageEditor.MessageType.NO_SELF_PERMISSION).build()).queue();
|
||||
}
|
||||
}
|
||||
}
|
||||
event.getChannel().sendMessage(
|
||||
event.getMessageEditor().getMessage(
|
||||
MessageEditor.MessageType.INFO,
|
||||
"commands.moderation.role.remove.success.title",
|
||||
"✅",
|
||||
"",
|
||||
"commands.moderation.role.remove.success.description",
|
||||
String.valueOf(event.getMessage().getMentionedRoles().size()),
|
||||
String.valueOf(event.getMessage().getMentionedMembers().size()))
|
||||
.build()).queue();
|
||||
}
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
event.getTextChannel().sendMessage(event.getMessageEditor().getMessage(MessageEditor.MessageType.NO_SELF_PERMISSION).build()).queue();
|
||||
}
|
||||
} else {
|
||||
event.getHelpCommand().sendHelp(this, event);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] labels() {
|
||||
return new String[]{"role", "roles"};
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "commands.moderation.role.help.description";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String usage() {
|
||||
return "add/remove <@role> <@user>";
|
||||
}
|
||||
}
|
||||
|
|
@ -1,233 +0,0 @@
|
|||
package com.bbn.hadder.commands.moderation;
|
||||
|
||||
/*
|
||||
* @author Skidder / GregTCLTK
|
||||
*/
|
||||
|
||||
import com.bbn.hadder.commands.Command;
|
||||
import com.bbn.hadder.commands.CommandEvent;
|
||||
import com.bbn.hadder.core.Perm;
|
||||
import com.bbn.hadder.core.Perms;
|
||||
import com.bbn.hadder.utils.EventWaiter;
|
||||
import com.bbn.hadder.utils.MessageEditor;
|
||||
import net.dv8tion.jda.api.Permission;
|
||||
import net.dv8tion.jda.api.entities.Emote;
|
||||
import net.dv8tion.jda.api.entities.Message;
|
||||
import net.dv8tion.jda.api.entities.Role;
|
||||
import net.dv8tion.jda.api.entities.TextChannel;
|
||||
import net.dv8tion.jda.api.events.message.guild.GuildMessageReceivedEvent;
|
||||
|
||||
@Perms(Perm.MANAGE_SERVER)
|
||||
public class RulesCommand implements Command {
|
||||
|
||||
@Override
|
||||
public void executed(String[] args, CommandEvent event) {
|
||||
if (event.getGuild().getSelfMember().hasPermission(Permission.MANAGE_ROLES)) {
|
||||
event.getTextChannel().sendMessage(
|
||||
event.getMessageEditor().getMessage(
|
||||
MessageEditor.MessageType.INFO,
|
||||
"commands.moderation.rules.setup.title",
|
||||
"commands.moderation.rules.setup.description")
|
||||
.build()).queue();
|
||||
new EventWaiter().newOnMessageEventWaiter(event1 -> {
|
||||
if (event1.getMessage().getMentionedChannels().size() == 1) {
|
||||
try {
|
||||
TextChannel channel = event1.getMessage().getMentionedChannels().get(0);
|
||||
createRules(event, event1, channel);
|
||||
} catch (Exception e) {
|
||||
event.getTextChannel().sendMessage(event.getMessageEditor().getMessage(MessageEditor.MessageType.ERROR,
|
||||
"commands.moderation.rules.channel.error.title",
|
||||
"commands.moderation.rules.channel.error.description")
|
||||
.build()).queue();
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
TextChannel channel = event1.getGuild().getTextChannelsByName(event1.getMessage().getContentRaw(), true).get(0);
|
||||
createRules(event, event1, channel);
|
||||
} catch (Exception e) {
|
||||
event.getTextChannel().sendMessage(
|
||||
event.getMessageEditor().getMessage(
|
||||
MessageEditor.MessageType.ERROR,
|
||||
"commands.moderation.rules.channel.error.title",
|
||||
"commands.moderation.rules.channel.error.description")
|
||||
.build()).queue();
|
||||
}
|
||||
}
|
||||
}, event.getJDA(), event.getAuthor());
|
||||
} else {
|
||||
event.getTextChannel().sendMessage(event.getMessageEditor().getMessage(MessageEditor.MessageType.NO_SELF_PERMISSION).build()).queue();
|
||||
}
|
||||
}
|
||||
|
||||
public void createRules(CommandEvent event, GuildMessageReceivedEvent event1, TextChannel channel) {
|
||||
if (channel.getGuild().getId().equals(event1.getGuild().getId())) {
|
||||
if (event.getGuild().getSelfMember().hasPermission(channel, Permission.MESSAGE_WRITE)) {
|
||||
event1.getChannel().sendMessage(
|
||||
event.getMessageEditor().getMessage(
|
||||
MessageEditor.MessageType.INFO,
|
||||
"commands.moderation.rules.rules.title",
|
||||
"",
|
||||
"commands.moderation.rules.rules.description",
|
||||
channel.getName())
|
||||
.build()).queue();
|
||||
new EventWaiter().newOnMessageEventWaiter(event2 -> {
|
||||
String message = event2.getMessage().getContentRaw();
|
||||
event2.getChannel().sendMessage(
|
||||
event.getMessageEditor().getMessage(
|
||||
MessageEditor.MessageType.INFO,
|
||||
"commands.moderation.rules.role.title",
|
||||
"commands.moderation.rules.role.description")
|
||||
.build()).queue();
|
||||
new EventWaiter().newOnMessageEventWaiter(event3 -> {
|
||||
if (event3.getMessage().getMentionedRoles().size() == 1) {
|
||||
Role role = event3.getMessage().getMentionedRoles().get(0);
|
||||
setRole(event, channel, message, event3, role);
|
||||
} else if (event3.getGuild().getRolesByName(event3.getMessage().getContentStripped(), true).size() > 0) {
|
||||
Role role = event3.getGuild().getRolesByName(event3.getMessage().getContentStripped(), true).get(0);
|
||||
setRole(event, channel, message, event3, role);
|
||||
} else {
|
||||
event3.getChannel().sendMessage(
|
||||
event.getMessageEditor().getMessage(
|
||||
MessageEditor.MessageType.WARNING,
|
||||
"commands.moderation.rules.role.error.title",
|
||||
"commands.moderation.rules.role.error.description")
|
||||
.build()).queue();
|
||||
}
|
||||
}, event.getJDA(), event.getAuthor());
|
||||
}, event.getJDA(), event.getAuthor());
|
||||
} else {
|
||||
event.getTextChannel().sendMessage(event.getMessageEditor().getMessage(MessageEditor.MessageType.NO_PERMISSION)
|
||||
.build()).queue();
|
||||
}
|
||||
} else {
|
||||
event.getTextChannel().sendMessage(
|
||||
event.getMessageEditor().getMessage(
|
||||
MessageEditor.MessageType.WARNING,
|
||||
"commands.moderation.rules.guild.error.title",
|
||||
"commands.moderation.rules.guild.error.description")
|
||||
.build()).queue();
|
||||
}
|
||||
}
|
||||
|
||||
public void setRole(CommandEvent event, TextChannel channel, String message, GuildMessageReceivedEvent event3, Role role) {
|
||||
if (event3.getGuild().getSelfMember().canInteract(role)) {
|
||||
event3.getChannel().sendMessage(
|
||||
event.getMessageEditor().getMessage(
|
||||
MessageEditor.MessageType.INFO,
|
||||
"commands.moderation.rules.emote.accept.title",
|
||||
"",
|
||||
"commands.moderation.rules.emote.accept.description", role.getName())
|
||||
.build()).queue();
|
||||
new EventWaiter().newOnMessageEventWaiter(event4 -> {
|
||||
if (event4.getMessage().getEmotes().size() == 1) {
|
||||
Emote aemote = event4.getMessage().getEmotes().get(0);
|
||||
event4.getChannel().sendMessage(
|
||||
event.getMessageEditor().getMessage(
|
||||
MessageEditor.MessageType.INFO,
|
||||
"commands.moderation.rules.emote.decline.title", "",
|
||||
"commands.moderation.rules.emote.decline.title", String.valueOf(aemote))
|
||||
.build()).queue();
|
||||
new EventWaiter().newOnMessageEventWaiter(event5 -> {
|
||||
Emote demote = event5.getMessage().getEmotes().get(0);
|
||||
if (!aemote.equals(demote)) {
|
||||
Message rules = channel.sendMessage(event.getMessageEditor().getMessage(MessageEditor.MessageType.INFO)
|
||||
.setTitle("Rules")
|
||||
.setDescription(message)
|
||||
.build()).complete();
|
||||
try {
|
||||
rules.addReaction(aemote).queue();
|
||||
rules.addReaction(demote).queue();
|
||||
event5.getChannel().sendMessage(
|
||||
event.getMessageEditor().getMessage(
|
||||
MessageEditor.MessageType.INFO,
|
||||
"commands.moderation.rules.success.title",
|
||||
"",
|
||||
"commands.moderation.rules.success.description",
|
||||
channel.getAsMention())
|
||||
.build()).queue();
|
||||
} catch (Exception e) {
|
||||
event5.getChannel().sendMessage(
|
||||
event.getMessageEditor().getMessage(
|
||||
MessageEditor.MessageType.ERROR,
|
||||
"error",
|
||||
"commands.moderation.rules.emote.error.access.description")
|
||||
.build()).queue();
|
||||
e.printStackTrace();
|
||||
}
|
||||
event.getRethink().updateRules(event.getGuild().getId(), rules.getId(), role.getId(), aemote.toString(), demote.toString());
|
||||
} else {
|
||||
event.getTextChannel().sendMessage(
|
||||
event.getMessageEditor().getMessage(
|
||||
MessageEditor.MessageType.WARNING,
|
||||
"commands.moderation.rules.emote.error.equal.title",
|
||||
"commands.moderation.rules.emote.error.equal.description")
|
||||
.build()).queue();
|
||||
}
|
||||
}, event.getJDA(), event.getAuthor());
|
||||
} else {
|
||||
String aemote = event4.getMessage().getContentRaw();
|
||||
event4.getChannel().sendMessage(
|
||||
event.getMessageEditor().getMessage(
|
||||
MessageEditor.MessageType.INFO,
|
||||
"commands.moderation.rules.emote.decline.title",
|
||||
"commands.moderation.rules.emoji.decline.description")
|
||||
.build()).queue();
|
||||
new EventWaiter().newOnMessageEventWaiter(event5 -> {
|
||||
String demote = event5.getMessage().getContentRaw();
|
||||
if (!aemote.equals(demote)) {
|
||||
Message rules = channel.sendMessage(event.getMessageEditor().getMessage(MessageEditor.MessageType.INFO)
|
||||
.setTitle("Rules")
|
||||
.setDescription(message)
|
||||
.build()).complete();
|
||||
try {
|
||||
rules.addReaction(aemote).queue();
|
||||
rules.addReaction(demote).queue();
|
||||
event5.getChannel().sendMessage(
|
||||
event.getMessageEditor().getMessage(
|
||||
MessageEditor.MessageType.INFO,
|
||||
"commands.moderation.rules.success.title",
|
||||
"",
|
||||
"commands.moderation.rules.success.description",
|
||||
channel.getAsMention())
|
||||
.build()).queue();
|
||||
} catch (Exception e) {
|
||||
event5.getChannel().sendMessage(
|
||||
event.getMessageEditor().getMessage(
|
||||
MessageEditor.MessageType.ERROR,
|
||||
"error",
|
||||
"commands.moderation.rules.emoji.error.description")
|
||||
.build()).queue();
|
||||
e.printStackTrace();
|
||||
}
|
||||
event.getRethink().updateRules(event.getGuild().getId(), rules.getId(), role.getId(), aemote, demote);
|
||||
} else {
|
||||
event.getTextChannel().sendMessage(
|
||||
event.getMessageEditor().getMessage(
|
||||
MessageEditor.MessageType.WARNING,
|
||||
"commands.moderation.rules.emote.error.equal.title",
|
||||
"commands.moderation.rules.emote.error.equal.description")
|
||||
.build()).queue();
|
||||
}
|
||||
}, event.getJDA(), event.getAuthor());
|
||||
}
|
||||
}, event.getJDA(), event.getAuthor());
|
||||
} else {
|
||||
event.getTextChannel().sendMessage(event.getMessageEditor().getMessage(MessageEditor.MessageType.NO_SELF_PERMISSION).build()).queue();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] labels() {
|
||||
return new String[]{"rules", "rule", "setup"};
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "commands.moderation.rules.help.description";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String usage() {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
|
@ -1,50 +0,0 @@
|
|||
package com.bbn.hadder.commands.moderation;
|
||||
|
||||
import com.bbn.hadder.commands.Command;
|
||||
import com.bbn.hadder.commands.CommandEvent;
|
||||
import com.bbn.hadder.utils.MessageEditor;
|
||||
import net.dv8tion.jda.api.entities.TextChannel;
|
||||
|
||||
public class StarBoardCommand implements Command {
|
||||
|
||||
@Override
|
||||
public void executed(String[] args, CommandEvent event) {
|
||||
if (event.getMessage().getMentionedChannels().size()==1) {
|
||||
event.getRethink().setStarboardChannel(event.getGuild().getId(), event.getMessage().getMentionedChannels().get(0).getId());
|
||||
event.getChannel().sendMessage(
|
||||
event.getMessageEditor().getMessage(
|
||||
MessageEditor.MessageType.INFO,
|
||||
"commands.moderation.starboard.successchannel","")
|
||||
.build())
|
||||
.queue();
|
||||
} else {
|
||||
if (args.length>0) {
|
||||
TextChannel channel = event.getGuild().getTextChannelById(args[0]);
|
||||
if (channel!=null) {
|
||||
event.getRethink().setStarboardChannel(event.getGuild().getId(), channel.getId());
|
||||
}
|
||||
} else {
|
||||
event.getHelpCommand().sendHelp(this, event);
|
||||
}
|
||||
}
|
||||
|
||||
if (args.length==2) {
|
||||
event.getRethink().setNeededstars(args[1], event.getGuild().getId());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] labels() {
|
||||
return new String[]{"starboard"};
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "Sets the starboard channel";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String usage() {
|
||||
return "<Channel id or channel mention> [Needed stars]";
|
||||
}
|
||||
}
|
||||
|
|
@ -1,81 +0,0 @@
|
|||
package com.bbn.hadder.commands.music;
|
||||
|
||||
/*
|
||||
* @author Skidder / GregTCLTK
|
||||
*/
|
||||
|
||||
import com.bbn.hadder.commands.Command;
|
||||
import com.bbn.hadder.commands.CommandEvent;
|
||||
import com.bbn.hadder.utils.MessageEditor;
|
||||
import net.dv8tion.jda.api.entities.VoiceChannel;
|
||||
import net.dv8tion.jda.api.managers.AudioManager;
|
||||
|
||||
|
||||
public class JoinCommand implements Command {
|
||||
|
||||
@Override
|
||||
public void executed(String[] args, CommandEvent event) {
|
||||
if (event.getMember().getVoiceState().inVoiceChannel()) {
|
||||
AudioManager audioManager = event.getGuild().getAudioManager();
|
||||
if(!audioManager.isAttemptingToConnect()) {
|
||||
VoiceChannel vc = event.getMember().getVoiceState().getChannel();
|
||||
if (event.getGuild().getSelfMember().getVoiceState().inVoiceChannel()) {
|
||||
if (!event.getGuild().getSelfMember().getVoiceState().getChannel().getId().equals(vc.getId())) {
|
||||
event.getGuild().getAudioManager().openAudioConnection(vc);
|
||||
event.getTextChannel().sendMessage(
|
||||
event.getMessageEditor().getMessage(
|
||||
MessageEditor.MessageType.INFO,
|
||||
"commands.music.join.success.title",
|
||||
"",
|
||||
"commands.music.join.success.description",
|
||||
vc.getName())
|
||||
.build()).queue();
|
||||
} else {
|
||||
event.getTextChannel().sendMessage(
|
||||
event.getMessageEditor().getMessage(
|
||||
MessageEditor.MessageType.WARNING,
|
||||
"commands.music.join.error.connecting.already.title",
|
||||
"commands.music.join.error.connecting.already.description")
|
||||
.build()).queue();
|
||||
}
|
||||
} else {
|
||||
event.getGuild().getAudioManager().openAudioConnection(vc);
|
||||
event.getTextChannel().sendMessage(event.getMessageEditor().getMessage(
|
||||
MessageEditor.MessageType.INFO,
|
||||
"commands.music.join.success.title",
|
||||
"",
|
||||
"commands.music.join.success.description",
|
||||
vc.getName())
|
||||
.build()).queue();
|
||||
}
|
||||
} else {
|
||||
event.getTextChannel().sendMessage(event.getMessageEditor().getMessage(
|
||||
MessageEditor.MessageType.WARNING,
|
||||
"commands.music.join.error.connecting.trying.title",
|
||||
"commands.music.join.error.connecting.trying.description")
|
||||
.build()).queue();
|
||||
}
|
||||
} else {
|
||||
event.getTextChannel().sendMessage(event.getMessageEditor().getMessage(
|
||||
MessageEditor.MessageType.WARNING,
|
||||
"commands.music.join.error.channel.title",
|
||||
"commands.music.join.error.channel.description")
|
||||
.build()).queue();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] labels() {
|
||||
return new String[]{"join"};
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "commands.music.join.help.description";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String usage() {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
|
@ -1,45 +0,0 @@
|
|||
package com.bbn.hadder.commands.music;
|
||||
|
||||
/*
|
||||
* @author Skidder / GregTCLTK
|
||||
*/
|
||||
|
||||
import com.bbn.hadder.commands.Command;
|
||||
import com.bbn.hadder.commands.CommandEvent;
|
||||
import com.bbn.hadder.utils.MessageEditor;
|
||||
|
||||
public class LeaveCommand implements Command {
|
||||
|
||||
@Override
|
||||
public void executed(String[] args, CommandEvent event) {
|
||||
if (event.getGuild().getSelfMember().getVoiceState().inVoiceChannel()) {
|
||||
event.getGuild().getAudioManager().closeAudioConnection();
|
||||
event.getTextChannel().sendMessage(event.getMessageEditor().getMessage(
|
||||
MessageEditor.MessageType.INFO,
|
||||
"commands.music.leave.success.title",
|
||||
"commands.music.leave.success.description")
|
||||
.build()).queue();
|
||||
} else {
|
||||
event.getTextChannel().sendMessage(event.getMessageEditor().getMessage(
|
||||
MessageEditor.MessageType.WARNING,
|
||||
"commands.music.leave.error.tile",
|
||||
"commands.music.leave.error.description")
|
||||
.build()).queue();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] labels() {
|
||||
return new String[]{"leave"};
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "commands.music.leave.help.description";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String usage() {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
|
@ -1,63 +0,0 @@
|
|||
package com.bbn.hadder.commands.nsfw;
|
||||
|
||||
/*
|
||||
* @author Skidder / GregTCLTK
|
||||
*/
|
||||
|
||||
import com.bbn.hadder.commands.Command;
|
||||
import com.bbn.hadder.commands.CommandEvent;
|
||||
import com.bbn.hadder.utils.MessageEditor;
|
||||
import okhttp3.OkHttpClient;
|
||||
import okhttp3.Request;
|
||||
import okhttp3.Response;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class AnalCommand implements Command {
|
||||
|
||||
@Override
|
||||
public void executed(String[] args, CommandEvent event) {
|
||||
if (event.getTextChannel().isNSFW()) {
|
||||
|
||||
OkHttpClient caller = new OkHttpClient();
|
||||
Request request = new Request.Builder().url("https://api.nekos.dev/api/v3/images/nsfw/gif/anal/").build();
|
||||
|
||||
try {
|
||||
|
||||
Response response = caller.newCall(request).execute();
|
||||
JSONObject json = new JSONObject(response.body().string());
|
||||
JSONObject data = json.getJSONObject("data");
|
||||
JSONObject response1 = data.getJSONObject("response");
|
||||
String url = response1.toString().replace("{\"url\":\"", "");
|
||||
|
||||
event.getTextChannel().sendMessage(event.getMessageEditor().getMessage(MessageEditor.MessageType.INFO)
|
||||
.setAuthor(event.getMessageEditor().getTerm("commands.nsfw.gif.error.title"), url.replace("\"}", ""))
|
||||
.setImage(url.replace("\"}", ""))
|
||||
.setFooter("Anal")
|
||||
.build()).queue();
|
||||
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
} else {
|
||||
event.getTextChannel().sendMessage(event.getMessageEditor().getMessage(MessageEditor.MessageType.NO_NSFW).build()).queue();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] labels() {
|
||||
return new String[]{"anal"};
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "commands.nsfw.anal.help.description";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String usage() {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
|
@ -1,63 +0,0 @@
|
|||
package com.bbn.hadder.commands.nsfw;
|
||||
|
||||
/*
|
||||
* @author Skidder / GregTCLTK
|
||||
*/
|
||||
|
||||
import com.bbn.hadder.commands.Command;
|
||||
import com.bbn.hadder.commands.CommandEvent;
|
||||
import com.bbn.hadder.utils.MessageEditor;
|
||||
import okhttp3.OkHttpClient;
|
||||
import okhttp3.Request;
|
||||
import okhttp3.Response;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class BDSMCommand implements Command {
|
||||
|
||||
@Override
|
||||
public void executed(String[] args, CommandEvent event) {
|
||||
if (event.getTextChannel().isNSFW()) {
|
||||
|
||||
OkHttpClient caller = new OkHttpClient();
|
||||
Request request = new Request.Builder().url("https://api.nekos.dev/api/v3/images/nsfw/img/bdsm_lewd").build();
|
||||
|
||||
try {
|
||||
|
||||
Response response = caller.newCall(request).execute();
|
||||
JSONObject json = new JSONObject(response.body().string());
|
||||
JSONObject data = json.getJSONObject("data");
|
||||
JSONObject response1 = data.getJSONObject("response");
|
||||
String url = response1.toString().replace("{\"url\":\"", "");
|
||||
|
||||
event.getTextChannel().sendMessage(event.getMessageEditor().getMessage(MessageEditor.MessageType.INFO)
|
||||
.setAuthor(event.getMessageEditor().getTerm("commands.nsfw.gif.error.title"), url.replace("\"}", ""))
|
||||
.setImage(url.replace("\"}", ""))
|
||||
.setFooter("BDSM")
|
||||
.build()).queue();
|
||||
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
} else {
|
||||
event.getTextChannel().sendMessage(event.getMessageEditor().getMessage(MessageEditor.MessageType.NO_NSFW).build()).queue();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] labels() {
|
||||
return new String[] { "bdsm" };
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "commands.nsfw.bdsm.help.description";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String usage() {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
|
@ -1,59 +0,0 @@
|
|||
package com.bbn.hadder.commands.nsfw;
|
||||
|
||||
/*
|
||||
* @author Skidder / GregTCLTK
|
||||
*/
|
||||
|
||||
import com.bbn.hadder.commands.Command;
|
||||
import com.bbn.hadder.commands.CommandEvent;
|
||||
import com.bbn.hadder.utils.MessageEditor;
|
||||
import okhttp3.OkHttpClient;
|
||||
import okhttp3.Request;
|
||||
import okhttp3.Response;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class BlowjobCommand implements Command {
|
||||
|
||||
@Override
|
||||
public void executed(String[] args, CommandEvent event) {
|
||||
if (event.getTextChannel().isNSFW()) {
|
||||
|
||||
OkHttpClient caller = new OkHttpClient();
|
||||
Request request = new Request.Builder().url("https://nekos.life/api/v2/img/blowjob").build();
|
||||
|
||||
try {
|
||||
|
||||
Response response = caller.newCall(request).execute();
|
||||
String url = response.body().string().replace("{\"url\":\"", "");
|
||||
|
||||
event.getTextChannel().sendMessage(event.getMessageEditor().getMessage(MessageEditor.MessageType.INFO)
|
||||
.setAuthor(event.getMessageEditor().getTerm("commands.nsfw.gif.error.title"), url.replace("\"}", ""))
|
||||
.setImage(url.replace("\"}", ""))
|
||||
.setFooter("Blowjob")
|
||||
.build()).queue();
|
||||
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
} else {
|
||||
event.getTextChannel().sendMessage(event.getMessageEditor().getMessage(MessageEditor.MessageType.NO_NSFW).build()).queue();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] labels() {
|
||||
return new String[]{"blowjob"};
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "commands.nsfw.blowjob.help.description";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String usage() {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
|
@ -1,63 +0,0 @@
|
|||
package com.bbn.hadder.commands.nsfw;
|
||||
|
||||
/*
|
||||
* @author Skidder / GregTCLTK
|
||||
*/
|
||||
|
||||
import com.bbn.hadder.commands.Command;
|
||||
import com.bbn.hadder.commands.CommandEvent;
|
||||
import com.bbn.hadder.utils.MessageEditor;
|
||||
import okhttp3.OkHttpClient;
|
||||
import okhttp3.Request;
|
||||
import okhttp3.Response;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class BoobsCommand implements Command {
|
||||
|
||||
@Override
|
||||
public void executed(String[] args, CommandEvent event) {
|
||||
if (event.getTextChannel().isNSFW()) {
|
||||
|
||||
OkHttpClient caller = new OkHttpClient();
|
||||
Request request = new Request.Builder().url("https://api.nekos.dev/api/v3/images/nsfw/gif/tits/").build();
|
||||
|
||||
try {
|
||||
|
||||
Response response = caller.newCall(request).execute();
|
||||
JSONObject json = new JSONObject(response.body().string());
|
||||
JSONObject data = json.getJSONObject("data");
|
||||
JSONObject response1 = data.getJSONObject("response");
|
||||
String url = response1.toString().replace("{\"url\":\"", "");
|
||||
|
||||
event.getTextChannel().sendMessage(event.getMessageEditor().getMessage(MessageEditor.MessageType.INFO)
|
||||
.setAuthor(event.getMessageEditor().getTerm("commands.nsfw.gif.error.title"), url.replace("\"}", ""))
|
||||
.setImage(url.replace("\"}", ""))
|
||||
.setFooter("Boobs")
|
||||
.build()).queue();
|
||||
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
} else {
|
||||
event.getTextChannel().sendMessage(event.getMessageEditor().getMessage(MessageEditor.MessageType.NO_NSFW).build()).queue();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] labels() {
|
||||
return new String[]{"boobs", "boob", "tits"};
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "commands.nsfw.boobs.help.description";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String usage() {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
|
@ -1,63 +0,0 @@
|
|||
package com.bbn.hadder.commands.nsfw;
|
||||
|
||||
/*
|
||||
* @author Skidder / GregTCLTK
|
||||
*/
|
||||
|
||||
import com.bbn.hadder.commands.Command;
|
||||
import com.bbn.hadder.commands.CommandEvent;
|
||||
import com.bbn.hadder.utils.MessageEditor;
|
||||
import okhttp3.OkHttpClient;
|
||||
import okhttp3.Request;
|
||||
import okhttp3.Response;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class CumCommand implements Command {
|
||||
|
||||
@Override
|
||||
public void executed(String[] args, CommandEvent event) {
|
||||
if (event.getTextChannel().isNSFW()) {
|
||||
|
||||
OkHttpClient caller = new OkHttpClient();
|
||||
Request request = new Request.Builder().url("https://api.nekos.dev/api/v3/images/nsfw/gif/cum/").build();
|
||||
|
||||
try {
|
||||
|
||||
Response response = caller.newCall(request).execute();
|
||||
JSONObject json = new JSONObject(response.body().string());
|
||||
JSONObject data = json.getJSONObject("data");
|
||||
JSONObject response1 = data.getJSONObject("response");
|
||||
String url = response1.toString().replace("{\"url\":\"", "");
|
||||
|
||||
event.getTextChannel().sendMessage(event.getMessageEditor().getMessage(MessageEditor.MessageType.INFO)
|
||||
.setAuthor(event.getMessageEditor().getTerm("commands.nsfw.gif.error.title"), url.replace("\"}", ""))
|
||||
.setImage(url.replace("\"}", ""))
|
||||
.setFooter("Cum")
|
||||
.build()).queue();
|
||||
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
} else {
|
||||
event.getTextChannel().sendMessage(event.getMessageEditor().getMessage(MessageEditor.MessageType.NO_NSFW).build()).queue();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] labels() {
|
||||
return new String[]{"cum"};
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "commands.nsfw.cum.help.description";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String usage() {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
|
@ -1,59 +0,0 @@
|
|||
package com.bbn.hadder.commands.nsfw;
|
||||
|
||||
/*
|
||||
* @author Skidder / GregTCLTK
|
||||
*/
|
||||
|
||||
import com.bbn.hadder.commands.Command;
|
||||
import com.bbn.hadder.commands.CommandEvent;
|
||||
import com.bbn.hadder.utils.MessageEditor;
|
||||
import okhttp3.OkHttpClient;
|
||||
import okhttp3.Request;
|
||||
import okhttp3.Response;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class EroticCommand implements Command {
|
||||
|
||||
@Override
|
||||
public void executed(String[] args, CommandEvent event) {
|
||||
if (event.getTextChannel().isNSFW()) {
|
||||
|
||||
OkHttpClient caller = new OkHttpClient();
|
||||
Request request = new Request.Builder().url("https://nekos.life/api/v2/img/erok").build();
|
||||
|
||||
try {
|
||||
|
||||
Response response = caller.newCall(request).execute();
|
||||
String url = response.body().string().replace("{\"url\":\"", "");
|
||||
|
||||
event.getTextChannel().sendMessage(event.getMessageEditor().getMessage(MessageEditor.MessageType.INFO)
|
||||
.setAuthor(event.getMessageEditor().getTerm("commands.nsfw.gif.error.title"), url.replace("\"}", ""))
|
||||
.setImage(url.replace("\"}", ""))
|
||||
.setFooter("Erotic")
|
||||
.build()).queue();
|
||||
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
} else {
|
||||
event.getTextChannel().sendMessage(event.getMessageEditor().getMessage(MessageEditor.MessageType.NO_NSFW).build()).queue();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] labels() {
|
||||
return new String[]{"erotic"};
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "commands.nsfw.erotic.help.description";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String usage() {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
|
@ -1,63 +0,0 @@
|
|||
package com.bbn.hadder.commands.nsfw;
|
||||
|
||||
/*
|
||||
* @author Skidder / GregTCLTK
|
||||
*/
|
||||
|
||||
import com.bbn.hadder.commands.Command;
|
||||
import com.bbn.hadder.commands.CommandEvent;
|
||||
import com.bbn.hadder.utils.MessageEditor;
|
||||
import okhttp3.OkHttpClient;
|
||||
import okhttp3.Request;
|
||||
import okhttp3.Response;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class FeetCommand implements Command {
|
||||
|
||||
@Override
|
||||
public void executed(String[] args, CommandEvent event) {
|
||||
if (event.getTextChannel().isNSFW()) {
|
||||
|
||||
OkHttpClient caller = new OkHttpClient();
|
||||
Request request = new Request.Builder().url("https://api.nekos.dev/api/v3/images/nsfw/gif/feet/").build();
|
||||
|
||||
try {
|
||||
|
||||
Response response = caller.newCall(request).execute();
|
||||
JSONObject json = new JSONObject(response.body().string());
|
||||
JSONObject data = json.getJSONObject("data");
|
||||
JSONObject response1 = data.getJSONObject("response");
|
||||
String url = response1.toString().replace("{\"url\":\"", "");
|
||||
|
||||
event.getTextChannel().sendMessage(event.getMessageEditor().getMessage(MessageEditor.MessageType.INFO)
|
||||
.setAuthor(event.getMessageEditor().getTerm("commands.nsfw.gif.error.title"), url.replace("\"}", ""))
|
||||
.setImage(url.replace("\"}", ""))
|
||||
.setFooter("Feet")
|
||||
.build()).queue();
|
||||
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
} else {
|
||||
event.getTextChannel().sendMessage(event.getMessageEditor().getMessage(MessageEditor.MessageType.NO_NSFW).build()).queue();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] labels() {
|
||||
return new String[]{"feet"};
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "commands.nsfw.feet.help.description";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String usage() {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
|
@ -1,63 +0,0 @@
|
|||
package com.bbn.hadder.commands.nsfw;
|
||||
|
||||
/*
|
||||
* @author Skidder / GregTCLTK
|
||||
*/
|
||||
|
||||
import com.bbn.hadder.commands.Command;
|
||||
import com.bbn.hadder.commands.CommandEvent;
|
||||
import com.bbn.hadder.utils.MessageEditor;
|
||||
import okhttp3.OkHttpClient;
|
||||
import okhttp3.Request;
|
||||
import okhttp3.Response;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class FingeringCommand implements Command {
|
||||
|
||||
@Override
|
||||
public void executed(String[] args, CommandEvent event) {
|
||||
if (event.getTextChannel().isNSFW()) {
|
||||
|
||||
OkHttpClient caller = new OkHttpClient();
|
||||
Request request = new Request.Builder().url("https://api.nekos.dev/api/v3/images/nsfw/gif/pussy_wank/").build();
|
||||
|
||||
try {
|
||||
|
||||
Response response = caller.newCall(request).execute();
|
||||
JSONObject json = new JSONObject(response.body().string());
|
||||
JSONObject data = json.getJSONObject("data");
|
||||
JSONObject response1 = data.getJSONObject("response");
|
||||
String url = response1.toString().replace("{\"url\":\"", "");
|
||||
|
||||
event.getTextChannel().sendMessage(event.getMessageEditor().getMessage(MessageEditor.MessageType.INFO)
|
||||
.setAuthor(event.getMessageEditor().getTerm("commands.nsfw.gif.error.title"), url.replace("\"}", ""))
|
||||
.setImage(url.replace("\"}", ""))
|
||||
.setFooter("Fingering")
|
||||
.build()).queue();
|
||||
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
} else {
|
||||
event.getTextChannel().sendMessage(event.getMessageEditor().getMessage(MessageEditor.MessageType.NO_NSFW).build()).queue();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] labels() {
|
||||
return new String[]{"fingering"};
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "commands.nsfw.fingering.help.description";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String usage() {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
|
@ -1,63 +0,0 @@
|
|||
package com.bbn.hadder.commands.nsfw;
|
||||
|
||||
/*
|
||||
* @author Skidder / GregTCLTK
|
||||
*/
|
||||
|
||||
import com.bbn.hadder.commands.Command;
|
||||
import com.bbn.hadder.commands.CommandEvent;
|
||||
import com.bbn.hadder.utils.MessageEditor;
|
||||
import okhttp3.OkHttpClient;
|
||||
import okhttp3.Request;
|
||||
import okhttp3.Response;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class LickingCommand implements Command {
|
||||
|
||||
@Override
|
||||
public void executed(String[] args, CommandEvent event) {
|
||||
if (event.getTextChannel().isNSFW()) {
|
||||
|
||||
OkHttpClient caller = new OkHttpClient();
|
||||
Request request = new Request.Builder().url("https://api.nekos.dev/api/v3/images/nsfw/gif/kuni/").build();
|
||||
|
||||
try {
|
||||
|
||||
Response response = caller.newCall(request).execute();
|
||||
JSONObject json = new JSONObject(response.body().string());
|
||||
JSONObject data = json.getJSONObject("data");
|
||||
JSONObject response1 = data.getJSONObject("response");
|
||||
String url = response1.toString().replace("{\"url\":\"", "");
|
||||
|
||||
event.getTextChannel().sendMessage(event.getMessageEditor().getMessage(MessageEditor.MessageType.INFO)
|
||||
.setAuthor(event.getMessageEditor().getTerm("commands.nsfw.gif.error.title"), url.replace("\"}", ""))
|
||||
.setImage(url.replace("\"}", ""))
|
||||
.setFooter("Licking")
|
||||
.build()).queue();
|
||||
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
} else {
|
||||
event.getTextChannel().sendMessage(event.getMessageEditor().getMessage(MessageEditor.MessageType.NO_NSFW).build()).queue();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] labels() {
|
||||
return new String[]{"licking"};
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "commands.nsfw.linking.help.description";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String usage() {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
|
@ -1,63 +0,0 @@
|
|||
package com.bbn.hadder.commands.nsfw;
|
||||
|
||||
/*
|
||||
* @author Skidder / GregTCLTK
|
||||
*/
|
||||
|
||||
import com.bbn.hadder.commands.Command;
|
||||
import com.bbn.hadder.commands.CommandEvent;
|
||||
import com.bbn.hadder.utils.MessageEditor;
|
||||
import okhttp3.OkHttpClient;
|
||||
import okhttp3.Request;
|
||||
import okhttp3.Response;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class PornCommand implements Command {
|
||||
|
||||
@Override
|
||||
public void executed(String[] args, CommandEvent event) {
|
||||
if (event.getTextChannel().isNSFW()) {
|
||||
|
||||
OkHttpClient caller = new OkHttpClient();
|
||||
Request request = new Request.Builder().url("https://api.nekos.dev/api/v3/images/nsfw/gif/classic/").build();
|
||||
|
||||
try {
|
||||
|
||||
Response response = caller.newCall(request).execute();
|
||||
JSONObject json = new JSONObject(response.body().string());
|
||||
JSONObject data = json.getJSONObject("data");
|
||||
JSONObject response1 = data.getJSONObject("response");
|
||||
String url = response1.toString().replace("{\"url\":\"", "");
|
||||
|
||||
event.getTextChannel().sendMessage(event.getMessageEditor().getMessage(MessageEditor.MessageType.INFO)
|
||||
.setAuthor(event.getMessageEditor().getTerm("commands.nsfw.gif.error.title"), url.replace("\"}", ""))
|
||||
.setImage(url.replace("\"}", ""))
|
||||
.setFooter("Porn")
|
||||
.build()).queue();
|
||||
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
} else {
|
||||
event.getTextChannel().sendMessage(event.getMessageEditor().getMessage(MessageEditor.MessageType.NO_NSFW).build()).queue();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] labels() {
|
||||
return new String[]{"porn"};
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "commands.nsfw.porn.help.description";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String usage() {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
|
@ -1,59 +0,0 @@
|
|||
package com.bbn.hadder.commands.nsfw;
|
||||
|
||||
/*
|
||||
* @author Skidder / GregTCLTK
|
||||
*/
|
||||
|
||||
import com.bbn.hadder.commands.Command;
|
||||
import com.bbn.hadder.commands.CommandEvent;
|
||||
import com.bbn.hadder.utils.MessageEditor;
|
||||
import okhttp3.OkHttpClient;
|
||||
import okhttp3.Request;
|
||||
import okhttp3.Response;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class PussyCommand implements Command {
|
||||
|
||||
@Override
|
||||
public void executed(String[] args, CommandEvent event) {
|
||||
if (event.getTextChannel().isNSFW()) {
|
||||
|
||||
OkHttpClient caller = new OkHttpClient();
|
||||
Request request = new Request.Builder().url("https://nekos.life/api/v2/img/pussy").build();
|
||||
|
||||
try {
|
||||
|
||||
Response response = caller.newCall(request).execute();
|
||||
String url = response.body().string().replace("{\"url\":\"", "");
|
||||
|
||||
event.getTextChannel().sendMessage(event.getMessageEditor().getMessage(MessageEditor.MessageType.INFO)
|
||||
.setAuthor(event.getMessageEditor().getTerm("commands.nsfw.gif.error.title"), url.replace("\"}", ""))
|
||||
.setImage(url.replace("\"}", ""))
|
||||
.setFooter("Pussy")
|
||||
.build()).queue();
|
||||
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
} else {
|
||||
event.getTextChannel().sendMessage(event.getMessageEditor().getMessage(MessageEditor.MessageType.NO_NSFW).build()).queue();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] labels() {
|
||||
return new String[]{"pussy"};
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "commands.nsfw.pussy.help.description";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String usage() {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
|
@ -1,67 +0,0 @@
|
|||
package com.bbn.hadder.commands.nsfw;
|
||||
|
||||
/*
|
||||
* @author Skidder / GregTCLTK
|
||||
*/
|
||||
|
||||
import com.bbn.hadder.commands.Command;
|
||||
import com.bbn.hadder.commands.CommandEvent;
|
||||
import com.bbn.hadder.utils.MessageEditor;
|
||||
import okhttp3.OkHttpClient;
|
||||
import okhttp3.Request;
|
||||
import okhttp3.Response;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class RandomPornCommand implements Command {
|
||||
|
||||
@Override
|
||||
public void executed(String[] args, CommandEvent event) {
|
||||
if (event.getTextChannel().isNSFW()) {
|
||||
|
||||
OkHttpClient caller = new OkHttpClient();
|
||||
Request request = new Request.Builder().url("https://api.nekos.dev/api/v3/images/nsfw/gif/all_tags/")
|
||||
.build();
|
||||
|
||||
try {
|
||||
|
||||
Response response = caller.newCall(request).execute();
|
||||
JSONObject json = new JSONObject(response.body().string());
|
||||
JSONObject data = json.getJSONObject("data");
|
||||
JSONObject response1 = data.getJSONObject("response");
|
||||
String url = response1.toString().replace("{\"url\":\"", "");
|
||||
|
||||
event.getTextChannel()
|
||||
.sendMessage(event.getMessageEditor().getMessage(MessageEditor.MessageType.INFO)
|
||||
.setAuthor(event.getMessageEditor().getTerm("commands.nsfw.gif.error.title"),
|
||||
url.replace("\"}", ""))
|
||||
.setImage(url.replace("\"}", "")).setFooter("Random Porn").build())
|
||||
.queue();
|
||||
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
} else {
|
||||
event.getTextChannel()
|
||||
.sendMessage(event.getMessageEditor().getMessage(MessageEditor.MessageType.NO_NSFW).build())
|
||||
.queue();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] labels() {
|
||||
return new String[] { "randomporn", "pornrandom" };
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "commands.nsfw.randomporn.help.description";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String usage() {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
|
@ -1,63 +0,0 @@
|
|||
package com.bbn.hadder.commands.nsfw;
|
||||
|
||||
/*
|
||||
* @author Skidder / GregTCLTK
|
||||
*/
|
||||
|
||||
import com.bbn.hadder.commands.Command;
|
||||
import com.bbn.hadder.commands.CommandEvent;
|
||||
import com.bbn.hadder.utils.MessageEditor;
|
||||
import okhttp3.OkHttpClient;
|
||||
import okhttp3.Request;
|
||||
import okhttp3.Response;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class SoloCommand implements Command {
|
||||
|
||||
@Override
|
||||
public void executed(String[] args, CommandEvent event) {
|
||||
if (event.getTextChannel().isNSFW()) {
|
||||
|
||||
OkHttpClient caller = new OkHttpClient();
|
||||
Request request = new Request.Builder().url("https://api.nekos.dev/api/v3/images/nsfw/gif/girls_solo/").build();
|
||||
|
||||
try {
|
||||
|
||||
Response response = caller.newCall(request).execute();
|
||||
JSONObject json = new JSONObject(response.body().string());
|
||||
JSONObject data = json.getJSONObject("data");
|
||||
JSONObject response1 = data.getJSONObject("response");
|
||||
String url = response1.toString().replace("{\"url\":\"", "");
|
||||
|
||||
event.getTextChannel().sendMessage(event.getMessageEditor().getMessage(MessageEditor.MessageType.INFO)
|
||||
.setAuthor(event.getMessageEditor().getTerm("commands.nsfw.gif.error.title"), url.replace("\"}", ""))
|
||||
.setImage(url.replace("\"}", ""))
|
||||
.setFooter("Solo")
|
||||
.build()).queue();
|
||||
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
} else {
|
||||
event.getTextChannel().sendMessage(event.getMessageEditor().getMessage(MessageEditor.MessageType.NO_NSFW).build()).queue();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] labels() {
|
||||
return new String[]{"solo"};
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "commands.nsfw.solo.help.description";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String usage() {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
|
@ -1,64 +0,0 @@
|
|||
package com.bbn.hadder.commands.nsfw;
|
||||
|
||||
/*
|
||||
* @author Skidder / GregTCLTK
|
||||
*/
|
||||
|
||||
import com.bbn.hadder.commands.Command;
|
||||
import com.bbn.hadder.commands.CommandEvent;
|
||||
import com.bbn.hadder.utils.MessageEditor;
|
||||
import okhttp3.OkHttpClient;
|
||||
import okhttp3.Request;
|
||||
import okhttp3.Response;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class SpankCommand implements Command {
|
||||
|
||||
@Override
|
||||
public void executed(String[] args, CommandEvent event) {
|
||||
if (event.getTextChannel().isNSFW()) {
|
||||
|
||||
OkHttpClient caller = new OkHttpClient();
|
||||
Request request = new Request.Builder().url("https://api.nekos.dev/api/v3/images/nsfw/gif/spank/").build();
|
||||
|
||||
try {
|
||||
|
||||
Response response = caller.newCall(request).execute();
|
||||
JSONObject json = new JSONObject(response.body().string());
|
||||
JSONObject data = json.getJSONObject("data");
|
||||
JSONObject response1 = data.getJSONObject("response");
|
||||
String url = response1.toString().replace("{\"url\":\"", "");
|
||||
|
||||
event.getTextChannel().sendMessage(event.getMessageEditor().getMessage(MessageEditor.MessageType.INFO)
|
||||
.setAuthor(event.getMessageEditor().getTerm("commands.nsfw.gif.error.title"),
|
||||
url.replace("\"}", ""))
|
||||
.setImage(url.replace("\"}", "")).setFooter("Spank").build()).queue();
|
||||
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
} else {
|
||||
event.getTextChannel()
|
||||
.sendMessage(event.getMessageEditor().getMessage(MessageEditor.MessageType.NO_NSFW).build())
|
||||
.queue();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] labels() {
|
||||
return new String[] { "spank", "beat", "hit" };
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "commands.nsfw.spank.help.description";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String usage() {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
|
@ -1,60 +0,0 @@
|
|||
package com.bbn.hadder.commands.nsfw;
|
||||
|
||||
/*
|
||||
* @author Skidder / GregTCLTK
|
||||
*/
|
||||
|
||||
import com.bbn.hadder.commands.Command;
|
||||
import com.bbn.hadder.commands.CommandEvent;
|
||||
import com.bbn.hadder.utils.MessageEditor;
|
||||
import okhttp3.OkHttpClient;
|
||||
import okhttp3.Request;
|
||||
import okhttp3.Response;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class TransCommand implements Command {
|
||||
|
||||
@Override
|
||||
public void executed(String[] args, CommandEvent event) {
|
||||
if (event.getTextChannel().isNSFW()) {
|
||||
|
||||
OkHttpClient caller = new OkHttpClient();
|
||||
Request request = new Request.Builder().url("https://nekos.life/api/v2/img/trap").build();
|
||||
|
||||
try {
|
||||
|
||||
Response response = caller.newCall(request).execute();
|
||||
String url = response.body().string().replace("{\"url\":\"", "");
|
||||
|
||||
event.getTextChannel().sendMessage(event.getMessageEditor().getMessage(MessageEditor.MessageType.INFO)
|
||||
.setAuthor(event.getMessageEditor().getTerm("commands.nsfw.gif.error.title"),
|
||||
url.replace("\"}", ""))
|
||||
.setImage(url.replace("\"}", "")).setFooter("Trans").build()).queue();
|
||||
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
} else {
|
||||
event.getTextChannel()
|
||||
.sendMessage(event.getMessageEditor().getMessage(MessageEditor.MessageType.NO_NSFW).build())
|
||||
.queue();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] labels() {
|
||||
return new String[] { "trans" };
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "commands.nsfw.trans.help.description";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String usage() {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
|
@ -1,105 +0,0 @@
|
|||
package com.bbn.hadder.commands.owner;
|
||||
|
||||
/*
|
||||
* @author Skidder / GregTCLTK
|
||||
*/
|
||||
|
||||
import com.bbn.hadder.Hadder;
|
||||
import com.bbn.hadder.commands.Command;
|
||||
import com.bbn.hadder.commands.CommandEvent;
|
||||
import com.bbn.hadder.core.Perm;
|
||||
import com.bbn.hadder.core.Perms;
|
||||
import com.bbn.hadder.utils.MessageEditor;
|
||||
|
||||
import javax.script.ScriptEngine;
|
||||
import javax.script.ScriptEngineManager;
|
||||
import javax.script.ScriptException;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
@Perms(Perm.BOT_OWNER)
|
||||
public class EvalCommand implements Command {
|
||||
|
||||
@Override
|
||||
public void executed(String[] args, CommandEvent event) {
|
||||
if (args.length > 0) {
|
||||
ScriptEngine engine = new ScriptEngineManager().getEngineByName("nashorn");
|
||||
|
||||
try {
|
||||
engine.eval("var imports = new JavaImporter(java.io, java.lang, java.util);");
|
||||
} catch (ScriptException ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
|
||||
engine.put("msg", event.getMessage());
|
||||
engine.put("shardmanager", Hadder.shardManager);
|
||||
engine.put("rethink", event.getRethink());
|
||||
engine.put("event", event);
|
||||
engine.put("jda", event.getJDA());
|
||||
engine.put("message", event.getMessage());
|
||||
engine.put("guild", event.getGuild());
|
||||
engine.put("channel", event.getChannel());
|
||||
engine.put("author", event.getAuthor());
|
||||
engine.put("member", event.getMember());
|
||||
engine.put("self", event.getGuild().getSelfMember());
|
||||
|
||||
ScheduledExecutorService service = Executors.newScheduledThreadPool(1);
|
||||
|
||||
service.schedule(() -> {
|
||||
|
||||
long startExec = System.currentTimeMillis();
|
||||
Object out;
|
||||
|
||||
try {
|
||||
String script = "";
|
||||
for (int i = 0; i < args.length; i++) {
|
||||
args[i] = args[i].replace("```java", "").replace("```", "");
|
||||
script += i == args.length - 1 ? args[i] : args[i] + " ";
|
||||
}
|
||||
out = engine.eval(script);
|
||||
|
||||
event.getTextChannel().sendMessage(event.getMessageEditor()
|
||||
.getMessage(MessageEditor.MessageType.INFO, "commands.owner.eval.success.title", "")
|
||||
.addField(event.getMessageEditor().getTerm("commands.owner.eval.success.input"),
|
||||
"```java\n\n" + script + "```", false)
|
||||
.addField(event.getMessageEditor().getTerm("commands.owner.eval.success.output"),
|
||||
"```java\n\n" + out.toString() + "```", false)
|
||||
.addField(event.getMessageEditor().getTerm("commands.owner.eval.success.timing"),
|
||||
System.currentTimeMillis() - startExec + " milliseconds", false)
|
||||
.build()).queue();
|
||||
} catch (Exception ex) {
|
||||
event.getTextChannel().sendMessage(event.getMessageEditor()
|
||||
.getMessage(MessageEditor.MessageType.INFO, "commands.owner.eval.success.title", "")
|
||||
.addField(event.getMessageEditor().getTerm("error"),
|
||||
"```java\n\n" + ex.getMessage() + "```", false)
|
||||
.addField(event.getMessageEditor().getTerm("commands.owner.eval.success.timing"),
|
||||
System.currentTimeMillis() - startExec + " milliseconds", false)
|
||||
.build()).queue();
|
||||
|
||||
}
|
||||
|
||||
service.shutdownNow();
|
||||
|
||||
}, 0, TimeUnit.MILLISECONDS);
|
||||
|
||||
} else {
|
||||
event.getHelpCommand().sendHelp(this, event);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] labels() {
|
||||
return new String[]{"eval"};
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "commands.owner.eval.help.description";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String usage() {
|
||||
return "commands.owner.eval.help.usage";
|
||||
}
|
||||
}
|
||||
|
|
@ -1,51 +0,0 @@
|
|||
package com.bbn.hadder.commands.owner;
|
||||
|
||||
/*
|
||||
* @author Skidder / GregTCLTK
|
||||
*/
|
||||
|
||||
import com.bbn.hadder.commands.Command;
|
||||
import com.bbn.hadder.commands.CommandEvent;
|
||||
import com.bbn.hadder.core.Perm;
|
||||
import com.bbn.hadder.core.Perms;
|
||||
import com.bbn.hadder.utils.MessageEditor;
|
||||
import net.dv8tion.jda.api.entities.Guild;
|
||||
|
||||
@Perms(Perm.BOT_OWNER)
|
||||
public class GuildLeaveCommand implements Command {
|
||||
|
||||
@Override
|
||||
public void executed(String[] args, CommandEvent event) {
|
||||
if (args.length > 0) {
|
||||
Guild guild = event.getJDA().getGuildById(args[0]);
|
||||
try {
|
||||
guild.leave().queue();
|
||||
event.getTextChannel()
|
||||
.sendMessage(event.getMessageEditor()
|
||||
.getMessage(MessageEditor.MessageType.INFO, "commands.owner.guildleave.success.title",
|
||||
"", "commands.owner.guildleave.success.description", guild.getName())
|
||||
.build())
|
||||
.queue();
|
||||
} catch (Exception e) {
|
||||
event.getTextChannel().sendMessage(event.getMessageEditor().getMessage(MessageEditor.MessageType.WARNING, "commands.owner.guildleave.error.title", "", "commands.owner.guildleave.help.description", guild.getName()).build()).queue();
|
||||
}
|
||||
} else {
|
||||
event.getHelpCommand().sendHelp(this, event);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] labels() {
|
||||
return new String[]{"guildleave"};
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "commands.owner.guildleave.help.description";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String usage() {
|
||||
return "guildid";
|
||||
}
|
||||
}
|
||||
|
|
@ -1,34 +0,0 @@
|
|||
package com.bbn.hadder.commands.owner;
|
||||
|
||||
/*
|
||||
* @author Skidder / GregTCLTK
|
||||
*/
|
||||
|
||||
import com.bbn.hadder.commands.Command;
|
||||
import com.bbn.hadder.commands.CommandEvent;
|
||||
import com.bbn.hadder.core.Perm;
|
||||
import com.bbn.hadder.core.Perms;
|
||||
|
||||
@Perms(Perm.BOT_OWNER)
|
||||
public class RebootCommand implements Command {
|
||||
|
||||
@Override
|
||||
public void executed(String[] args, CommandEvent event) {
|
||||
Runtime.getRuntime().exit(69);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] labels() {
|
||||
return new String[]{"restart", "restart"};
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "commands.owner.reboot.help.description";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String usage() {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
|
@ -1,38 +0,0 @@
|
|||
package com.bbn.hadder.commands.owner;
|
||||
|
||||
/*
|
||||
* @author Skidder / GregTCLTK
|
||||
*/
|
||||
|
||||
import com.bbn.hadder.commands.Command;
|
||||
import com.bbn.hadder.commands.CommandEvent;
|
||||
import com.bbn.hadder.core.Perm;
|
||||
import com.bbn.hadder.core.Perms;
|
||||
import com.bbn.hadder.utils.MessageEditor;
|
||||
|
||||
@Perms(Perm.BOT_OWNER)
|
||||
public class ShutdownCommand implements Command {
|
||||
|
||||
@Override
|
||||
public void executed(String[] args, CommandEvent event) {
|
||||
event.getTextChannel().sendMessage(event.getMessageEditor().getMessage(MessageEditor.MessageType.INFO).setTitle("Shutdown").build()).queue();
|
||||
event.getJDA().getShardManager().shutdown();
|
||||
System.out.println("Bot shut down via Command...");
|
||||
Runtime.getRuntime().exit(69);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] labels() {
|
||||
return new String[]{"shutdown", "exit"};
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "commands.owner.shutdown.help.description";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String usage() {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
package com.bbn.hadder.commands.owner;
|
||||
|
||||
import com.bbn.hadder.commands.Command;
|
||||
import com.bbn.hadder.commands.CommandEvent;
|
||||
import com.bbn.hadder.utils.MessageEditor.MessageType;
|
||||
|
||||
/*
|
||||
* @author Skidder / GregTCLTK
|
||||
*/
|
||||
|
||||
public class TestCommand implements Command {
|
||||
|
||||
@Override
|
||||
public void executed(String[] args, CommandEvent event) {
|
||||
event.getTextChannel().sendMessage(event.getMessageEditor().getMessage(MessageType.INFO, "commands.owner.test.success", "").build()).queue();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] labels() {
|
||||
return new String[]{"test"};
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "commands.owner.test.help.description";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String usage() {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
|
@ -1,69 +0,0 @@
|
|||
package com.bbn.hadder.commands.settings;
|
||||
|
||||
/*
|
||||
* @author Skidder / GregTCLTK
|
||||
*/
|
||||
|
||||
import com.bbn.hadder.commands.Command;
|
||||
import com.bbn.hadder.commands.CommandEvent;
|
||||
import com.bbn.hadder.utils.MessageEditor;
|
||||
|
||||
public class LanguageCommand implements Command {
|
||||
|
||||
@Override
|
||||
public void executed(String[] args, CommandEvent event) {
|
||||
if (args.length == 1) {
|
||||
switch (args[0].toLowerCase()) {
|
||||
case "de":
|
||||
setLanguage("de", "German", event);
|
||||
break;
|
||||
case "en":
|
||||
setLanguage("en", "English", event);
|
||||
break;
|
||||
case "es":
|
||||
setLanguage("es", "Spanish", event);
|
||||
break;
|
||||
case "fr":
|
||||
setLanguage("fr", "French", event);
|
||||
break;
|
||||
case "ru":
|
||||
setLanguage("ru", "Russian", event);
|
||||
break;
|
||||
case "tr":
|
||||
setLanguage("tr", "Turkish", event);
|
||||
break;
|
||||
case "zh":
|
||||
setLanguage("zh", "Chinese", event);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
event.getHelpCommand().sendHelp(this, event);
|
||||
}
|
||||
}
|
||||
|
||||
public void setLanguage(String language_code, String language, CommandEvent event) {
|
||||
event.getRethink().setLanguage(event.getAuthor().getId(), language_code);
|
||||
event.getTextChannel()
|
||||
.sendMessage(
|
||||
event.getMessageEditor()
|
||||
.getMessage(MessageEditor.MessageType.INFO, "commands.settings.language.success.title",
|
||||
"", "commands.settings.language.success.description", language)
|
||||
.build())
|
||||
.queue();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] labels() {
|
||||
return new String[] { "language" };
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "commands.settings.language.help.description";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String usage() {
|
||||
return "commands.settings.language.help.usage";
|
||||
}
|
||||
}
|
||||
|
|
@ -1,41 +0,0 @@
|
|||
package com.bbn.hadder.commands.settings;
|
||||
|
||||
/*
|
||||
* @author Skidder / GregTCLTK
|
||||
*/
|
||||
|
||||
import com.bbn.hadder.commands.Command;
|
||||
import com.bbn.hadder.commands.CommandEvent;
|
||||
import com.bbn.hadder.utils.MessageEditor;
|
||||
|
||||
public class UserPrefixCommand implements Command {
|
||||
|
||||
public void executed(String[] args, CommandEvent event) {
|
||||
if (args.length == 1) {
|
||||
event.getRethink().setUserPrefix(args[0], event.getAuthor().getId());
|
||||
event.getTextChannel()
|
||||
.sendMessage(event.getMessageEditor()
|
||||
.getMessage(MessageEditor.MessageType.INFO, "commands.settings.prefix.success.title", "",
|
||||
"commands.settings.prefix.success.description", args[0])
|
||||
.build())
|
||||
.queue();
|
||||
} else {
|
||||
event.getHelpCommand().sendHelp(this, event);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] labels() {
|
||||
return new String[] { "userprefix" };
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "commands.settings.prefix.help.description";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String usage() {
|
||||
return "userprefix";
|
||||
}
|
||||
}
|
||||
|
|
@ -1,59 +0,0 @@
|
|||
package com.bbn.hadder.core;
|
||||
|
||||
import com.bbn.hadder.Rethink;
|
||||
import com.bbn.hadder.commands.Command;
|
||||
import com.bbn.hadder.commands.CommandEvent;
|
||||
import com.bbn.hadder.commands.general.HelpCommand;
|
||||
import com.bbn.hadder.utils.MessageEditor;
|
||||
import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
public class CommandHandler {
|
||||
|
||||
private List<Command> commandList;
|
||||
private Config config;
|
||||
private HelpCommand helpCommand;
|
||||
|
||||
public CommandHandler(List<Command> commandList, Config config, HelpCommand helpCommand) {
|
||||
this.commandList = commandList;
|
||||
this.config = config;
|
||||
this.helpCommand = helpCommand;
|
||||
}
|
||||
|
||||
public void handle(MessageReceivedEvent event, Rethink rethink, String prefix) {
|
||||
String invoke = event.getMessage().getContentRaw().replaceFirst(prefix, "").split(" ")[0];
|
||||
for (Command cmd : commandList) {
|
||||
for (String label : cmd.labels()) {
|
||||
if (label.equals(invoke)) {
|
||||
String argString = event.getMessage().getContentRaw()
|
||||
.replaceFirst(prefix, "").replaceFirst(invoke, "");
|
||||
if (argString.startsWith(" ")) argString = argString.replaceFirst(" ", "");
|
||||
String[] args = argString.split(" ");
|
||||
if (args.length > 0 && args[0].equals("")) args = new String[0];
|
||||
|
||||
CommandEvent commandEvent = new CommandEvent(event.getJDA(), event.getResponseNumber(), event.getMessage(), rethink,
|
||||
config, this, helpCommand, new MessageEditor(rethink, event.getAuthor()));
|
||||
if (cmd.getClass().getAnnotations().length > 0 && !Arrays.asList(cmd.getClass().getAnnotations()).contains(Perms.class)) {
|
||||
for (Perm perm : cmd.getClass().getAnnotation(Perms.class).value()) {
|
||||
if (!perm.check(commandEvent)) {
|
||||
commandEvent.getTextChannel()
|
||||
.sendMessage(commandEvent.getMessageEditor().getMessage(MessageEditor.MessageType.NO_PERMISSION).build())
|
||||
.queue();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
cmd.executed(args, commandEvent);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public List<Command> getCommandList() {
|
||||
return commandList;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,75 +0,0 @@
|
|||
package com.bbn.hadder.core;
|
||||
|
||||
import com.bbn.hadder.commands.CommandEvent;
|
||||
import net.dv8tion.jda.api.Permission;
|
||||
|
||||
/**
|
||||
* @author Skidder / GregTCLTK
|
||||
* @author Hax / Hax6775 / Schlauer_Hax
|
||||
*/
|
||||
|
||||
public enum Perm {
|
||||
|
||||
BOT_OWNER() {
|
||||
@Override
|
||||
public boolean check(CommandEvent event) {
|
||||
return event.getConfig().getOwners().contains(event.getAuthor().getIdLong());
|
||||
}
|
||||
},
|
||||
MANAGE_MESSAGES {
|
||||
@Override
|
||||
public boolean check(CommandEvent event) {
|
||||
return event.getMember().hasPermission(Permission.MESSAGE_MANAGE) || event.getConfig().getOwners().contains(event.getAuthor().getIdLong());
|
||||
}
|
||||
},
|
||||
EMBED_MESSAGES {
|
||||
@Override
|
||||
public boolean check(CommandEvent event) {
|
||||
return event.getMember().hasPermission(Permission.MESSAGE_EMBED_LINKS) || event.getConfig().getOwners().contains(event.getAuthor().getIdLong());
|
||||
}
|
||||
},
|
||||
BAN_MEMBERS {
|
||||
@Override
|
||||
public boolean check(CommandEvent event) {
|
||||
return event.getMember().hasPermission(Permission.BAN_MEMBERS) || event.getConfig().getOwners().contains(event.getAuthor().getIdLong());
|
||||
}
|
||||
},
|
||||
KICK_MEMBERS {
|
||||
@Override
|
||||
public boolean check(CommandEvent event) {
|
||||
return event.getMember().hasPermission(Permission.KICK_MEMBERS) || event.getConfig().getOwners().contains(event.getAuthor().getIdLong());
|
||||
}
|
||||
},
|
||||
MANAGE_SERVER {
|
||||
@Override
|
||||
public boolean check(CommandEvent event) {
|
||||
return event.getMember().hasPermission(Permission.MANAGE_SERVER) || event.getConfig().getOwners().contains(event.getAuthor().getIdLong());
|
||||
}
|
||||
},
|
||||
MANAGE_ROLES {
|
||||
@Override
|
||||
public boolean check(CommandEvent event) {
|
||||
return event.getMember().hasPermission(Permission.MANAGE_ROLES) || event.getConfig().getOwners().contains(event.getAuthor().getIdLong());
|
||||
}
|
||||
},
|
||||
CHANGE_NICKNAME {
|
||||
@Override
|
||||
public boolean check(CommandEvent event) {
|
||||
return event.getMember().hasPermission(Permission.NICKNAME_CHANGE) || event.getConfig().getOwners().contains(event.getAuthor().getIdLong());
|
||||
}
|
||||
},
|
||||
ADMINISTRATOR {
|
||||
@Override
|
||||
public boolean check(CommandEvent event) {
|
||||
return event.getMember().hasPermission(Permission.ADMINISTRATOR) || event.getConfig().getOwners().contains(event.getAuthor().getIdLong());
|
||||
}
|
||||
},
|
||||
MANAGE_WEBHOOKS {
|
||||
@Override
|
||||
public boolean check(CommandEvent event) {
|
||||
return event.getMember().hasPermission(Permission.MANAGE_WEBHOOKS) || event.getConfig().getOwners().contains(event.getAuthor().getIdLong());
|
||||
}
|
||||
};
|
||||
|
||||
public abstract boolean check(CommandEvent event);
|
||||
}
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
package com.bbn.hadder.core;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
|
||||
/**
|
||||
* @author Skidder / GregTCLTK
|
||||
* @author Hax / Hax6775 / Schlauer_Hax
|
||||
*/
|
||||
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface Perms {
|
||||
Perm[] value() default {};
|
||||
}
|
||||
|
|
@ -1,40 +0,0 @@
|
|||
package com.bbn.hadder.listener;
|
||||
|
||||
import com.bbn.hadder.Rethink;
|
||||
import com.bbn.hadder.core.CommandHandler;
|
||||
import net.dv8tion.jda.api.entities.ChannelType;
|
||||
import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
|
||||
import net.dv8tion.jda.api.hooks.ListenerAdapter;
|
||||
|
||||
/*
|
||||
* @author Skidder / GregTCLTK
|
||||
*/
|
||||
|
||||
public class CommandListener extends ListenerAdapter {
|
||||
|
||||
private Rethink rethink;
|
||||
private CommandHandler handler;
|
||||
|
||||
public CommandListener(Rethink rethink, CommandHandler handler) {
|
||||
this.rethink = rethink;
|
||||
this.handler = handler;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMessageReceived(MessageReceivedEvent event) {
|
||||
if (event.isFromType(ChannelType.TEXT) && !event.getAuthor().isBot()) {
|
||||
String[] prefixes = {
|
||||
rethink.getUserPrefix(event.getAuthor().getId()), rethink.getGuildPrefix(event.getGuild().getId()),
|
||||
event.getGuild().getSelfMember().getAsMention() + " ", event.getGuild().getSelfMember().getAsMention(),
|
||||
event.getGuild().getSelfMember().getAsMention().replace("@", "@!") + " ",
|
||||
event.getGuild().getSelfMember().getAsMention().replace("@", "@!")
|
||||
};
|
||||
for (String prefix : prefixes) {
|
||||
if (event.getMessage().getContentRaw().startsWith(prefix)) {
|
||||
handler.handle(event, rethink, prefix);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,73 +0,0 @@
|
|||
package com.bbn.hadder.listener;
|
||||
|
||||
/*
|
||||
* @author Skidder / GregTCLTK
|
||||
*/
|
||||
|
||||
import com.bbn.hadder.Rethink;
|
||||
import com.bbn.hadder.core.Config;
|
||||
import com.bbn.hadder.utils.BotList;
|
||||
import com.bbn.hadder.utils.MessageEditor;
|
||||
import net.dv8tion.jda.api.entities.Member;
|
||||
import net.dv8tion.jda.api.events.guild.GuildJoinEvent;
|
||||
import net.dv8tion.jda.api.events.guild.GuildLeaveEvent;
|
||||
import net.dv8tion.jda.api.events.guild.member.GuildMemberJoinEvent;
|
||||
import net.dv8tion.jda.api.hooks.ListenerAdapter;
|
||||
|
||||
import java.time.Instant;
|
||||
|
||||
public class GuildListener extends ListenerAdapter {
|
||||
|
||||
private Rethink rethink;
|
||||
private Config config;
|
||||
|
||||
public GuildListener(Rethink rethink, Config config) {
|
||||
this.rethink = rethink;
|
||||
this.config = config;
|
||||
}
|
||||
|
||||
public void onGuildJoin(GuildJoinEvent event) {
|
||||
new Thread(() -> {
|
||||
for (Member member : event.getGuild().getMembers()) {
|
||||
if (!member.getUser().getId().equals(event.getJDA().getSelfUser().getId())) {
|
||||
rethink.insertUser(member.getUser().getId());
|
||||
}
|
||||
}
|
||||
}).start();
|
||||
|
||||
rethink.insertGuild(event.getGuild().getId());
|
||||
event.getJDA().getTextChannelById("475722540140986369").sendMessage(new MessageEditor(null, null).getMessage(MessageEditor.MessageType.INFO)
|
||||
.setTitle("Joined Server")
|
||||
.setThumbnail(event.getGuild().getIconUrl())
|
||||
.addField("Name", event.getGuild().getName(), true)
|
||||
.addField("Guild ID", event.getGuild().getId(), true)
|
||||
.addField("Guild Owner", event.getGuild().getOwner().getUser().getAsTag(), true)
|
||||
.addField("Users", String.valueOf(event.getGuild().getMembers().size()), true)
|
||||
.setFooter(event.getJDA().getSelfUser().getName(), event.getJDA().getSelfUser().getAvatarUrl())
|
||||
.setTimestamp(Instant.now())
|
||||
.build()).queue();
|
||||
|
||||
new BotList(config).post();
|
||||
}
|
||||
|
||||
public void onGuildLeave(GuildLeaveEvent event) {
|
||||
event.getJDA().getTextChannelById("475722540140986369").sendMessage(new MessageEditor(null, null).getMessage(MessageEditor.MessageType.INFO)
|
||||
.setTitle("Left Server")
|
||||
.setThumbnail(event.getGuild().getIconUrl())
|
||||
.addField("Name", event.getGuild().getName(), true)
|
||||
.addField("Guild ID", event.getGuild().getId(), true)
|
||||
.addField("Guild Owner", event.getGuild().getOwner().getUser().getAsTag(), true)
|
||||
.addField("Users", String.valueOf(event.getGuild().getMembers().size()), true)
|
||||
.setFooter(event.getJDA().getSelfUser().getName(), event.getJDA().getSelfUser().getAvatarUrl())
|
||||
.setTimestamp(Instant.now())
|
||||
.build()).queue();
|
||||
|
||||
new BotList(config).post();
|
||||
}
|
||||
|
||||
public void onGuildMemberJoin(GuildMemberJoinEvent event) {
|
||||
if (!event.getUser().getId().equals(event.getJDA().getSelfUser().getId())) {
|
||||
rethink.insertUser(event.getUser().getId());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,66 +0,0 @@
|
|||
package com.bbn.hadder.listener;
|
||||
|
||||
/*
|
||||
* @author Skidder / GregTCLTK
|
||||
*/
|
||||
|
||||
import com.bbn.hadder.Rethink;
|
||||
import net.dv8tion.jda.api.Permission;
|
||||
import net.dv8tion.jda.api.entities.ChannelType;
|
||||
import net.dv8tion.jda.api.entities.Message;
|
||||
import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
|
||||
import net.dv8tion.jda.api.events.message.MessageUpdateEvent;
|
||||
import net.dv8tion.jda.api.hooks.ListenerAdapter;
|
||||
import okhttp3.OkHttpClient;
|
||||
import okhttp3.Request;
|
||||
import okhttp3.Response;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class InviteLinkListener extends ListenerAdapter {
|
||||
|
||||
private Rethink rethink;
|
||||
|
||||
public InviteLinkListener(Rethink rethink) {
|
||||
this.rethink = rethink;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMessageReceived(@Nonnull MessageReceivedEvent event) {
|
||||
if (event.isFromType(ChannelType.TEXT)) {
|
||||
if (event.getMessage().getContentRaw().contains("discord.gg/") && (!event.getMember().hasPermission(Permission.ADMINISTRATOR) && rethink.getInviteDetection(event.getGuild().getId()))) {
|
||||
checkInvite(event.getMessage(), "discord.gg/");
|
||||
} else if (event.getMessage().getContentRaw().contains("discordapp.com/invite") && (!event.getMember().hasPermission(Permission.ADMINISTRATOR) && rethink.getInviteDetection(event.getGuild().getId()))) {
|
||||
checkInvite(event.getMessage(), "discordapp.com/invite/");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void checkInvite(Message message, String regex) {
|
||||
String split = message.getContentRaw().split(regex, 10)[1];
|
||||
String invite = split.split(" ")[0];
|
||||
OkHttpClient client = new OkHttpClient();
|
||||
Request request = new Request.Builder().url("https://canary.discordapp.com/api/v6/invites/" + invite).build();
|
||||
try {
|
||||
Response response = client.newCall(request).execute();
|
||||
JSONObject json = new JSONObject(response.body().string());
|
||||
if (!json.toString().contains("\"message\":")) {
|
||||
message.delete().reason("Invite Link detected").queue();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMessageUpdate(@Nonnull MessageUpdateEvent event) {
|
||||
if (event.isFromType(ChannelType.TEXT)) {
|
||||
if (event.getMessage().getContentRaw().contains("discord.gg/") && !event.getMember().hasPermission(Permission.ADMINISTRATOR) && rethink.getInviteDetection(event.getGuild().getId())) {
|
||||
checkInvite(event.getMessage(), "discord.gg/");
|
||||
} else if (event.getMessage().getContentRaw().contains("discordapp.com/invite") && !event.getMember().hasPermission(Permission.ADMINISTRATOR) && rethink.getInviteDetection(event.getGuild().getId())) {
|
||||
checkInvite(event.getMessage(), "discordapp.com/invite/");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,40 +0,0 @@
|
|||
package com.bbn.hadder.listener;
|
||||
|
||||
import com.bbn.hadder.Rethink;
|
||||
import com.bbn.hadder.utils.MessageEditor;
|
||||
import net.dv8tion.jda.api.entities.ChannelType;
|
||||
import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
|
||||
import net.dv8tion.jda.api.hooks.ListenerAdapter;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.Random;
|
||||
|
||||
public class MentionListener extends ListenerAdapter {
|
||||
|
||||
private Rethink rethink;
|
||||
|
||||
|
||||
public MentionListener(Rethink rethink) {
|
||||
this.rethink = rethink;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMessageReceived(@Nonnull MessageReceivedEvent event) {
|
||||
if (event.isFromType(ChannelType.TEXT) && (event.getMessage().getContentRaw().equals(event.getGuild().getSelfMember().getAsMention())||
|
||||
event.getMessage().getContentRaw().equals(event.getGuild().getSelfMember().getAsMention().replace("@", "@!")))) {
|
||||
event.getChannel().sendMessage(new MessageEditor(rethink, event.getAuthor()).getMessage(MessageEditor.MessageType.INFO)
|
||||
.setTitle("Hello I'm Hadder.")
|
||||
.setAuthor(event.getJDA().getSelfUser().getName(), event.getJDA().getSelfUser().getAvatarUrl(), event.getJDA().getSelfUser().getAvatarUrl())
|
||||
.addField("Users", String.valueOf(event.getJDA().getUsers().size()), false)
|
||||
.addField("Guilds", String.valueOf(event.getJDA().getGuilds().size()), false)
|
||||
.addField("Prefix (User)", rethink.getUserPrefix(event.getAuthor().getId()), false)
|
||||
.addField("Prefix (Guild)", rethink.getGuildPrefix(event.getGuild().getId()), false)
|
||||
.build()).queue();
|
||||
} else if (event.getMessage().getContentRaw().equalsIgnoreCase("@someone")) {
|
||||
int member = new Random().nextInt(event.getGuild().getMembers().size()-1);
|
||||
if (member>0&&member<event.getGuild().getMembers().size()) {
|
||||
event.getChannel().sendMessage(event.getGuild().getMembers().get(member).getAsMention()+ " (Executed by: "+event.getAuthor().getAsTag()+")").queue();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,43 +0,0 @@
|
|||
package com.bbn.hadder.listener;
|
||||
|
||||
/*
|
||||
* @author Skidder / GregTCLTK
|
||||
*/
|
||||
|
||||
import com.bbn.hadder.Rethink;
|
||||
import com.bbn.hadder.utils.MessageEditor;
|
||||
import net.dv8tion.jda.api.entities.ChannelType;
|
||||
import net.dv8tion.jda.api.entities.PrivateChannel;
|
||||
import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
|
||||
import net.dv8tion.jda.api.hooks.ListenerAdapter;
|
||||
|
||||
import java.time.Instant;
|
||||
|
||||
public class PrivateMessageListener extends ListenerAdapter {
|
||||
|
||||
private Rethink rethink;
|
||||
|
||||
public PrivateMessageListener(Rethink rethink) {
|
||||
this.rethink = rethink;
|
||||
}
|
||||
|
||||
public void onMessageReceived(MessageReceivedEvent event) {
|
||||
if (event.isFromType(ChannelType.PRIVATE) && !event.getAuthor().getId().equals(event.getJDA().getSelfUser().getId())) {
|
||||
PrivateChannel Skidder = event.getJDA().getUserById("477141528981012511").openPrivateChannel().complete();
|
||||
PrivateChannel Hax = event.getJDA().getUserById("261083609148948488").openPrivateChannel().complete();
|
||||
|
||||
Skidder.sendMessage(new MessageEditor(rethink, event.getJDA().getUserById("261083609148948488")).getMessage(MessageEditor.MessageType.INFO)
|
||||
.setTitle("New DM by " + event.getAuthor().getAsTag())
|
||||
.setAuthor(event.getAuthor().getName(), event.getAuthor().getAvatarUrl(), event.getAuthor().getAvatarUrl())
|
||||
.setDescription(event.getMessage().getContentRaw())
|
||||
.setTimestamp(Instant.now())
|
||||
.build()).queue();
|
||||
Hax.sendMessage(new MessageEditor(rethink, event.getJDA().getUserById("261083609148948488")).getMessage(MessageEditor.MessageType.INFO)
|
||||
.setTitle("New DM by " + event.getAuthor().getAsTag())
|
||||
.setAuthor(event.getAuthor().getName(), event.getAuthor().getAvatarUrl(), event.getAuthor().getAvatarUrl())
|
||||
.setDescription(event.getMessage().getContentRaw())
|
||||
.setTimestamp(Instant.now())
|
||||
.build()).queue();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,39 +0,0 @@
|
|||
package com.bbn.hadder.listener;
|
||||
|
||||
import com.bbn.hadder.Rethink;
|
||||
import com.bbn.hadder.core.Config;
|
||||
import com.bbn.hadder.utils.BotList;
|
||||
import net.dv8tion.jda.api.entities.Guild;
|
||||
import net.dv8tion.jda.api.entities.User;
|
||||
import net.dv8tion.jda.api.events.ReadyEvent;
|
||||
import net.dv8tion.jda.api.hooks.ListenerAdapter;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class ReadyListener extends ListenerAdapter {
|
||||
|
||||
private Rethink rethink;
|
||||
private Config config;
|
||||
|
||||
public ReadyListener(Rethink rethink, Config config) {
|
||||
this.rethink = rethink;
|
||||
this.config = config;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReady(@Nonnull ReadyEvent event) {
|
||||
rethink.setup();
|
||||
new Thread(() -> {
|
||||
for (User user : event.getJDA().getUsers()) {
|
||||
if (!user.getId().equals(event.getJDA().getSelfUser().getId())) {
|
||||
rethink.insertUser(user.getId());
|
||||
}
|
||||
}
|
||||
for (Guild g : event.getJDA().getGuilds()) {
|
||||
rethink.insertGuild(g.getId());
|
||||
}
|
||||
}).start();
|
||||
|
||||
new BotList(config).post();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,44 +0,0 @@
|
|||
package com.bbn.hadder.listener;
|
||||
|
||||
/*
|
||||
* @author Skidder / GregTCLTK
|
||||
*/
|
||||
|
||||
import com.bbn.hadder.Rethink;
|
||||
import net.dv8tion.jda.api.events.message.react.MessageReactionAddEvent;
|
||||
import net.dv8tion.jda.api.events.message.react.MessageReactionRemoveEvent;
|
||||
import net.dv8tion.jda.api.hooks.ListenerAdapter;
|
||||
|
||||
public class RulesListener extends ListenerAdapter {
|
||||
|
||||
private Rethink rethink;
|
||||
|
||||
public RulesListener(Rethink rethink) {
|
||||
this.rethink = rethink;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMessageReactionAdd(MessageReactionAddEvent event) {
|
||||
if (event.getMessageId().equals(rethink.getRulesMID(event.getGuild().getId())) && !event.getMember().getUser().isBot()) {
|
||||
if (event.getReactionEmote().isEmote()) {
|
||||
if (rethink.getRulesAEmote(event.getGuild().getId()).contains(event.getReactionEmote().getId())) {
|
||||
event.getGuild().addRoleToMember(event.getMember(), event.getGuild().getRoleById(rethink.getRulesRID(event.getGuild().getId()))).reason("Accepted rules").queue();
|
||||
} else if (rethink.getRulesDEmote(event.getGuild().getId()).contains(event.getReactionEmote().getId())) {
|
||||
event.getReaction().removeReaction(event.getUser()).queue();
|
||||
if (event.getGuild().getSelfMember().canInteract(event.getMember())) {
|
||||
event.getMember().kick().reason("Declined the rules");
|
||||
}
|
||||
}
|
||||
} else if (event.getReactionEmote().isEmoji()) {
|
||||
event.getGuild().addRoleToMember(event.getMember(), event.getGuild().getRoleById(rethink.getRulesRID(event.getGuild().getId()))).reason("Accepted rules").queue();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMessageReactionRemove(MessageReactionRemoveEvent event) {
|
||||
if (event.getMessageId().equals(rethink.getRulesMID(event.getGuild().getId())) && !event.getMember().getUser().isBot()) {
|
||||
event.getGuild().removeRoleFromMember(event.getMember(), event.getGuild().getRoleById(rethink.getRulesRID(event.getGuild().getId()))).reason("Withdrawal of the acceptance of the rules").queue();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
package com.bbn.hadder.utils;
|
||||
|
||||
/*
|
||||
* @author Skidder / GregTCLTK
|
||||
*/
|
||||
|
||||
import net.dv8tion.jda.api.audio.AudioSendHandler;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.nio.ByteBuffer;
|
||||
|
||||
public class AudioPlayerSendHandler implements AudioSendHandler {
|
||||
|
||||
@Override
|
||||
public boolean canProvide() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public ByteBuffer provide20MsAudio() {
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,200 +0,0 @@
|
|||
package com.bbn.hadder.utils;
|
||||
|
||||
/*
|
||||
* @author Skidder / GregTCLTK
|
||||
*/
|
||||
|
||||
import com.bbn.hadder.Hadder;
|
||||
import com.bbn.hadder.core.Config;
|
||||
import okhttp3.MediaType;
|
||||
import okhttp3.OkHttpClient;
|
||||
import okhttp3.Request;
|
||||
import okhttp3.RequestBody;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
|
||||
public class BotList {
|
||||
|
||||
private static String MythicalBotList = "https://mythicalbots.xyz/api/bot/637002314162372639";
|
||||
private static String BotsForDiscord = "https://botsfordiscord.com/api/bot/637002314162372639";
|
||||
private static String DiscordBotList = "https://discordbotlist.com/api/bots/637002314162372639/stats";
|
||||
private static String DiscordBestBots = "https://discordsbestbots.xyz/api/bots/637002314162372639/stats";
|
||||
private static String DiscordBoats = "https://discord.boats/api/bot/637002314162372639";
|
||||
private static String YetAnotherBotList = "https://yabl.xyz/api/bot/637002314162372639/stats";
|
||||
private static String DiscordExtremeList = "https://discordextremelist.xyz/api/bot/637002314162372639";
|
||||
private static String DiscordBotReviews = "https://discordbotreviews.xyz/api/bot/637002314162372639/stats";
|
||||
private static String DiscordBots = "https://top.gg/api/bots/637002314162372639/stats";
|
||||
private static String BotListSpace = "https://api.botlist.space/v1/bots/637002314162372639";
|
||||
|
||||
private Config config;
|
||||
|
||||
public BotList(Config config) {
|
||||
this.config = config;
|
||||
}
|
||||
|
||||
public void post() {
|
||||
if (Files.notExists(Paths.get("./DEBUG"))) {
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("server_count", Hadder.shardManager.getGuilds().size());
|
||||
json.put("guildCount", Hadder.shardManager.getGuilds().size());
|
||||
json.put("guilds", Hadder.shardManager.getGuilds().size());
|
||||
json.put("users", Hadder.shardManager.getUsers().size());
|
||||
json.put("shard_count", Hadder.shardManager.getShards().size());
|
||||
|
||||
RequestBody body = RequestBody.create(MediaType.parse("application/json"), json.toString());
|
||||
|
||||
// Mythical Bot List
|
||||
|
||||
Request mythicalbotlist = new Request.Builder()
|
||||
.url(MythicalBotList)
|
||||
.post(body)
|
||||
.addHeader("Authorization", config.getMythicalBotListToken())
|
||||
.build();
|
||||
|
||||
try {
|
||||
new OkHttpClient().newCall(mythicalbotlist).execute().close();
|
||||
System.out.println("Successfully posted count for the Mythical Bot List!");
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
// BotsForDiscord
|
||||
|
||||
Request botsfordiscord = new Request.Builder()
|
||||
.url(BotsForDiscord)
|
||||
.post(body)
|
||||
.addHeader("Authorization", config.getBotsForDiscordToken())
|
||||
.build();
|
||||
|
||||
try {
|
||||
new OkHttpClient().newCall(botsfordiscord).execute().close();
|
||||
System.out.println("Successfully posted count to Bots For Discord!");
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
// Discord Bot List
|
||||
|
||||
Request discordbotlist = new Request.Builder()
|
||||
.url(DiscordBotList)
|
||||
.post(body)
|
||||
.addHeader("Authorization", "Bot " + config.getDiscordBotListToken())
|
||||
.build();
|
||||
|
||||
try {
|
||||
new OkHttpClient().newCall(discordbotlist).execute().close();
|
||||
System.out.println("Successfully posted count for the Discord Bot List!");
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
// Discord Best Bots
|
||||
|
||||
Request discordbestbots = new Request.Builder()
|
||||
.url(DiscordBestBots)
|
||||
.post(body)
|
||||
.addHeader("Authorization", config.getDiscordBestBotsToken())
|
||||
.build();
|
||||
|
||||
try {
|
||||
new OkHttpClient().newCall(discordbestbots).execute().close();
|
||||
System.out.println("Successfully posted count to Discord Best Bots!");
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
// Discord Boats
|
||||
|
||||
Request discordboats = new Request.Builder()
|
||||
.url(DiscordBoats)
|
||||
.post(body)
|
||||
.addHeader("Authorization", config.getDiscordBoatsToken())
|
||||
.build();
|
||||
|
||||
try {
|
||||
new OkHttpClient().newCall(discordboats).execute().close();
|
||||
System.out.println("Successfully posted count to Discord Boats!");
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
// Yet Another Bot List
|
||||
|
||||
Request yetanotherbotlist = new Request.Builder()
|
||||
.url(YetAnotherBotList)
|
||||
.post(body)
|
||||
.addHeader("Authorization", config.getYetAnotherBotListToken())
|
||||
.build();
|
||||
|
||||
try {
|
||||
new OkHttpClient().newCall(yetanotherbotlist).execute().close();
|
||||
System.out.println("Successfully posted count to Yet Another Bot List!");
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
// Discord Extreme List
|
||||
|
||||
Request discordextremelist = new Request.Builder()
|
||||
.url(DiscordExtremeList)
|
||||
.post(body)
|
||||
.addHeader("Authorization", config.getDiscordExtremeListToken())
|
||||
.build();
|
||||
|
||||
try {
|
||||
new OkHttpClient().newCall(discordextremelist).execute().close();
|
||||
System.out.println("Successfully posted count for the Discord Extreme List!");
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
// Discord Bot Reviews
|
||||
|
||||
Request discordbotreviews = new Request.Builder()
|
||||
.url(DiscordBotReviews)
|
||||
.post(body)
|
||||
.addHeader("Authorization", config.getDiscordBotReviewsToken())
|
||||
.build();
|
||||
|
||||
try {
|
||||
new OkHttpClient().newCall(discordbotreviews).execute().close();
|
||||
System.out.println("Successfully posted count to Discord Bot Reviews!");
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
// Discord Bots
|
||||
|
||||
Request discordbots = new Request.Builder()
|
||||
.url(DiscordBots)
|
||||
.post(body)
|
||||
.addHeader("Authorization", config.getDiscordBotsToken())
|
||||
.build();
|
||||
|
||||
try {
|
||||
new OkHttpClient().newCall(discordbots).execute().close();
|
||||
System.out.println("Successfully posted count to Discord Bots!");
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
// BotListSpace
|
||||
|
||||
Request botlistspace = new Request.Builder()
|
||||
.url(BotListSpace)
|
||||
.post(body)
|
||||
.addHeader("Authorization", config.getBotListSpaceToken())
|
||||
.build();
|
||||
|
||||
try {
|
||||
new OkHttpClient().newCall(botlistspace).execute().close();
|
||||
System.out.println("Successfully posted count to BotList.Space!");
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
package com.bbn.hadder.utils;
|
||||
|
||||
import net.dv8tion.jda.api.JDA;
|
||||
import net.dv8tion.jda.api.entities.User;
|
||||
import net.dv8tion.jda.api.events.message.guild.GuildMessageReceivedEvent;
|
||||
import net.dv8tion.jda.api.hooks.ListenerAdapter;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
public class EventWaiter {
|
||||
|
||||
public void newOnMessageEventWaiter(Consumer<GuildMessageReceivedEvent> onEvent, JDA jda, User user) {
|
||||
Object listener = new ListenerAdapter() {
|
||||
@Override
|
||||
public void onGuildMessageReceived(@Nonnull GuildMessageReceivedEvent event) {
|
||||
if (user==null) {
|
||||
onEvent.accept(event);
|
||||
event.getJDA().getShardManager().removeEventListener(this);
|
||||
} else if (event.getAuthor().getId().equals(user.getId())) {
|
||||
onEvent.accept(event);
|
||||
event.getJDA().getShardManager().removeEventListener(this);
|
||||
}
|
||||
}
|
||||
};
|
||||
jda.getShardManager().addEventListener(listener);
|
||||
}
|
||||
|
||||
}
|
||||
159
src/main/java/one/bbn/hadder/Hadder.java
Normal file
159
src/main/java/one/bbn/hadder/Hadder.java
Normal file
|
|
@ -0,0 +1,159 @@
|
|||
/*
|
||||
* Copyright 2019-2020 GregTCLTK and Schlauer-Hax
|
||||
*
|
||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package one.bbn.hadder;
|
||||
|
||||
import net.dv8tion.jda.api.utils.cache.CacheFlag;
|
||||
import one.bbn.hadder.audio.AudioManager;
|
||||
import one.bbn.hadder.commands.fun.AvatarCommand;
|
||||
import one.bbn.hadder.commands.fun.ClydeCommand;
|
||||
import one.bbn.hadder.commands.fun.GifCommand;
|
||||
import one.bbn.hadder.commands.fun.MemeCommand;
|
||||
import one.bbn.hadder.commands.general.*;
|
||||
import one.bbn.hadder.commands.misc.*;
|
||||
import one.bbn.hadder.commands.moderation.*;
|
||||
import one.bbn.hadder.commands.music.*;
|
||||
import one.bbn.hadder.commands.nsfw.*;
|
||||
import one.bbn.hadder.commands.owner.*;
|
||||
import one.bbn.hadder.commands.settings.LanguageCommand;
|
||||
import one.bbn.hadder.commands.settings.UserPrefixCommand;
|
||||
import one.bbn.hadder.core.CommandHandler;
|
||||
import one.bbn.hadder.core.Config;
|
||||
import one.bbn.hadder.db.Mongo;
|
||||
import one.bbn.hadder.listener.*;
|
||||
import net.dv8tion.jda.api.OnlineStatus;
|
||||
import net.dv8tion.jda.api.entities.Activity;
|
||||
import net.dv8tion.jda.api.requests.GatewayIntent;
|
||||
import net.dv8tion.jda.api.sharding.DefaultShardManagerBuilder;
|
||||
import net.dv8tion.jda.api.sharding.ShardManager;
|
||||
import net.dv8tion.jda.api.utils.ChunkingFilter;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class Hadder {
|
||||
|
||||
public static ShardManager shardManager;
|
||||
|
||||
public static void main(String[] args) {
|
||||
startBot();
|
||||
}
|
||||
|
||||
private static void startBot() {
|
||||
Config config = new Config("./config.json");
|
||||
if (!config.fileExists()) config.create();
|
||||
config.load();
|
||||
|
||||
Mongo mongo = new Mongo(config);
|
||||
mongo.connect();
|
||||
|
||||
DefaultShardManagerBuilder builder = DefaultShardManagerBuilder.create(GatewayIntent.getIntents(14053));
|
||||
|
||||
builder.setAutoReconnect(true);
|
||||
builder.setShardsTotal(1);
|
||||
builder.setChunkingFilter(ChunkingFilter.NONE);
|
||||
builder.setBulkDeleteSplittingEnabled(true);
|
||||
builder.setActivity(Activity.listening("h.help"));
|
||||
builder.setStatus(OnlineStatus.DO_NOT_DISTURB);
|
||||
builder.setToken(config.getBotToken());
|
||||
builder.disableCache(CacheFlag.ACTIVITY, CacheFlag.EMOTE, CacheFlag.CLIENT_STATUS);
|
||||
|
||||
HelpCommand helpCommand = new HelpCommand();
|
||||
AudioManager audioManager = new AudioManager();
|
||||
|
||||
CommandHandler commandHandler = new CommandHandler(
|
||||
List.of(
|
||||
helpCommand,
|
||||
new TestCommand(),
|
||||
new BanCommand(),
|
||||
new UserPrefixCommand(),
|
||||
new ShutdownCommand(),
|
||||
new KickCommand(),
|
||||
new PingCommand(),
|
||||
new GifCommand(),
|
||||
new ClearCommand(),
|
||||
new GitHubCommand(),
|
||||
new RebootCommand(),
|
||||
new EqualsCommand(),
|
||||
new InviteCommand(),
|
||||
new ScreenShareCommand(),
|
||||
new NickCommand(),
|
||||
new PrefixCommand(),
|
||||
new BlowjobCommand(),
|
||||
new PornCommand(),
|
||||
new AnalCommand(),
|
||||
new CumCommand(),
|
||||
new TransCommand(),
|
||||
new PussyCommand(),
|
||||
new BoobsCommand(),
|
||||
new FeetCommand(),
|
||||
new EroticCommand(),
|
||||
new RoleCommand(),
|
||||
new RulesCommand(),
|
||||
new FeedbackCommand(),
|
||||
new AvatarCommand(),
|
||||
new EvalCommand(),
|
||||
new JoinCommand(),
|
||||
new GuildLeaveCommand(),
|
||||
new MemeCommand(),
|
||||
new InviteDetectCommand(),
|
||||
new BDSMCommand(),
|
||||
new FingeringCommand(),
|
||||
new LickingCommand(),
|
||||
new SpankCommand(),
|
||||
new RandomPornCommand(),
|
||||
new SoloCommand(),
|
||||
new RegionChangeCommand(),
|
||||
new AboutCommand(),
|
||||
new LanguageCommand(),
|
||||
new ClydeCommand(),
|
||||
new PlayCommand(),
|
||||
new StarboardCommand(),
|
||||
new QueueCommand(),
|
||||
new InfoCommand(),
|
||||
new SkipCommand(),
|
||||
new EditRulesCommand(),
|
||||
new VolumeCommand(),
|
||||
new StopCommand(),
|
||||
new BlacklistCommand(),
|
||||
new PauseCommand(),
|
||||
new LoopCommand(),
|
||||
new BassCommand(),
|
||||
new EchoCommand(),
|
||||
new ServerStatsCommand(),
|
||||
new ProfileCommand(),
|
||||
new CodeCommand(),
|
||||
new MoveAllCommand(),
|
||||
new CoronaCommand()), config, helpCommand);
|
||||
|
||||
builder.addEventListeners(
|
||||
new MentionListener(mongo, config),
|
||||
new PrivateMessageListener(mongo),
|
||||
new CommandListener(mongo, commandHandler, audioManager),
|
||||
new GuildListener(mongo, config),
|
||||
new ReadyListener(config),
|
||||
new InviteLinkListener(mongo),
|
||||
new RulesListener(mongo),
|
||||
new StarboardListener(mongo),
|
||||
new VoiceLeaveListener(audioManager),
|
||||
new OwnerMessageListener(config));
|
||||
|
||||
try {
|
||||
shardManager = builder.build();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
40
src/main/java/one/bbn/hadder/audio/AudioInfo.java
Normal file
40
src/main/java/one/bbn/hadder/audio/AudioInfo.java
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||
*
|
||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package one.bbn.hadder.audio;
|
||||
|
||||
import com.sedmelluq.discord.lavaplayer.track.AudioTrack;
|
||||
import net.dv8tion.jda.api.entities.Member;
|
||||
|
||||
public class AudioInfo {
|
||||
|
||||
private final AudioTrack track;
|
||||
private final Member author;
|
||||
|
||||
AudioInfo(AudioTrack track, Member author) {
|
||||
this.track = track;
|
||||
this.author = author;
|
||||
}
|
||||
|
||||
public AudioTrack getTrack() {
|
||||
return track;
|
||||
}
|
||||
|
||||
public Member getAuthor() {
|
||||
return author;
|
||||
}
|
||||
|
||||
}
|
||||
168
src/main/java/one/bbn/hadder/audio/AudioManager.java
Normal file
168
src/main/java/one/bbn/hadder/audio/AudioManager.java
Normal file
|
|
@ -0,0 +1,168 @@
|
|||
/*
|
||||
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||
*
|
||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package one.bbn.hadder.audio;
|
||||
|
||||
import one.bbn.hadder.commands.CommandEvent;
|
||||
import one.bbn.hadder.utils.MessageEditor;
|
||||
import com.sedmelluq.discord.lavaplayer.player.AudioLoadResultHandler;
|
||||
import com.sedmelluq.discord.lavaplayer.player.AudioPlayer;
|
||||
import com.sedmelluq.discord.lavaplayer.player.AudioPlayerManager;
|
||||
import com.sedmelluq.discord.lavaplayer.player.DefaultAudioPlayerManager;
|
||||
import com.sedmelluq.discord.lavaplayer.source.AudioSourceManagers;
|
||||
import com.sedmelluq.discord.lavaplayer.tools.FriendlyException;
|
||||
import com.sedmelluq.discord.lavaplayer.track.AudioPlaylist;
|
||||
import com.sedmelluq.discord.lavaplayer.track.AudioTrack;
|
||||
import net.dv8tion.jda.api.entities.Guild;
|
||||
import net.dv8tion.jda.api.entities.Message;
|
||||
|
||||
import java.util.AbstractMap;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
public class AudioManager {
|
||||
|
||||
public Map<String, Map.Entry<AudioPlayer, TrackManager>> players = new HashMap<>();
|
||||
private final AudioPlayerManager myManager = new DefaultAudioPlayerManager();
|
||||
|
||||
public AudioManager() {
|
||||
AudioSourceManagers.registerRemoteSources(myManager);
|
||||
myManager.getConfiguration().setFilterHotSwapEnabled(true);
|
||||
}
|
||||
|
||||
public boolean hasPlayer(Guild guild) {
|
||||
return players.containsKey(guild.getId());
|
||||
}
|
||||
|
||||
public AudioPlayer getPlayer(Guild guild) {
|
||||
AudioPlayer p;
|
||||
if (hasPlayer(guild)) {
|
||||
p = players.get(guild.getId()).getKey();
|
||||
} else {
|
||||
p = createPlayer(guild);
|
||||
}
|
||||
return p;
|
||||
}
|
||||
|
||||
public TrackManager getTrackManager(Guild guild) {
|
||||
return players.get(guild.getId()).getValue();
|
||||
}
|
||||
|
||||
public AudioPlayer createPlayer(Guild guild) {
|
||||
AudioPlayer nPlayer = myManager.createPlayer();
|
||||
TrackManager manager = new TrackManager(nPlayer, this);
|
||||
nPlayer.addListener(manager);
|
||||
guild.getAudioManager().setSendingHandler(new AudioPlayerSendHandler(nPlayer));
|
||||
players.put(guild.getId(), new AbstractMap.SimpleEntry<>(nPlayer, manager));
|
||||
return nPlayer;
|
||||
}
|
||||
|
||||
public void loadTrack(String identifier, CommandEvent event, Message msg) {
|
||||
Guild guild = event.getGuild();
|
||||
getPlayer(guild);
|
||||
|
||||
myManager.loadItemOrdered(guild, identifier, new AudioLoadResultHandler() {
|
||||
|
||||
@Override
|
||||
public void trackLoaded(AudioTrack track) {
|
||||
if (getTrackManager(guild).getQueuedTracks().isEmpty()) {
|
||||
getTrackManager(guild).queue(track, event.getMember());
|
||||
msg.editMessage(event.getMessageEditor().getMessage(MessageEditor.MessageType.INFO,
|
||||
"commands.music.play.success.loading.title", "⏯",
|
||||
"", "")
|
||||
.addField(event.getMessageEditor().getTerm("commands.music.play.success.title"), track.getInfo().title, false)
|
||||
.addField(event.getMessageEditor().getTerm("commands.music.play.success.author"), track.getInfo().author, true)
|
||||
.addField(event.getMessageEditor().getTerm("commands.music.play.success.length"),
|
||||
String.format("%02d:%02d:%02d", TimeUnit.MILLISECONDS.toHours(track.getInfo().length),
|
||||
TimeUnit.MILLISECONDS.toMinutes(track.getInfo().length) % TimeUnit.HOURS.toMinutes(1),
|
||||
TimeUnit.MILLISECONDS.toSeconds(track.getInfo().length) % TimeUnit.MINUTES.toSeconds(1)), true)
|
||||
.build()).queue();
|
||||
} else {
|
||||
getTrackManager(guild).queue(track, event.getMember());
|
||||
msg.editMessage(event.getMessageEditor().getMessage(MessageEditor.MessageType.INFO,
|
||||
"commands.music.play.success.queueing.title", "⏺",
|
||||
"", "")
|
||||
.addField(event.getMessageEditor().getTerm("commands.music.play.success.title"), track.getInfo().title, false)
|
||||
.addField(event.getMessageEditor().getTerm("commands.music.play.success.author"), track.getInfo().author, true)
|
||||
.addField(event.getMessageEditor().getTerm("commands.music.play.success.length"),
|
||||
String.format("%02d:%02d:%02d", TimeUnit.MILLISECONDS.toHours(track.getInfo().length),
|
||||
TimeUnit.MILLISECONDS.toMinutes(track.getInfo().length) % TimeUnit.HOURS.toMinutes(1),
|
||||
TimeUnit.MILLISECONDS.toSeconds(track.getInfo().length) % TimeUnit.MINUTES.toSeconds(1)), true)
|
||||
.build()).queue();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void playlistLoaded(AudioPlaylist playlist) {
|
||||
if (playlist.getSelectedTrack() != null) {
|
||||
trackLoaded(playlist.getSelectedTrack());
|
||||
} else if (playlist.isSearchResult()) {
|
||||
trackLoaded(playlist.getTracks().get(0));
|
||||
} else {
|
||||
for (int i = 0; i < Math.min(playlist.getTracks().size(), 69); i++) {
|
||||
getTrackManager(guild).queue(playlist.getTracks().get(i), event.getMember());
|
||||
}
|
||||
msg.editMessage(event.getMessageEditor().getMessage(MessageEditor.MessageType.INFO,
|
||||
"commands.music.play.success.loading.title", "⏯",
|
||||
"", "")
|
||||
.addField(event.getMessageEditor().getTerm("commands.music.play.success.title"), playlist.getName(), true)
|
||||
.addField(event.getMessageEditor().getTerm("commands.music.play.success.tracks"), String.valueOf(playlist.getTracks().size()), true)
|
||||
.build()).queue();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void noMatches() {
|
||||
msg.editMessage(event.getMessageEditor().getMessage(MessageEditor.MessageType.INFO,
|
||||
"commands.music.play.error.match.title", "❌",
|
||||
"commands.music.play.error.match.description", "")
|
||||
.build()).queue();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadFailed(FriendlyException e) {
|
||||
msg.editMessage(event.getMessageEditor().getMessage(MessageEditor.MessageType.INFO,
|
||||
"commands.music.play.error.load.title", "❌",
|
||||
"commands.music.play.error.load.description", "")
|
||||
.build()).queue();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
TODO: DJ integration
|
||||
public boolean isDj(Member member) {
|
||||
return member.getRoles().stream().anyMatch(r -> r.getName().equals("DJ"));
|
||||
}
|
||||
|
||||
public boolean isCurrentDj(Member member) {
|
||||
return getTrackManager(member.getGuild()).getTrackInfo(getPlayer(member.getGuild()).getPlayingTrack()).getAuthor().equals(member);
|
||||
}
|
||||
*/
|
||||
public void forceSkipTrack(CommandEvent event) {
|
||||
getPlayer(event.getGuild()).stopTrack();
|
||||
}
|
||||
|
||||
public String getTimestamp(long m) {
|
||||
long s = m / 1000;
|
||||
long hours = Math.floorDiv(s, 3600);
|
||||
s = s - (hours * 3600);
|
||||
long minutes = Math.floorDiv(s, 60);
|
||||
s = s - (minutes * 60);
|
||||
return (hours == 0 ? "" : hours + ":") + String.format("%02d", minutes) + ":" + String.format("%02d", s);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,87 @@
|
|||
/*
|
||||
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||
*
|
||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package one.bbn.hadder.audio;
|
||||
|
||||
import com.sedmelluq.discord.lavaplayer.player.AudioPlayer;
|
||||
import com.sedmelluq.discord.lavaplayer.track.playback.AudioFrame;
|
||||
import net.dv8tion.jda.api.audio.AudioReceiveHandler;
|
||||
import net.dv8tion.jda.api.audio.AudioSendHandler;
|
||||
import net.dv8tion.jda.api.audio.CombinedAudio;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.Queue;
|
||||
import java.util.concurrent.ConcurrentLinkedQueue;
|
||||
|
||||
public class AudioPlayerSendHandler implements AudioSendHandler, AudioReceiveHandler {
|
||||
|
||||
private final AudioPlayer audioPlayer;
|
||||
private AudioFrame lastFrame;
|
||||
private final Queue<byte[]> queue = new ConcurrentLinkedQueue<>();
|
||||
|
||||
public AudioPlayerSendHandler(AudioPlayer audioPlayer) {
|
||||
this.audioPlayer = audioPlayer;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canProvide() {
|
||||
if (audioPlayer.getPlayingTrack() == null)
|
||||
return !queue.isEmpty();
|
||||
else if (lastFrame == null) {
|
||||
lastFrame = audioPlayer.provide();
|
||||
return lastFrame != null;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public ByteBuffer provide20MsAudio() {
|
||||
if (audioPlayer.getPlayingTrack() == null) {
|
||||
byte[] data = queue.poll();
|
||||
return data == null ? null : ByteBuffer.wrap(data);
|
||||
} else {
|
||||
if (lastFrame == null) {
|
||||
lastFrame = audioPlayer.provide();
|
||||
}
|
||||
|
||||
byte[] data = lastFrame != null ? lastFrame.getData() : null;
|
||||
lastFrame = null;
|
||||
|
||||
return ByteBuffer.wrap(data);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canReceiveCombined() {
|
||||
return queue.size() < 10;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleCombinedAudio(CombinedAudio combinedAudio) {
|
||||
if (combinedAudio.getUsers().isEmpty())
|
||||
return;
|
||||
|
||||
byte[] data = combinedAudio.getAudioData(1.0f);
|
||||
queue.add(data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpus() {
|
||||
return audioPlayer.getPlayingTrack() != null;
|
||||
}
|
||||
}
|
||||
103
src/main/java/one/bbn/hadder/audio/TrackManager.java
Normal file
103
src/main/java/one/bbn/hadder/audio/TrackManager.java
Normal file
|
|
@ -0,0 +1,103 @@
|
|||
/*
|
||||
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||
*
|
||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package one.bbn.hadder.audio;
|
||||
|
||||
import com.sedmelluq.discord.lavaplayer.player.AudioPlayer;
|
||||
import com.sedmelluq.discord.lavaplayer.player.event.AudioEventAdapter;
|
||||
import com.sedmelluq.discord.lavaplayer.track.AudioTrack;
|
||||
import com.sedmelluq.discord.lavaplayer.track.AudioTrackEndReason;
|
||||
import net.dv8tion.jda.api.entities.Guild;
|
||||
import net.dv8tion.jda.api.entities.Member;
|
||||
import net.dv8tion.jda.api.entities.VoiceChannel;
|
||||
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.Queue;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.LinkedBlockingQueue;
|
||||
|
||||
public class TrackManager extends AudioEventAdapter {
|
||||
|
||||
private final AudioPlayer player;
|
||||
private final AudioManager manager;
|
||||
private final Queue<AudioInfo> queue;
|
||||
private AudioTrack lastTrack;
|
||||
private boolean loop = false;
|
||||
|
||||
public TrackManager(AudioPlayer player, AudioManager manager) {
|
||||
this.manager = manager;
|
||||
this.player = player;
|
||||
this.queue = new LinkedBlockingQueue<>();
|
||||
}
|
||||
|
||||
public void queue(AudioTrack track, Member author) {
|
||||
AudioInfo info = new AudioInfo(track, author);
|
||||
queue.add(info);
|
||||
|
||||
if (player.getPlayingTrack() == null) {
|
||||
player.playTrack(track);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTrackStart(AudioPlayer player, AudioTrack track) {
|
||||
AudioInfo info = queue.element();
|
||||
VoiceChannel vChan = info.getAuthor().getVoiceState().getChannel();
|
||||
if (vChan == null) {
|
||||
player.stopTrack();
|
||||
} else {
|
||||
info.getAuthor().getGuild().getAudioManager().openAudioConnection(vChan);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTrackEnd(AudioPlayer player, AudioTrack track, AudioTrackEndReason endReason) {
|
||||
if (loop) {
|
||||
this.lastTrack = track;
|
||||
player.playTrack(lastTrack.makeClone());
|
||||
} else {
|
||||
Guild g = queue.poll().getAuthor().getGuild();
|
||||
manager.getPlayer(g).stopTrack();
|
||||
if (!queue.isEmpty()) player.playTrack(queue.element().getTrack().makeClone());
|
||||
else {
|
||||
manager.players.remove(g.getId());
|
||||
manager.getPlayer(g).destroy();
|
||||
manager.getTrackManager(g).purgeQueue();
|
||||
g.getAudioManager().closeAudioConnection();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public Set<AudioInfo> getQueuedTracks() {
|
||||
return new LinkedHashSet<>(queue);
|
||||
}
|
||||
|
||||
public void purgeQueue() {
|
||||
queue.clear();
|
||||
}
|
||||
|
||||
public void remove(AudioInfo entry) {
|
||||
queue.remove(entry);
|
||||
}
|
||||
|
||||
public boolean isLoop() {
|
||||
return loop;
|
||||
}
|
||||
|
||||
public void setLoop(boolean repeating) {
|
||||
this.loop = repeating;
|
||||
}
|
||||
}
|
||||
29
src/main/java/one/bbn/hadder/commands/Command.java
Normal file
29
src/main/java/one/bbn/hadder/commands/Command.java
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
/*
|
||||
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||
*
|
||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package one.bbn.hadder.commands;
|
||||
|
||||
public interface Command {
|
||||
void executed(String[] args, CommandEvent e);
|
||||
|
||||
String[] labels();
|
||||
|
||||
String description();
|
||||
|
||||
String usage();
|
||||
|
||||
String example();
|
||||
}
|
||||
97
src/main/java/one/bbn/hadder/commands/CommandEvent.java
Normal file
97
src/main/java/one/bbn/hadder/commands/CommandEvent.java
Normal file
|
|
@ -0,0 +1,97 @@
|
|||
/*
|
||||
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||
*
|
||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package one.bbn.hadder.commands;
|
||||
|
||||
import one.bbn.hadder.audio.AudioManager;
|
||||
import one.bbn.hadder.commands.general.HelpCommand;
|
||||
import one.bbn.hadder.core.CommandHandler;
|
||||
import one.bbn.hadder.core.Config;
|
||||
import one.bbn.hadder.db.Mongo;
|
||||
import one.bbn.hadder.db.MongoServer;
|
||||
import one.bbn.hadder.db.MongoUser;
|
||||
import one.bbn.hadder.utils.EventWaiter;
|
||||
import one.bbn.hadder.utils.MessageEditor;
|
||||
import net.dv8tion.jda.api.JDA;
|
||||
import net.dv8tion.jda.api.entities.Message;
|
||||
import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class CommandEvent extends MessageReceivedEvent {
|
||||
|
||||
private Mongo mongo;
|
||||
private Config config;
|
||||
private CommandHandler commandHandler;
|
||||
private HelpCommand helpCommand;
|
||||
private MessageEditor messageEditor;
|
||||
private EventWaiter eventWaiter;
|
||||
private AudioManager audioManager;
|
||||
private MongoUser mongoUser;
|
||||
private MongoServer mongoServer;
|
||||
|
||||
public CommandEvent(@Nonnull JDA api, long responseNumber, @Nonnull Message message, Mongo mongo, Config config,
|
||||
CommandHandler commandHandler, HelpCommand helpCommand, MessageEditor messageEditor,
|
||||
EventWaiter eventWaiter, AudioManager audioManager, MongoUser mongoUser,
|
||||
MongoServer mongoServer) {
|
||||
super(api, responseNumber, message);
|
||||
this.mongo = mongo;
|
||||
this.config = config;
|
||||
this.commandHandler = commandHandler;
|
||||
this.helpCommand = helpCommand;
|
||||
this.messageEditor = messageEditor;
|
||||
this.eventWaiter = eventWaiter;
|
||||
this.audioManager = audioManager;
|
||||
this.mongoUser = mongoUser;
|
||||
this.mongoServer = mongoServer;
|
||||
}
|
||||
|
||||
public Mongo getMongo() {
|
||||
return mongo;
|
||||
}
|
||||
|
||||
public Config getConfig() {
|
||||
return config;
|
||||
}
|
||||
|
||||
public HelpCommand getHelpCommand() {
|
||||
return helpCommand;
|
||||
}
|
||||
|
||||
public CommandHandler getCommandHandler() {
|
||||
return commandHandler;
|
||||
}
|
||||
|
||||
public MessageEditor getMessageEditor() {
|
||||
return messageEditor;
|
||||
}
|
||||
|
||||
public EventWaiter getEventWaiter() {
|
||||
return eventWaiter;
|
||||
}
|
||||
|
||||
public AudioManager getAudioManager() {
|
||||
return audioManager;
|
||||
}
|
||||
|
||||
public MongoServer getMongoServer() {
|
||||
return mongoServer;
|
||||
}
|
||||
|
||||
public MongoUser getMongoUser() {
|
||||
return mongoUser;
|
||||
}
|
||||
}
|
||||
121
src/main/java/one/bbn/hadder/commands/fun/AvatarCommand.java
Normal file
121
src/main/java/one/bbn/hadder/commands/fun/AvatarCommand.java
Normal file
|
|
@ -0,0 +1,121 @@
|
|||
/*
|
||||
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||
*
|
||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package one.bbn.hadder.commands.fun;
|
||||
|
||||
import one.bbn.hadder.commands.Command;
|
||||
import one.bbn.hadder.commands.CommandEvent;
|
||||
import one.bbn.hadder.utils.MessageEditor;
|
||||
import net.dv8tion.jda.api.entities.User;
|
||||
import okhttp3.OkHttpClient;
|
||||
import okhttp3.Request;
|
||||
import okhttp3.Response;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
public class AvatarCommand implements Command {
|
||||
|
||||
@Override
|
||||
public void executed(String[] args, CommandEvent e) {
|
||||
if (args.length == 0) {
|
||||
User u = e.getAuthor();
|
||||
e.getTextChannel().sendMessage(
|
||||
e.getMessageEditor().getMessage(
|
||||
MessageEditor.MessageType.INFO,
|
||||
"commands.fun.avatar.success.title",
|
||||
u.getAsTag(),
|
||||
"",
|
||||
"")
|
||||
.setImage(u.getAvatarUrl())
|
||||
.setFooter(u.getAsTag())
|
||||
.build()).queue();
|
||||
} else if (e.getMessage().getMentionedUsers().size() == 1) {
|
||||
User u = e.getMessage().getMentionedUsers().get(0);
|
||||
e.getTextChannel().sendMessage(
|
||||
e.getMessageEditor().getMessage(
|
||||
MessageEditor.MessageType.INFO,
|
||||
"commands.fun.avatar.success.title",
|
||||
u.getAsTag(),
|
||||
"",
|
||||
"")
|
||||
.setImage(u.getAvatarUrl())
|
||||
.setFooter(u.getAsTag())
|
||||
.build()).queue();
|
||||
} else if (args[0].length() == 18) {
|
||||
try {
|
||||
User u = e.getJDA().getUserById(args[0]);
|
||||
e.getTextChannel().sendMessage(
|
||||
e.getMessageEditor().getMessage(
|
||||
MessageEditor.MessageType.INFO,
|
||||
"commands.fun.avatar.success.title",
|
||||
u.getAsTag(),
|
||||
"",
|
||||
"")
|
||||
.setImage(u.getAvatarUrl())
|
||||
.setFooter(u.getAsTag())
|
||||
.build()).queue();
|
||||
} catch (NullPointerException ignore) {
|
||||
|
||||
OkHttpClient client = new OkHttpClient();
|
||||
Request request = new Request.Builder().url("https://canary.discord.com/api/v8/users/" + args[0]).addHeader("Authorization", "Bot " + e.getConfig().getBotToken()).build();
|
||||
|
||||
try {
|
||||
Response response = client.newCall(request).execute();
|
||||
JSONObject json = new JSONObject(response.body().string());
|
||||
String url = "https://cdn.discordapp.com/avatars/" + args[0] + "/" + json.getString("avatar") + ".png";
|
||||
e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(
|
||||
MessageEditor.MessageType.INFO,
|
||||
"commands.fun.avatar.success.title",
|
||||
json.getString("username") + "#" + json.getString("discriminator"),
|
||||
"",
|
||||
"")
|
||||
.setImage(url)
|
||||
.setFooter(json.getString("username") + "#" + json.getString("discriminator"))
|
||||
.build()).queue();
|
||||
} catch (JSONException ex) {
|
||||
e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.ERROR,
|
||||
"commands.fun.avatar.error.title",
|
||||
"commands.fun.avatar.error.description"
|
||||
).build()).queue();
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
e.getHelpCommand().sendHelp(this, e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] labels() {
|
||||
return new String[]{"avatar"};
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "commands.fun.avatar.help.description";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String usage() {
|
||||
return "[user]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String example() {
|
||||
return "@Skidder";
|
||||
}
|
||||
}
|
||||
94
src/main/java/one/bbn/hadder/commands/fun/ClydeCommand.java
Normal file
94
src/main/java/one/bbn/hadder/commands/fun/ClydeCommand.java
Normal file
|
|
@ -0,0 +1,94 @@
|
|||
/*
|
||||
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||
*
|
||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package one.bbn.hadder.commands.fun;
|
||||
|
||||
import club.minnced.discord.webhook.WebhookClient;
|
||||
import club.minnced.discord.webhook.WebhookClientBuilder;
|
||||
import one.bbn.hadder.commands.Command;
|
||||
import one.bbn.hadder.commands.CommandEvent;
|
||||
import one.bbn.hadder.core.Perm;
|
||||
import one.bbn.hadder.core.Perms;
|
||||
import one.bbn.hadder.utils.MessageEditor;
|
||||
import net.dv8tion.jda.api.Permission;
|
||||
import net.dv8tion.jda.api.entities.Icon;
|
||||
import net.dv8tion.jda.api.entities.TextChannel;
|
||||
import net.dv8tion.jda.api.entities.Webhook;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.net.URL;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
@Perms(Perm.MANAGE_WEBHOOKS)
|
||||
public class ClydeCommand implements Command {
|
||||
|
||||
@Override
|
||||
public void executed(String[] args, CommandEvent e) {
|
||||
if (args.length > 0) {
|
||||
if (e.getGuild().getSelfMember().hasPermission(Permission.MANAGE_WEBHOOKS)) {
|
||||
TextChannel channel = e.getMessage().getTextChannel();
|
||||
String content = e.getMessage().getContentRaw().replace(e.getMongoServer().getPrefix(), "").replace(e.getMongoUser().getPrefix(), "").replace("clyde", "");
|
||||
|
||||
Webhook webhook = channel.createWebhook(e.getConfig().getClydeName()).complete();
|
||||
try {
|
||||
InputStream s = new URL("https://discordapp.com/assets/f78426a064bc9dd24847519259bc42af.png").openStream();
|
||||
webhook.getManager().setAvatar(Icon.from(s)).queue();
|
||||
|
||||
WebhookClientBuilder builder = new WebhookClientBuilder(webhook.getUrl());
|
||||
|
||||
WebhookClient client = builder.build();
|
||||
try {
|
||||
TimeUnit.SECONDS.sleep(1);
|
||||
} catch (InterruptedException ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
client.send(content);
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
try {
|
||||
TimeUnit.SECONDS.sleep(2);
|
||||
} catch (InterruptedException ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
webhook.delete().queue();
|
||||
e.getMessage().delete().queue();
|
||||
} else
|
||||
e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.NO_SELF_PERMISSION).build()).queue();
|
||||
} else e.getHelpCommand().sendHelp(this, e);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] labels() {
|
||||
return new String[]{"clyde"};
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "commands.fun.clyde.help.description";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String usage() {
|
||||
return "[content]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String example() {
|
||||
return "Hey I am Clyde";
|
||||
}
|
||||
}
|
||||
|
|
@ -1,12 +1,24 @@
|
|||
package com.bbn.hadder.commands.fun;
|
||||
|
||||
/*
|
||||
* @author Skidder / GregTCLTK
|
||||
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||
*
|
||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import com.bbn.hadder.commands.Command;
|
||||
import com.bbn.hadder.commands.CommandEvent;
|
||||
import com.bbn.hadder.utils.MessageEditor;
|
||||
package one.bbn.hadder.commands.fun;
|
||||
|
||||
import one.bbn.hadder.commands.Command;
|
||||
import one.bbn.hadder.commands.CommandEvent;
|
||||
import one.bbn.hadder.utils.MessageEditor;
|
||||
import okhttp3.OkHttpClient;
|
||||
import okhttp3.Request;
|
||||
import okhttp3.Response;
|
||||
|
|
@ -18,7 +30,7 @@ import java.util.Random;
|
|||
public class GifCommand implements Command {
|
||||
|
||||
@Override
|
||||
public void executed(String[] args, CommandEvent event) {
|
||||
public void executed(String[] args, CommandEvent e) {
|
||||
if (args.length > 0) {
|
||||
StringBuilder query = new StringBuilder();
|
||||
for (String arg : args) {
|
||||
|
|
@ -27,7 +39,7 @@ public class GifCommand implements Command {
|
|||
}
|
||||
|
||||
OkHttpClient client = new OkHttpClient();
|
||||
Request request = new Request.Builder().url("http://api.giphy.com/v1/gifs/search?q=" + query + "&api_key=" + event.getConfig().getGiphyToken()).build();
|
||||
Request request = new Request.Builder().url("http://api.giphy.com/v1/gifs/search?q=" + query + "&api_key=" + e.getConfig().getGiphyToken()).build();
|
||||
try {
|
||||
Random rand = new Random();
|
||||
Response response = client.newCall(request).execute();
|
||||
|
|
@ -35,15 +47,15 @@ public class GifCommand implements Command {
|
|||
JSONArray array = json.getJSONArray("data");
|
||||
int gifIndex = rand.nextInt(array.length());
|
||||
String url = array.getJSONObject(gifIndex).get("url").toString();
|
||||
event.getTextChannel().sendMessage(url).queue();
|
||||
} catch (Exception e) {
|
||||
event.getTextChannel().sendMessage(
|
||||
event.getMessageEditor().getMessage(
|
||||
e.getTextChannel().sendMessage(url).queue();
|
||||
} catch (Exception ignore) {
|
||||
e.getTextChannel().sendMessage(
|
||||
e.getMessageEditor().getMessage(
|
||||
MessageEditor.MessageType.ERROR,
|
||||
"error",
|
||||
"commands.fun.gif.error.description").build()).queue();
|
||||
}
|
||||
} else event.getHelpCommand().sendHelp(this, event);
|
||||
} else e.getHelpCommand().sendHelp(this, e);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -58,6 +70,11 @@ public class GifCommand implements Command {
|
|||
|
||||
@Override
|
||||
public String usage() {
|
||||
return "<SearchTerm>";
|
||||
return "[term]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String example() {
|
||||
return "cute cat";
|
||||
}
|
||||
}
|
||||
78
src/main/java/one/bbn/hadder/commands/fun/MemeCommand.java
Normal file
78
src/main/java/one/bbn/hadder/commands/fun/MemeCommand.java
Normal file
|
|
@ -0,0 +1,78 @@
|
|||
/*
|
||||
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||
*
|
||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package one.bbn.hadder.commands.fun;
|
||||
|
||||
import one.bbn.hadder.commands.Command;
|
||||
import one.bbn.hadder.commands.CommandEvent;
|
||||
import one.bbn.hadder.utils.MessageEditor;
|
||||
import okhttp3.OkHttpClient;
|
||||
import okhttp3.Request;
|
||||
import okhttp3.Response;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.awt.*;
|
||||
import java.io.IOException;
|
||||
|
||||
public class MemeCommand implements Command {
|
||||
|
||||
@Override
|
||||
public void executed(String[] args, CommandEvent e) {
|
||||
|
||||
OkHttpClient client = new OkHttpClient();
|
||||
Request request = new Request.Builder().url("https://meme-api.herokuapp.com/gimme").build();
|
||||
|
||||
try {
|
||||
Response response = client.newCall(request).execute();
|
||||
JSONObject json = new JSONObject(response.body().string());
|
||||
String url = json.getString("url");
|
||||
e.getTextChannel().sendMessage(
|
||||
e.getMessageEditor().getMessage(MessageEditor.MessageType.INFO,
|
||||
"commands.fun.meme.success.title", "")
|
||||
.setImage(url)
|
||||
.setAuthor("Subreddit: " + json.getString("subreddit"))
|
||||
.build()).queue();
|
||||
} catch (IOException ignore) {
|
||||
e.getTextChannel().sendMessage(
|
||||
e.getMessageEditor().getMessage(
|
||||
MessageEditor.MessageType.ERROR,
|
||||
"error",
|
||||
"commands.fun.meme.api.error")
|
||||
.setColor(Color.RED)
|
||||
.build()).queue();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] labels() {
|
||||
return new String[]{"meme"};
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "commands.fun.meme.help.description";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String usage() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String example() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,56 @@
|
|||
/*
|
||||
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||
*
|
||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package one.bbn.hadder.commands.general;
|
||||
|
||||
import one.bbn.hadder.commands.Command;
|
||||
import one.bbn.hadder.commands.CommandEvent;
|
||||
import one.bbn.hadder.utils.MessageEditor;
|
||||
|
||||
public class AboutCommand implements Command {
|
||||
|
||||
@Override
|
||||
public void executed(String[] args, CommandEvent e) {
|
||||
e.getTextChannel().sendMessage(
|
||||
e.getMessageEditor().getMessage(
|
||||
MessageEditor.MessageType.INFO,
|
||||
"commands.general.about.success.title",
|
||||
"commands.general.about.success.description")
|
||||
.addField(e.getMessageEditor().getTerm("commands.general.about.success.field.one.title"), e.getMessageEditor().getTerm("commands.general.about.success.field.one.description", "(https://donatebot.io/checkout/448554629282922527?buyer=" + e.getAuthor().getId() + "). :smiley:", ""), true)
|
||||
.setThumbnail("https://bbn.one/images/Hadder.png")
|
||||
.build()).queue();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] labels() {
|
||||
return new String[]{"about"};
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "commands.general.about.help.description";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String usage() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String example() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,72 @@
|
|||
/*
|
||||
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||
*
|
||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package one.bbn.hadder.commands.general;
|
||||
|
||||
import one.bbn.hadder.commands.Command;
|
||||
import one.bbn.hadder.commands.CommandEvent;
|
||||
import one.bbn.hadder.utils.EventWaiter;
|
||||
import one.bbn.hadder.utils.MessageEditor;
|
||||
|
||||
public class EqualsCommand implements Command {
|
||||
|
||||
@Override
|
||||
public void executed(String[] args, CommandEvent e) {
|
||||
e.getChannel().sendMessage(
|
||||
e.getMessageEditor().getMessage(
|
||||
MessageEditor.MessageType.INFO,
|
||||
"commands.general.equals.string.first.request", "")
|
||||
.build()).queue();
|
||||
new EventWaiter().newOnMessageEventWaiter(msge -> {
|
||||
String firstString = msge.getMessage().getContentRaw();
|
||||
e.getChannel().sendMessage(
|
||||
e.getMessageEditor().getMessage(
|
||||
MessageEditor.MessageType.INFO,
|
||||
"commands.general.equals.string.second.request",
|
||||
"").build()).queue();
|
||||
new EventWaiter().newOnMessageEventWaiter(msge2 -> {
|
||||
String secondString = msge2.getMessage().getContentRaw();
|
||||
e.getChannel().sendMessage(
|
||||
e.getMessageEditor().getMessage(MessageEditor.MessageType.INFO)
|
||||
.setTitle((firstString.equals(secondString)) ? e.getMessageEditor().getTerm("commands.general.equals.string.equals.true") : e.getMessageEditor().getTerm("commands.general.equals.string.equals.false"))
|
||||
.addField(e.getMessageEditor().getTerm("commands.general.equals.string.first"), firstString, false)
|
||||
.addField(e.getMessageEditor().getTerm("commands.general.equals.string.second"), secondString, false)
|
||||
.addField(e.getMessageEditor().getTerm("commands.general.equals.string.result"), String.valueOf(firstString.equals(secondString)), false)
|
||||
.build()).queue();
|
||||
}, e.getJDA(), e.getAuthor());
|
||||
}, e.getJDA(), e.getAuthor());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] labels() {
|
||||
return new String[]{"equals"};
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "commands.general.equals.help.description";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String usage() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String example() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
114
src/main/java/one/bbn/hadder/commands/general/HelpCommand.java
Normal file
114
src/main/java/one/bbn/hadder/commands/general/HelpCommand.java
Normal file
|
|
@ -0,0 +1,114 @@
|
|||
/*
|
||||
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||
*
|
||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package one.bbn.hadder.commands.general;
|
||||
|
||||
import one.bbn.hadder.commands.Command;
|
||||
import one.bbn.hadder.commands.CommandEvent;
|
||||
import one.bbn.hadder.utils.MessageEditor;
|
||||
import net.dv8tion.jda.api.EmbedBuilder;
|
||||
import net.dv8tion.jda.api.Permission;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class HelpCommand implements Command {
|
||||
|
||||
@Override
|
||||
public void executed(String[] args, CommandEvent e) {
|
||||
if (e.getGuild().getSelfMember().hasPermission(Permission.MESSAGE_EMBED_LINKS)) {
|
||||
if (args.length == 0) {
|
||||
HashMap<String, ArrayList<Command>> hashMap = new HashMap<>();
|
||||
for (Command cmd : e.getCommandHandler().getCommandList()) {
|
||||
if (!hashMap.containsKey(cmd.getClass().getPackageName())) {
|
||||
ArrayList<Command> cmdlist = new ArrayList<>();
|
||||
cmdlist.add(cmd);
|
||||
hashMap.put(cmd.getClass().getPackageName(), cmdlist);
|
||||
} else {
|
||||
hashMap.get(cmd.getClass().getPackageName()).add(cmd);
|
||||
}
|
||||
}
|
||||
EmbedBuilder eb = new EmbedBuilder();
|
||||
for (Map.Entry<String, ArrayList<Command>> entry : hashMap.entrySet()) {
|
||||
if (!entry.getKey().endsWith("owner") || (entry.getKey().endsWith("owner") && (e.getAuthor().getId().equals("477141528981012511") ||
|
||||
e.getAuthor().getId().equals("261083609148948488")))) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (int i = 0; i < entry.getValue().size(); i++) {
|
||||
Command cmd = entry.getValue().get(i);
|
||||
sb.append("`").append(cmd.labels()[0]).append("`");
|
||||
if (i < entry.getValue().size() - 1) sb.append(", ");
|
||||
}
|
||||
String[] ps = entry.getKey().split("\\.");
|
||||
eb.addField(ps[ps.length - 1], sb.toString(), false);
|
||||
}
|
||||
}
|
||||
e.getMessageEditor().getMessage(MessageEditor.MessageType.INFO);
|
||||
e.getChannel().sendMessage(eb.build()).queue();
|
||||
} else {
|
||||
for (Command cmd : e.getCommandHandler().getCommandList()) {
|
||||
for (String label : cmd.labels()) {
|
||||
if (label.equalsIgnoreCase(args[0])) {
|
||||
sendHelp(cmd, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
e.getTextChannel().sendMessage(e.getMessageEditor().getTerm("commands.general.help.error.description")).queue();
|
||||
}
|
||||
}
|
||||
|
||||
public void sendHelp(Command cmd, CommandEvent e) {
|
||||
if (!cmd.getClass().getPackageName().endsWith("owner") || (cmd.getClass().getPackageName().endsWith("owner") &&
|
||||
(e.getAuthor().getId().equals("477141528981012511") || e.getAuthor().getId().equals("261083609148948488")))) {
|
||||
String name = cmd.labels()[0];
|
||||
StringBuilder b = new StringBuilder();
|
||||
b.append(e.getMessageEditor().getTerm("commands.general.help.description")).append(" ").append(e.getMessageEditor().getTerm(cmd.description())).append("\n");
|
||||
if (cmd.usage() != null) {
|
||||
b.append(e.getMessageEditor().getTerm("commands.general.help.usage")).append(" ").append(e.getMongoServer().getPrefix()).append(name).append(" ").append(cmd.usage()).append("\n");
|
||||
}
|
||||
if (cmd.example() != null) {
|
||||
b.append(e.getMessageEditor().getTerm("commands.general.help.example")).append(" ").append(e.getMongoServer().getPrefix()).append(name).append(" ").append(cmd.example());
|
||||
}
|
||||
e.getChannel().sendMessage(e.getMessageEditor().getMessage(
|
||||
MessageEditor.MessageType.INFO)
|
||||
.setTitle(cmd.labels()[0])
|
||||
.setDescription(b.toString())
|
||||
.build()).queue();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] labels() {
|
||||
return new String[]{"help"};
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "commands.general.help.help.description";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String usage() {
|
||||
return "[command]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String example() {
|
||||
return "ban";
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
/*
|
||||
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||
*
|
||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package one.bbn.hadder.commands.general;
|
||||
|
||||
import one.bbn.hadder.commands.Command;
|
||||
import one.bbn.hadder.commands.CommandEvent;
|
||||
import one.bbn.hadder.utils.MessageEditor;
|
||||
|
||||
public class InviteCommand implements Command {
|
||||
|
||||
@Override
|
||||
public void executed(String[] args, CommandEvent e) {
|
||||
e.getTextChannel().sendMessage(
|
||||
e.getMessageEditor().getMessage(
|
||||
MessageEditor.MessageType.INFO,
|
||||
"commands.general.invite.success.title",
|
||||
"",
|
||||
"commands.general.invite.success.description",
|
||||
"(https://discord.com/oauth2/authorize?client_id="
|
||||
+ e.getJDA().getSelfUser().getId()
|
||||
+ "&scope=bot&permissions=1043852663)")
|
||||
.build()).queue();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] labels() {
|
||||
return new String[]{"invite"};
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "commands.general.invite.help.description";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String usage() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String example() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,53 @@
|
|||
/*
|
||||
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||
*
|
||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package one.bbn.hadder.commands.general;
|
||||
|
||||
import one.bbn.hadder.commands.Command;
|
||||
import one.bbn.hadder.commands.CommandEvent;
|
||||
import one.bbn.hadder.utils.MessageEditor;
|
||||
|
||||
public class PingCommand implements Command {
|
||||
|
||||
@Override
|
||||
public void executed(String[] args, CommandEvent e) {
|
||||
e.getJDA().getRestPing().queue(ping -> e.getTextChannel().sendMessage(e.getMessageEditor()
|
||||
.getMessage(MessageEditor.MessageType.INFO)
|
||||
.setTitle("Ping")
|
||||
.setDescription(String.valueOf(ping))
|
||||
.build()).queue());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] labels() {
|
||||
return new String[]{"ping"};
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "commands.general.ping.help.description";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String usage() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String example() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
82
src/main/java/one/bbn/hadder/commands/misc/CodeCommand.java
Normal file
82
src/main/java/one/bbn/hadder/commands/misc/CodeCommand.java
Normal file
|
|
@ -0,0 +1,82 @@
|
|||
/*
|
||||
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||
*
|
||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package one.bbn.hadder.commands.misc;
|
||||
|
||||
import one.bbn.hadder.commands.Command;
|
||||
import one.bbn.hadder.commands.CommandEvent;
|
||||
import one.bbn.hadder.utils.MessageEditor;
|
||||
import okhttp3.OkHttpClient;
|
||||
import okhttp3.Request;
|
||||
import okhttp3.Response;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
public class CodeCommand implements Command {
|
||||
|
||||
@Override
|
||||
public void executed(String[] args, CommandEvent e) {
|
||||
if (args.length > 0) {
|
||||
OkHttpClient client = new OkHttpClient();
|
||||
Request request = new Request.Builder().url("https://canary.discord.com/api/v8/invite/" + args[0] + "?with_counts=true").addHeader("Authorization", "Bot " + e.getConfig().getBotToken()).build();
|
||||
|
||||
try {
|
||||
Response response = client.newCall(request).execute();
|
||||
JSONObject json = new JSONObject(response.body().string());
|
||||
e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.INFO,
|
||||
"commands.misc.code.success.title",
|
||||
"commands.misc.code.success.description")
|
||||
.addField("Code", "[" + args[0] + "](https://discord.gg/" + args[0] + ")", true)
|
||||
.addField("Guild Name", json.getJSONObject("guild").getString("name"), true)
|
||||
.addBlankField(true)
|
||||
.addField("Verification Level", String.valueOf(json.getJSONObject("guild").getInt("verification_level")), true)
|
||||
.addField("Guild ID", json.getJSONObject("guild").getString("id"), true)
|
||||
.addBlankField(true)
|
||||
.addField("Members", String.valueOf(json.get("approximate_member_count")), true)
|
||||
.addBlankField(true)
|
||||
.addBlankField(true)
|
||||
.setThumbnail("https://cdn.discordapp.com/icons/" + json.getJSONObject("guild").getString("id") + "/" + json.getJSONObject("guild").getString("icon") + ".png")
|
||||
.build()).queue();
|
||||
} catch (JSONException ex) {
|
||||
e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.ERROR,
|
||||
"commands.misc.code.error.title",
|
||||
"commands.misc.code.error.description").build()).queue();
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
} else e.getHelpCommand().sendHelp(this, e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] labels() {
|
||||
return new String[]{"code", "invite-code", "ic"};
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "commands.misc.code.help.description";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String usage() {
|
||||
return "[Invite-code]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String example() {
|
||||
return "nPwjaJk";
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,76 @@
|
|||
/*
|
||||
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||
*
|
||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package one.bbn.hadder.commands.misc;
|
||||
|
||||
import one.bbn.hadder.commands.Command;
|
||||
import one.bbn.hadder.commands.CommandEvent;
|
||||
import one.bbn.hadder.utils.MessageEditor;
|
||||
import okhttp3.OkHttpClient;
|
||||
import okhttp3.Request;
|
||||
import okhttp3.Response;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class CoronaCommand implements Command {
|
||||
|
||||
@Override
|
||||
public void executed(String[] args, CommandEvent e) {
|
||||
OkHttpClient client = new OkHttpClient();
|
||||
Request request = new Request.Builder().url("https://corona.lmao.ninja/v2/all").build();
|
||||
|
||||
try {
|
||||
Response response = client.newCall(request).execute();
|
||||
JSONObject json = new JSONObject(response.body().string());
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
stringBuilder
|
||||
.append("`Confirmed cases:` **").append(json.get("cases")).append("**\n")
|
||||
.append("`Deaths:` **").append(json.get("deaths")).append("** \n")
|
||||
.append("`Recovered:` **").append(json.get("recovered")).append("** \n")
|
||||
.append("`Active cases:` **").append(json.get("active")).append("**");
|
||||
e.getTextChannel().sendMessage(e.getMessageEditor()
|
||||
.getMessage(MessageEditor.MessageType.INFO)
|
||||
.setDescription(stringBuilder)
|
||||
.build()).queue();
|
||||
} catch (IOException ex) {
|
||||
e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.ERROR)
|
||||
.setTitle("API Error")
|
||||
.setDescription("Try again later!")
|
||||
.build()).queue();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] labels() {
|
||||
return new String[]{"corona"};
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "commands.misc.corona.help.description";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String usage() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String example() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,87 @@
|
|||
/*
|
||||
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||
*
|
||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package one.bbn.hadder.commands.misc;
|
||||
|
||||
import one.bbn.hadder.commands.Command;
|
||||
import one.bbn.hadder.commands.CommandEvent;
|
||||
import one.bbn.hadder.utils.EventWaiter;
|
||||
import one.bbn.hadder.utils.MessageEditor;
|
||||
import org.kohsuke.github.GHIssue;
|
||||
import org.kohsuke.github.GHRepository;
|
||||
import org.kohsuke.github.GitHub;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class FeedbackCommand implements Command {
|
||||
|
||||
@Override
|
||||
public void executed(String[] args, CommandEvent e) {
|
||||
e.getTextChannel().sendMessage(
|
||||
e.getMessageEditor().getMessage(
|
||||
MessageEditor.MessageType.INFO,
|
||||
"commands.misc.feedback.title.request.title",
|
||||
"commands.misc.feedback.title.request.description")
|
||||
.build()).queue();
|
||||
new EventWaiter().newOnMessageEventWaiter(e1 -> {
|
||||
String title = e1.getMessage().getContentDisplay();
|
||||
e1.getChannel().sendMessage(e.getMessageEditor().getMessage(
|
||||
MessageEditor.MessageType.INFO,
|
||||
"commands.misc.feedback.description.request.title",
|
||||
"commands.misc.feedback.description.request.description")
|
||||
.build()).queue();
|
||||
new EventWaiter().newOnMessageEventWaiter(e2 -> {
|
||||
String description = e2.getMessage().getContentDisplay();
|
||||
try {
|
||||
GitHub connection = GitHub.connectUsingOAuth(e.getConfig().getGitHubToken());
|
||||
GHRepository Hadder = connection.getOrganization("BBN-Holding").getRepository("Hadder");
|
||||
GHIssue issue = Hadder.createIssue(title).body("<strong>Feedback by " + e.getAuthor().getAsTag() + "</strong><br>" + description).label("feedback").create();
|
||||
issue.addLabels("feedback");
|
||||
e.getTextChannel().sendMessage(
|
||||
e.getMessageEditor().getMessage(
|
||||
MessageEditor.MessageType.INFO,
|
||||
"commands.misc.feedback.success.title",
|
||||
"")
|
||||
.setDescription(issue.getHtmlUrl().toString())
|
||||
.build()).queue();
|
||||
} catch (IOException ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}, e.getJDA(), e.getAuthor());
|
||||
}, e.getJDA(), e.getAuthor());
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] labels() {
|
||||
return new String[]{"feedback"};
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "commands.misc.feedback.help.description";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String usage() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String example() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
127
src/main/java/one/bbn/hadder/commands/misc/GitHubCommand.java
Normal file
127
src/main/java/one/bbn/hadder/commands/misc/GitHubCommand.java
Normal file
|
|
@ -0,0 +1,127 @@
|
|||
/*
|
||||
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||
*
|
||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package one.bbn.hadder.commands.misc;
|
||||
|
||||
import one.bbn.hadder.commands.Command;
|
||||
import one.bbn.hadder.commands.CommandEvent;
|
||||
import one.bbn.hadder.utils.MessageEditor;
|
||||
import okhttp3.OkHttpClient;
|
||||
import okhttp3.Request;
|
||||
import okhttp3.Response;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class GitHubCommand implements Command {
|
||||
|
||||
@Override
|
||||
public void executed(String[] args, CommandEvent e) {
|
||||
if (args.length > 0) {
|
||||
if (args[0].equals("link")) {
|
||||
e.getTextChannel().sendMessage(
|
||||
e.getMessageEditor().getMessage(
|
||||
MessageEditor.MessageType.INFO,
|
||||
"commands.misc.github.link.title",
|
||||
"")
|
||||
.setDescription("https://github.com/login/oauth/authorize?client_id=25321f690bb1b6952942")
|
||||
.build()
|
||||
).queue();
|
||||
} else {
|
||||
Request request = new Request.Builder().url("https://api.github.com/users/" + args[0]).build();
|
||||
try {
|
||||
|
||||
Response response = new OkHttpClient().newCall(request).execute();
|
||||
JSONObject json = new JSONObject(response.body().string());
|
||||
|
||||
String nickname = json.getString("name");
|
||||
String bio = "None";
|
||||
String location = "None";
|
||||
String website = "None";
|
||||
try {
|
||||
bio = json.getString("bio");
|
||||
} catch (JSONException ignored) {
|
||||
}
|
||||
try {
|
||||
location = json.getString("location");
|
||||
} catch (JSONException ignored) {
|
||||
}
|
||||
|
||||
if (!json.getString("blog").equals("")) website = json.getString("blog");
|
||||
|
||||
e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.INFO)
|
||||
.setAuthor(e.getMessageEditor().getTerm("commands.misc.github.success.title", nickname + " (" + args[0] + ")", ""), "https://github.com/" + args[0] + "", "https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png")
|
||||
.setThumbnail(json.getString("avatar_url"))
|
||||
.addField(e.getMessageEditor().getTerm("commands.misc.github.success.bio"), bio, false)
|
||||
.addField(e.getMessageEditor().getTerm("commands.misc.github.success.location"), location, true)
|
||||
.addField(e.getMessageEditor().getTerm("commands.misc.github.success.website"), website, true)
|
||||
.addField(e.getMessageEditor().getTerm("commands.misc.github.success.repositories"), String.valueOf(json.getInt("public_repos")), true)
|
||||
.addField(e.getMessageEditor().getTerm("commands.misc.github.success.gists"), String.valueOf(json.getInt("public_gists")), true)
|
||||
.addField(e.getMessageEditor().getTerm("commands.misc.github.success.followers"), String.valueOf(json.getInt("followers")), true)
|
||||
.addField(e.getMessageEditor().getTerm("commands.misc.github.success.following"), String.valueOf(json.getInt("following")), true)
|
||||
.build()).queue();
|
||||
|
||||
} catch (IOException | NullPointerException ex) {
|
||||
e.getTextChannel().sendMessage(
|
||||
e.getMessageEditor().getMessage(
|
||||
MessageEditor.MessageType.ERROR,
|
||||
"commands.misc.github.api.error.title",
|
||||
"commands.misc.github.api.error.description")
|
||||
.build()
|
||||
).queue();
|
||||
} catch (JSONException ex) {
|
||||
e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(
|
||||
MessageEditor.MessageType.ERROR,
|
||||
"commands.misc.github.user.error.title",
|
||||
"commands.misc.github.user.error.description").build()).queue();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
e.getHelpCommand().sendHelp(this, e);
|
||||
/*
|
||||
TODO: THIS
|
||||
e.getTextChannel().sendMessage(
|
||||
e.getMessageEditor().getMessage(
|
||||
MessageEditor.MessageType.INFO,
|
||||
"commands.misc.github.connect.title",
|
||||
"",
|
||||
"commands.misc.github.connect.description",
|
||||
"(https://github.com/login/oauth/authorize?client_id=25321f690bb1b6952942)")
|
||||
.build()).queue(); */
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] labels() {
|
||||
return new String[]{"github"};
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "commands.misc.github.help.description";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String usage() {
|
||||
return "[user]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String example() {
|
||||
return "GregTCLTK";
|
||||
}
|
||||
}
|
||||
102
src/main/java/one/bbn/hadder/commands/misc/MoveAllCommand.java
Normal file
102
src/main/java/one/bbn/hadder/commands/misc/MoveAllCommand.java
Normal file
|
|
@ -0,0 +1,102 @@
|
|||
/*
|
||||
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||
*
|
||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package one.bbn.hadder.commands.misc;
|
||||
|
||||
import one.bbn.hadder.commands.Command;
|
||||
import one.bbn.hadder.commands.CommandEvent;
|
||||
import one.bbn.hadder.core.Perm;
|
||||
import one.bbn.hadder.core.Perms;
|
||||
import one.bbn.hadder.utils.MessageEditor;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
@Perms(Perm.VOICE_MOVE_OTHERS)
|
||||
public class MoveAllCommand implements Command {
|
||||
|
||||
@Override
|
||||
public void executed(String[] args, CommandEvent e) {
|
||||
if (args.length == 2) {
|
||||
if (StringUtils.isNumeric(args[0]) && args[0].length() == 18) {
|
||||
if (StringUtils.isNumeric(args[1]) && args[1].length() == 18) {
|
||||
if (!args[0].equals(args[1])) {
|
||||
int count = e.getGuild().getVoiceChannelById(args[0]).getMembers().size();
|
||||
e.getGuild().getVoiceChannelById(args[0]).getMembers().forEach(
|
||||
member -> e.getGuild().moveVoiceMember(member, e.getGuild().getVoiceChannelById(args[1])).queue()
|
||||
);
|
||||
e.getChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.INFO,
|
||||
"commands.misc.moveall.success.title", "",
|
||||
"commands.misc.moveall.success.description", String.valueOf(count))
|
||||
.build()).queue();
|
||||
} else {
|
||||
e.getChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.ERROR,
|
||||
"commands.misc.moveall.error.equals.title",
|
||||
"commands.misc.moveall.error.equals.description")
|
||||
.build()).queue();
|
||||
}
|
||||
} else {
|
||||
e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.ERROR,
|
||||
"commands.misc.moveall.error.target.int.title",
|
||||
"commands.misc.moveall.error.target.int.description").build()).queue();
|
||||
}
|
||||
} else {
|
||||
e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.ERROR,
|
||||
"commands.misc.moveall.error.source.int.title",
|
||||
"commands.misc.moveall.error.source.int.description").build()).queue();
|
||||
}
|
||||
} else if (args.length == 1) {
|
||||
if (StringUtils.isNumeric(args[0]) && args[0].length() == 18) {
|
||||
if (e.getMember().getVoiceState().inVoiceChannel()) {
|
||||
int count = e.getMember().getVoiceState().getChannel().getMembers().size();
|
||||
e.getMember().getVoiceState().getChannel().getMembers().forEach(
|
||||
member -> e.getGuild().moveVoiceMember(member, e.getGuild().getVoiceChannelById(args[0])).queue()
|
||||
);
|
||||
e.getChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.INFO,
|
||||
"commands.misc.moveall.success.title", "",
|
||||
"commands.misc.moveall.success.description", String.valueOf(count))
|
||||
.build()).queue();
|
||||
} else {
|
||||
e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.ERROR,
|
||||
"commands.misc.moveall.error.source.int.title",
|
||||
"commands.misc.moveall.error.source.int.description").build()).queue();
|
||||
}
|
||||
} else {
|
||||
e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.ERROR,
|
||||
"commands.misc.moveall.error.target.int.title",
|
||||
"commands.misc.moveall.error.target.int.description").build()).queue();
|
||||
}
|
||||
} else e.getHelpCommand().sendHelp(this, e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] labels() {
|
||||
return new String[]{"moveall", "move-all", "ma"};
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "commands.misc.moveall.help.description";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String usage() {
|
||||
return "([source-channel]) [target-channel]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String example() {
|
||||
return "452806287307046923 452858405212782623";
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,92 @@
|
|||
/*
|
||||
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||
*
|
||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package one.bbn.hadder.commands.misc;
|
||||
|
||||
import one.bbn.hadder.commands.Command;
|
||||
import one.bbn.hadder.commands.CommandEvent;
|
||||
import one.bbn.hadder.utils.MessageEditor;
|
||||
import net.dv8tion.jda.api.EmbedBuilder;
|
||||
import net.dv8tion.jda.api.entities.User;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.time.format.DateTimeFormatter;
|
||||
|
||||
public class ProfileCommand implements Command {
|
||||
|
||||
@Override
|
||||
public void executed(String[] args, CommandEvent e) {
|
||||
User u = null;
|
||||
if (args.length == 0) {
|
||||
u = e.getAuthor();
|
||||
} else if (StringUtils.isNumeric(args[0]) && args[0].length() == 18) {
|
||||
u = e.getJDA().getUserById(args[0]);
|
||||
} else if (!StringUtils.isNumeric(args[0]) && args[0].contains("#")) {
|
||||
try {
|
||||
u = e.getJDA().getUserByTag(args[0]);
|
||||
} catch (Exception ex) {
|
||||
e.getChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.ERROR,
|
||||
"commands.misc.profile.error.title",
|
||||
"commands.misc.profile.error.description").build()).queue();
|
||||
return;
|
||||
}
|
||||
} else if (e.getMessage().getMentionedUsers().size() == 1) {
|
||||
u = e.getMessage().getMentionedUsers().get(0);
|
||||
}
|
||||
try {
|
||||
// TODO: Translate
|
||||
EmbedBuilder embed = e.getMessageEditor()
|
||||
.getMessage(MessageEditor.MessageType.INFO)
|
||||
.setTitle("User Information")
|
||||
.addField("Username", u.getName(), true)
|
||||
.addField("Tag", u.getAsTag(), true)
|
||||
.addField("ID", u.getId(), true)
|
||||
.addField("Account Creation Date", u.getTimeCreated()
|
||||
.format(DateTimeFormatter.ISO_DATE_TIME).replace("T", " ").replace("Z", ""), true)
|
||||
.addField("Nickname", e.getGuild().getMember(u).getEffectiveName(), true)
|
||||
.addField("Guild Join Date", e.getGuild().getMember(u).getTimeJoined()
|
||||
.format(DateTimeFormatter.ISO_DATE_TIME).replace("T", " ").replace("Z", ""), true)
|
||||
.addField("Roles", String.valueOf(e.getGuild().getMember(u).getRoles().size()), true);
|
||||
|
||||
e.getChannel().sendMessage(embed.build()).queue();
|
||||
} catch (NullPointerException ex) {
|
||||
e.getChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.ERROR,
|
||||
"commands.misc.profile.error.title",
|
||||
"commands.misc.profile.error.description").build()).queue();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] labels() {
|
||||
return new String[]{"profile", "user", "userinfo"};
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "commands.misc.profile.help.description";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String usage() {
|
||||
return "[user/id]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String example() {
|
||||
return "Hax#6775";
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,97 @@
|
|||
/*
|
||||
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||
*
|
||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package one.bbn.hadder.commands.misc;
|
||||
|
||||
import one.bbn.hadder.commands.Command;
|
||||
import one.bbn.hadder.commands.CommandEvent;
|
||||
import one.bbn.hadder.utils.EventWaiter;
|
||||
import one.bbn.hadder.utils.MessageEditor;
|
||||
import net.dv8tion.jda.api.EmbedBuilder;
|
||||
import net.dv8tion.jda.api.entities.VoiceChannel;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ScreenShareCommand implements Command {
|
||||
|
||||
@Override
|
||||
public void executed(String[] args, CommandEvent e) {
|
||||
if (args.length > 0) {
|
||||
if (args[0].matches("[0-9]*") && args.length == 1 && args[0].length() == 18) {
|
||||
if (e.getGuild().getVoiceChannelById(args[0]) != null) {
|
||||
e.getChannel().sendMessage(e.getMessageEditor().getMessage(
|
||||
MessageEditor.MessageType.INFO,
|
||||
"commands.misc.screenshare.success.title", "")
|
||||
.setDescription("http://discord.com/channels/" + e.getGuild().getId() + "/" + args[0] + "/").build()).queue();
|
||||
} else {
|
||||
e.getChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.ERROR, "commands.misc.screenshare.id.error.title", "commands.misc.screenshare.id.error.description").build()).queue();
|
||||
e.getHelpCommand().sendHelp(this, e);
|
||||
}
|
||||
} else {
|
||||
List<VoiceChannel> vcs = e.getGuild().getVoiceChannelsByName(String.join(" ", args), true);
|
||||
if (vcs.size() > 1) {
|
||||
EmbedBuilder eb = e.getMessageEditor().getMessage(MessageEditor.MessageType.WARNING, "commands.misc.screenshare.channel.error.title", "commands.misc.screenshare.channel.error.description");
|
||||
for (int i = 0; i < vcs.size(); i++) {
|
||||
VoiceChannel voiceChannel = vcs.get(i);
|
||||
eb.addField(i + ": " + voiceChannel.getName(), voiceChannel.getId(), false);
|
||||
}
|
||||
e.getChannel().sendMessage(eb.build()).queue();
|
||||
new EventWaiter().newOnMessageEventWaiter(msge -> {
|
||||
try {
|
||||
int i = Integer.parseInt(msge.getMessage().getContentRaw());
|
||||
if (vcs.size() > i) {
|
||||
e.getChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.INFO, "commands.misc.screenshare.success.title", "")
|
||||
.setDescription("http://discord.com/channels/" + e.getGuild().getId() + "/" + vcs.get(i).getId() + "/").build()).queue();
|
||||
} else {
|
||||
e.getChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.ERROR, "commands.misc.screenshare.number.error.title", "").build()).queue();
|
||||
e.getHelpCommand().sendHelp(this, e);
|
||||
}
|
||||
} catch (NumberFormatException ex) {
|
||||
e.getChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.ERROR, "commands.misc.screenshare.id.error.title", "commands.misc.screenshare.number.error.description").build()).queue();
|
||||
e.getHelpCommand().sendHelp(this, e);
|
||||
}
|
||||
}, e.getJDA(), e.getAuthor());
|
||||
} else if (vcs.size() == 0) {
|
||||
e.getChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.ERROR, "commands.misc.screenshare.channel.existing.error", "commands.misc.screenshare.channel.existing.description").build()).queue();
|
||||
e.getHelpCommand().sendHelp(this, e);
|
||||
} else {
|
||||
e.getChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.INFO, "commands.misc.screenshare.success.title", "")
|
||||
.setDescription("http://discord.com/channels/" + e.getGuild().getId() + "/" + vcs.get(0).getId() + "/").build()).queue();
|
||||
}
|
||||
}
|
||||
} else e.getHelpCommand().sendHelp(this, e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] labels() {
|
||||
return new String[]{"screenshare"};
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "commands.misc.screenshare.help.description";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String usage() {
|
||||
return "[channel]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String example() {
|
||||
return "Talk";
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,76 @@
|
|||
/*
|
||||
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||
*
|
||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package one.bbn.hadder.commands.misc;
|
||||
|
||||
import one.bbn.hadder.commands.Command;
|
||||
import one.bbn.hadder.commands.CommandEvent;
|
||||
import one.bbn.hadder.utils.MessageEditor;
|
||||
import net.dv8tion.jda.api.EmbedBuilder;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class ServerStatsCommand implements Command {
|
||||
|
||||
@Override
|
||||
public void executed(String[] args, CommandEvent e) {
|
||||
EmbedBuilder eb = e.getMessageEditor().getMessage(MessageEditor.MessageType.INFO,
|
||||
"commands.misc.serverstats.title", "",
|
||||
"commands.misc.serverstats.description", e.getGuild().getName())
|
||||
.addField("Owner", e.getGuild().getOwner().getUser().getAsTag(), true)
|
||||
.addField("ID", e.getGuild().getId(), true)
|
||||
.addField("Region", e.getGuild().getRegion().getName(), true)
|
||||
.addField("Time created", new Date(e.getGuild().getTimeCreated().toInstant().toEpochMilli()).toString(), true)
|
||||
.addField("Roles", String.valueOf(e.getGuild().getRoles().size()), true)
|
||||
.addField("Emotes", String.valueOf(e.getGuild().getEmotes().size()), true)
|
||||
.addField("Categories", String.valueOf(e.getGuild().getCategories().size()), true)
|
||||
.addField("Text/Voice/Store Channels", "`" + e.getGuild().getTextChannels().size() + "`" + "/" + "`" + e.getGuild().getVoiceChannels().size() + "`" + "/" + "`" + e.getGuild().getStoreChannels().size() + "`", true)
|
||||
.addField("Verification Level", e.getGuild().getVerificationLevel().getKey() + ": " + e.getGuild().getVerificationLevel(), true)
|
||||
.addField("MFA Level", String.valueOf(e.getGuild().getRequiredMFALevel().getKey()), true)
|
||||
.addField("Member Count", String.valueOf(e.getGuild().getMemberCount()), true)
|
||||
.addField("Explicit Content Level", e.getGuild().getExplicitContentLevel().getKey() + ": " + e.getGuild().getExplicitContentLevel(), true)
|
||||
.addField("Features", e.getGuild().getFeatures().toString().replaceAll("\\[", "`").replaceAll(",", "`, `").replaceAll("]", "`"), true)
|
||||
.addBlankField(true)
|
||||
.setThumbnail(e.getGuild().getIconUrl())
|
||||
.setImage(e.getGuild().getBannerUrl());
|
||||
|
||||
if (e.getGuild().getDescription() != null) eb.addField("Description", e.getGuild().getDescription(), true);
|
||||
if (e.getGuild().getVanityCode() != null)
|
||||
eb.addField("Vanity Code", "[" + e.getGuild().getVanityCode() + "](https://discord.gg/" + e.getGuild().getVanityCode() + ")", true);
|
||||
|
||||
e.getTextChannel().sendMessage(eb.build()).queue();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] labels() {
|
||||
return new String[]{"serverstats", "guildstats"};
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "commands.misc.serverstats.help.description";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String usage() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String example() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
112
src/main/java/one/bbn/hadder/commands/moderation/BanCommand.java
Normal file
112
src/main/java/one/bbn/hadder/commands/moderation/BanCommand.java
Normal file
|
|
@ -0,0 +1,112 @@
|
|||
/*
|
||||
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||
*
|
||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package one.bbn.hadder.commands.moderation;
|
||||
|
||||
import one.bbn.hadder.commands.Command;
|
||||
import one.bbn.hadder.commands.CommandEvent;
|
||||
import one.bbn.hadder.core.Perm;
|
||||
import one.bbn.hadder.core.Perms;
|
||||
import one.bbn.hadder.utils.MessageEditor;
|
||||
import net.dv8tion.jda.api.entities.Member;
|
||||
|
||||
@Perms(Perm.BAN_MEMBERS)
|
||||
public class BanCommand implements Command {
|
||||
|
||||
@Override
|
||||
public void executed(String[] args, CommandEvent e) {
|
||||
if (e.getMessage().getMentionedMembers().size() == 1) {
|
||||
Member victim = e.getMessage().getMentionedMembers().get(0);
|
||||
if (!e.getAuthor().getId().equals(victim.getId())) {
|
||||
if (!e.getJDA().getSelfUser().getId().equals(victim.getId())) {
|
||||
if (e.getGuild().getSelfMember().canInteract(victim)) {
|
||||
e.getGuild().ban(victim, 0, "Banned by " + e.getAuthor().getAsTag()).queue();
|
||||
e.getTextChannel().sendMessage(
|
||||
e.getMessageEditor().getMessage(
|
||||
MessageEditor.MessageType.INFO,
|
||||
"commands.moderation.ban.success.title",
|
||||
"",
|
||||
"commands.moderation.ban.success.description",
|
||||
victim.getUser().getName() + ".").build()).queue();
|
||||
} else {
|
||||
e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.NO_SELF_PERMISSION).build()).queue();
|
||||
}
|
||||
} else {
|
||||
e.getTextChannel().sendMessage(
|
||||
e.getMessageEditor().getMessage(
|
||||
MessageEditor.MessageType.ERROR,
|
||||
"commands.moderation.ban.error.title",
|
||||
"commands.moderation.ban.myself.error.description").build()).queue();
|
||||
}
|
||||
} else {
|
||||
e.getTextChannel().sendMessage
|
||||
(e.getMessageEditor().getMessage(
|
||||
MessageEditor.MessageType.ERROR,
|
||||
"commands.moderation.ban.error.title",
|
||||
"commands.moderation.ban.yourself.error.description").build()).queue();
|
||||
}
|
||||
} else if (e.getMessage().getMentionedMembers().size() > 1) {
|
||||
for (int i = 0; i < e.getMessage().getMentionedMembers().size(); i++) {
|
||||
Member member = e.getMessage().getMentionedMembers().get(i);
|
||||
if (!e.getAuthor().getId().equals(member.getId())) {
|
||||
if (!e.getJDA().getSelfUser().getId().equals(member.getId())) {
|
||||
if (e.getGuild().getSelfMember().canInteract(member)) {
|
||||
e.getGuild().ban(member, 0).reason("Mass Ban by " + e.getAuthor().getAsTag()).queue();
|
||||
} else {
|
||||
e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.NO_SELF_PERMISSION).build()).queue();
|
||||
}
|
||||
} else {
|
||||
e.getTextChannel().sendMessage(
|
||||
e.getMessageEditor().getMessage(
|
||||
MessageEditor.MessageType.ERROR,
|
||||
"commands.moderation.ban.error.title",
|
||||
"commands.moderation.ban.myself.error.description").build()).queue();
|
||||
}
|
||||
} else {
|
||||
e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(
|
||||
MessageEditor.MessageType.ERROR,
|
||||
"commands.moderation.ban.error.title",
|
||||
"commands.moderation.ban.yourself.error.description").build()).queue();
|
||||
}
|
||||
}
|
||||
e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.INFO,
|
||||
"commands.moderation.ban.success.title",
|
||||
"",
|
||||
"commands.moderation.ban.massban.success.description",
|
||||
String.valueOf(e.getMessage().getMentionedMembers().size())).build()).queue();
|
||||
} else e.getHelpCommand().sendHelp(this, e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] labels() {
|
||||
return new String[]{"ban"};
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "commands.moderation.ban.help.description";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String usage() {
|
||||
return "[user]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String example() {
|
||||
return "@Skidder";
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,117 @@
|
|||
/*
|
||||
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||
*
|
||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package one.bbn.hadder.commands.moderation;
|
||||
|
||||
import one.bbn.hadder.commands.Command;
|
||||
import one.bbn.hadder.commands.CommandEvent;
|
||||
import one.bbn.hadder.core.Perm;
|
||||
import one.bbn.hadder.core.Perms;
|
||||
import one.bbn.hadder.utils.MessageEditor;
|
||||
import net.dv8tion.jda.api.Permission;
|
||||
import net.dv8tion.jda.api.entities.Message;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
@Perms(Perm.MANAGE_MESSAGES)
|
||||
public class ClearCommand implements Command {
|
||||
|
||||
@Override
|
||||
public void executed(String[] args, CommandEvent e) {
|
||||
if (args.length > 0) {
|
||||
if (e.getGuild().getSelfMember().hasPermission(Permission.MESSAGE_MANAGE)) {
|
||||
if (args[0].equals("all")) {
|
||||
List<Message> msg = e.getTextChannel().getIterableHistory().complete();
|
||||
for (Message message : msg) {
|
||||
message.delete().queue();
|
||||
}
|
||||
Message message = e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(
|
||||
MessageEditor.MessageType.INFO,
|
||||
"commands.moderation.clear.all.success.title",
|
||||
"",
|
||||
"commands.moderation.clear.all.success.description",
|
||||
String.valueOf(msg.size()))
|
||||
.build()).complete();
|
||||
try {
|
||||
TimeUnit.SECONDS.sleep(3);
|
||||
} catch (InterruptedException ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
message.delete().queue();
|
||||
} else {
|
||||
try {
|
||||
int nbToDelete = Integer.parseInt(args[0]);
|
||||
if (nbToDelete < 1 || nbToDelete > 99) {
|
||||
e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.ERROR, "commands.moderation.clear.number.error.title", "commands.moderation.clear.number.error.description").build()).queue();
|
||||
} else {
|
||||
List<Message> history = e.getTextChannel().getHistory().retrievePast(nbToDelete + 1).complete();
|
||||
List<Message> msgToDelete = new ArrayList<>(history);
|
||||
e.getTextChannel().deleteMessages(msgToDelete).queue();
|
||||
if (nbToDelete == 1) {
|
||||
Message msg = e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.INFO, "commands.moderation.clear.success.title",
|
||||
"commands.moderation.clear.success.description.singular").build()).complete();
|
||||
try {
|
||||
TimeUnit.SECONDS.sleep(2);
|
||||
} catch (InterruptedException ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
msg.delete().queue();
|
||||
} else {
|
||||
Message msg = e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.INFO, "commands.moderation.clear.success.title", "",
|
||||
"commands.moderation.clear.success.description.plural", String.valueOf(nbToDelete)).build()).complete();
|
||||
try {
|
||||
TimeUnit.SECONDS.sleep(2);
|
||||
} catch (InterruptedException ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
msg.delete().queue();
|
||||
}
|
||||
}
|
||||
} catch (NumberFormatException ex) {
|
||||
e.getHelpCommand().sendHelp(this, e);
|
||||
} catch (IllegalArgumentException ex) {
|
||||
e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.ERROR, "commands.moderation.clear.message.error.title", "commands.moderation.clear.message.error.description")
|
||||
.build()).queue();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.NO_SELF_PERMISSION).build()).queue();
|
||||
}
|
||||
} else e.getHelpCommand().sendHelp(this, e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] labels() {
|
||||
return new String[]{"clear"};
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "commands.moderation.clear.help.description";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String usage() {
|
||||
return "[amount]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String example() {
|
||||
return "69";
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,115 @@
|
|||
/*
|
||||
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||
*
|
||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package one.bbn.hadder.commands.moderation;
|
||||
|
||||
import one.bbn.hadder.commands.Command;
|
||||
import one.bbn.hadder.commands.CommandEvent;
|
||||
import one.bbn.hadder.core.Perm;
|
||||
import one.bbn.hadder.core.Perms;
|
||||
import one.bbn.hadder.utils.MessageEditor;
|
||||
import net.dv8tion.jda.api.entities.TextChannel;
|
||||
|
||||
@Perms(Perm.MANAGE_SERVER)
|
||||
public class EditRulesCommand implements Command {
|
||||
|
||||
@Override
|
||||
public void executed(String[] args, CommandEvent e) {
|
||||
if (e.getMongoServer().getMessageID().length() == 18) {
|
||||
e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.INFO,
|
||||
"commands.moderation.editrules.message.title",
|
||||
"commands.moderation.editrules.message.description").build()).queue();
|
||||
|
||||
e.getEventWaiter().newOnMessageEventWaiter(e1 -> {
|
||||
String rules = e1.getMessage().getContentRaw();
|
||||
e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.INFO,
|
||||
"commands.moderation.editrules.channel.title",
|
||||
"commands.moderation.editrules.channel.description").build()).queue();
|
||||
|
||||
e.getEventWaiter().newOnMessageEventWaiter(e2 -> {
|
||||
if (e2.getMessage().getMentionedChannels().size() == 1) {
|
||||
try {
|
||||
TextChannel channel = e2.getMessage().getMentionedChannels().get(0);
|
||||
checkChannel(e, rules, channel);
|
||||
} catch (Exception ex) {
|
||||
e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.ERROR,
|
||||
"commands.moderation.editrules.channel.error.title",
|
||||
"commands.moderation.editrules.channel.error.description")
|
||||
.build()).queue();
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
TextChannel channel = e1.getGuild().getTextChannelsByName(e2.getMessage().getContentRaw(), true).get(0);
|
||||
checkChannel(e, rules, channel);
|
||||
} catch (Exception ex) {
|
||||
e.getTextChannel().sendMessage(
|
||||
e.getMessageEditor().getMessage(
|
||||
MessageEditor.MessageType.ERROR,
|
||||
"commands.moderation.editrules.channel.error.title",
|
||||
"commands.moderation.editrules.channel.error.description")
|
||||
.build()).queue();
|
||||
}
|
||||
}
|
||||
}, e.getJDA(), e.getAuthor());
|
||||
}, e.getJDA(), e.getAuthor());
|
||||
} else {
|
||||
e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.ERROR,
|
||||
"commands.moderation.editrules.error.title", "",
|
||||
"commands.moderation.editrules.error.description", e.getMongoServer().getPrefix()).build()).queue();
|
||||
}
|
||||
}
|
||||
|
||||
public void checkChannel(CommandEvent e, String rules, TextChannel channel) {
|
||||
try {
|
||||
channel.retrieveMessageById(e.getMongoServer().getMessageID()).queue();
|
||||
setRules(e, rules, channel);
|
||||
e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.INFO,
|
||||
"commands.moderation.editrules.success.title",
|
||||
"commands.moderation.editrules.success.description").build()).queue();
|
||||
} catch (Exception ex) {
|
||||
e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.ERROR,
|
||||
"commands.moderation.editrules.channel.message.error.title",
|
||||
"commands.moderation.editrules.channel.message.error.description").build()).queue();
|
||||
}
|
||||
}
|
||||
|
||||
public void setRules(CommandEvent e, String rules, TextChannel channel) {
|
||||
channel.retrieveMessageById(e.getMongoServer().getMessageID()).complete().editMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.INFO)
|
||||
.setTitle("Rules")
|
||||
.setDescription(rules)
|
||||
.build()).queue();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] labels() {
|
||||
return new String[]{"editrules", "rulesedit", "edit_rules", "rules_edit"};
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "commands.moderation.editrules.help.description";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String usage() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String example() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue