Compare commits
451 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 |
113 changed files with 1796 additions and 1976 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]
|
on: [push]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v2.3.4
|
||||||
- name: Set up JDK 1.13
|
- name: Set up JDK 15
|
||||||
uses: actions/setup-java@v1
|
uses: actions/setup-java@v1.4.3
|
||||||
with:
|
with:
|
||||||
java-version: 1.13
|
java-version: '15'
|
||||||
- name: Build with Maven
|
- name: Build with Maven
|
||||||
run: mvn -B package --file pom.xml
|
run: mvn -B package --file pom.xml
|
||||||
|
|
||||||
deploy:
|
deploy:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: build
|
needs: build
|
||||||
if: github.ref == 'refs/heads/master'
|
if: github.ref == 'refs/heads/master'
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v2.3.4
|
||||||
- name: Set up JDK 1.13
|
- name: Set up JDK 15
|
||||||
uses: actions/setup-java@v1
|
uses: actions/setup-java@v1.4.3
|
||||||
with:
|
with:
|
||||||
java-version: 1.13
|
java-version: '15'
|
||||||
- name: Build Final Jar
|
- name: Build Final Jar
|
||||||
run: mvn clean compile assembly:single
|
run: mvn clean compile assembly:single
|
||||||
- name: Copy folder content recursively to remote
|
- name: Copy folder content recursively to remote
|
||||||
uses: garygrossgarten/github-action-scp@release
|
uses: garygrossgarten/github-action-scp@release
|
||||||
with:
|
with:
|
||||||
local: ./target/Hadder-Build.jar
|
local: ./target/Hadder-Build.jar
|
||||||
remote: /home/Hadder-Build.jar
|
remote: /root/bots/Hadder/Hadder-Build.jar
|
||||||
host: ${{ secrets.HOST }}
|
host: ${{ secrets.HOST }}
|
||||||
|
port: ${{ secrets.PORT }}
|
||||||
username: ${{ secrets.USERNAME }}
|
username: ${{ secrets.USERNAME }}
|
||||||
password: ${{ secrets.PASSWORD }}
|
password: ${{ secrets.PASSWORD }}
|
||||||
- name: executing remote ssh commands using password
|
- name: executing remote ssh commands using password
|
||||||
|
|
@ -41,7 +42,7 @@ jobs:
|
||||||
username: ${{ secrets.USERNAME }}
|
username: ${{ secrets.USERNAME }}
|
||||||
password: ${{ secrets.PASSWORD }}
|
password: ${{ secrets.PASSWORD }}
|
||||||
port: ${{ secrets.PORT }}
|
port: ${{ secrets.PORT }}
|
||||||
script: /home/deploy.sh
|
script: /root/bots/Hadder/deploy.sh
|
||||||
- name: Send Webhook Notification
|
- name: Send Webhook Notification
|
||||||
if: always()
|
if: always()
|
||||||
env:
|
env:
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@ If a community member engages in unacceptable behavior, the community organizers
|
||||||
|
|
||||||
## 7. Reporting Guidelines
|
## 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
|
## 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
|
## 10. Contact info
|
||||||
|
|
||||||
admin@bigbotnetwork.com
|
admin@bbn.one
|
||||||
|
|
||||||
## 11. License and attribution
|
## 11. License and attribution
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,7 @@ further defined and clarified by project maintainers.
|
||||||
### Enforcement
|
### Enforcement
|
||||||
|
|
||||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||||
reported by contacting the project team on [Discord](https://discordapp.com/invite/58My2dM). 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
|
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
|
is deemed necessary and appropriate to the circumstances. The project team is
|
||||||
obligated to maintain confidentiality with regard to the reporter of an incident.
|
obligated to maintain confidentiality with regard to the reporter of an incident.
|
||||||
|
|
|
||||||
85
README.md
85
README.md
|
|
@ -2,20 +2,14 @@
|
||||||
|
|
||||||
Hadder Discord is a multi-purpose Discord bot with 100% uptime.
|
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>
|
<a href="https://discord.gg/nPwjaJk"><img src="https://discord.com/api/guilds/757966278936756345/embed.png"/></a>
|
||||||
[](https://github.com/BigBotNetwork/Hadder)
|
[](https://github.com/BBN-Holding/Hadder)
|
||||||
[](https://www.codacy.com/gh/BigBotNetwork/Hadder?utm_source=github.com&utm_medium=referral&utm_content=BigBotNetwork/Hadder&utm_campaign=Badge_Grade)
|
[](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://www.codefactor.io/repository/github/bigbotnetwork/hadder)
|
||||||
[](https://bbn.crowdin.com/hadder)
|
[](https://bbn.crowdin.com/hadder)
|
||||||
[](https://github.com/BigBotNetwork/Hadder/issues)
|
[](https://github.com/BBN-Holding/Hadder/issues)
|
||||||
[](https://github.com/BigBotNetwork/Hadder/blob/master/LICENSE)
|
[](https://github.com/BBN-Holding/Hadder/blob/master/LICENSE)
|
||||||
[](https://wakatime.com/badge/github/BigBotNetwork/Hadder)
|
[](https://wakatime.com/badge/github/BBN-Holding/Hadder)
|
||||||
|
|
||||||
[](Https://Mythicalbots.Xyz/Bot/637002314162372639)
|
|
||||||
[](https://top.gg/bot/637002314162372639)
|
|
||||||
[](https://botlist.space/bot/637002314162372639?utm_source=bls&utm_medium=widget&utm_campaign=637002314162372639)
|
|
||||||
[](https://discordbotlist.com/bots/637002314162372639)
|
|
||||||
[](https://arcane-botcenter.xyz/bot/637002314162372639)
|
|
||||||
|
|
||||||
## Hadder Team
|
## Hadder Team
|
||||||
### Developer
|
### Developer
|
||||||
|
|
@ -25,34 +19,43 @@ Hax#6775
|
||||||
## A few commands
|
## A few commands
|
||||||
| **Command** | **Description** |
|
| **Command** | **Description** |
|
||||||
|----------------|---------------------------------------------------------------|
|
|----------------|---------------------------------------------------------------|
|
||||||
| h.help | Shows each command and explains its usage. |
|
| h.about | Shows information about Hadder |
|
||||||
| h.about | Shows information about Hadder. |
|
| h.avatar | Sends the avatar of the specified Member |
|
||||||
| h.equals | Checks if two strings are the same. |
|
| h.ban | Bans one or more users from the server |
|
||||||
| h.invite | Shows the invite link to invite Hadder to your server. |
|
| h.bass | Change the bass for the song which is played at the moment |
|
||||||
| h.ping | Shows the ping to the Discord API. |
|
| h.clear | Deletes the specified number of messages |
|
||||||
| h.avatar | Sends the avatar of the specified member. |
|
| h.clyde | Sends a message as a webhook named Clyde |
|
||||||
| h.gif | Looks for a GIF on Giphy. |
|
| h.code | Shows information about a invite code |
|
||||||
| h.meme | Sends you a random meme. |
|
| h.corona | Shows the newest stats of COVID-19 |
|
||||||
| h.clyde | Sends a message as a webhook named Clyde. |
|
| h.echo | Sends your voice through Hadder |
|
||||||
| h.feedback | Sends feedback directly to the developers. |
|
| h.editrules | Edits the rules message |
|
||||||
| h.github | Displays information about a GitHub user profile. |
|
| h.equals | Checks if two strings are equal |
|
||||||
| h.screenshare | Shows you the link to share your screen. |
|
| h.feedback | Sends feedback directly to the developers |
|
||||||
| h.ban | Bans one or more users from the server. |
|
| h.gif | Looks for a GIF on Giphy |
|
||||||
| h.clear | Deletes the specified number of messages. |
|
| h.github | Displays information about a GitHub user profile |
|
||||||
| h.prefix | Sets the Guild-Prefix. |
|
| h.help | Shows each command and explains its usage |
|
||||||
| h.invitedetect | Activate or deactivate the Discord invite link detection. |
|
| h.info | Shows information about the playing song |
|
||||||
| h.kick | Kicks one or more user from the server. |
|
| h.invite | Shows the invitation link to invite Hadder to your server |
|
||||||
| h.nick | Rename a one or more user. |
|
| h.invitedetect | Activate or deactivate the Discord invite link detection |
|
||||||
| h.regionchange | Changes the server region to locked regions. |
|
| 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.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.rules | Setup the rules on your Discord server |
|
||||||
| h.starboard | Sets the starboard channel. |
|
| h.screenshare | Shows you the link to share your screen |
|
||||||
| h.editrules | Edits the rules message. |
|
| h.serverstats | Shows information about a server |
|
||||||
| h.join | Joins your voice channel. |
|
| h.skip | Skips the currently playing song |
|
||||||
| h.leave | Leaves your voice channel. |
|
| h.starboard | Sets the starboard channel |
|
||||||
| h.play | Plays the specified song. |
|
| h.stop | Stops the song |
|
||||||
| h.stop | Stops the song. |
|
| h.volume | Change the volume of the music |
|
||||||
| h.info | Shows information about the playing song. |
|
|
||||||
| h.queue | Shows the music queue. |
|
|
||||||
| h.skip | Skips the currently playing 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'
|
commit_message: 'New %language% translation'
|
||||||
files:
|
files:
|
||||||
- source: /src/main/resources/Translations/Translations_en.properties
|
- source: /src/main/resources/Translations/Translations_en.properties
|
||||||
|
|
|
||||||
|
|
@ -1,26 +1,17 @@
|
||||||
{
|
{
|
||||||
"Owners":
|
"Owners": [
|
||||||
[],
|
],
|
||||||
"Database":{"IP":"",
|
"Database": {
|
||||||
|
"IP": "",
|
||||||
"Port": 6775,
|
"Port": 6775,
|
||||||
"DBName": "",
|
"DBName": "",
|
||||||
"Username": "",
|
"Username": "",
|
||||||
"Password": ""},
|
"Password": ""
|
||||||
|
},
|
||||||
"Tokens": {
|
"Tokens": {
|
||||||
"BotToken": "",
|
"BotToken": "",
|
||||||
"Giphy": "",
|
"Giphy": "",
|
||||||
"GitHub": "",
|
"GitHub": ""
|
||||||
"MythicalBotList": "",
|
|
||||||
"BotsForDiscord": "",
|
|
||||||
"DiscordBotList": "",
|
|
||||||
"DiscordBestBots": "",
|
|
||||||
"DiscordBoats": "",
|
|
||||||
"YetAnotherBotList": "",
|
|
||||||
"DiscordExtremeList": "",
|
|
||||||
"DiscordBotReviews": "",
|
|
||||||
"DiscordBots": "",
|
|
||||||
"BotListSpace": "",
|
|
||||||
"DiscordBots2": ""
|
|
||||||
},
|
},
|
||||||
"Clyde": ""
|
"Clyde": ""
|
||||||
}
|
}
|
||||||
|
|
|
||||||
298
pom.xml
298
pom.xml
|
|
@ -1,180 +1,138 @@
|
||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
<?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">
|
<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>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>Hadder</groupId>
|
<groupId>Hadder</groupId>
|
||||||
<artifactId>Hadder</artifactId>
|
<artifactId>Hadder</artifactId>
|
||||||
<version>1.3.14</version>
|
<version>2.0.4</version>
|
||||||
<name>Hadder</name>
|
<name>Hadder</name>
|
||||||
<inceptionYear>2019</inceptionYear>
|
<inceptionYear>2019</inceptionYear>
|
||||||
<description>Hadder is a multi-purpose Discord bot.</description>
|
<description>Hadder is a multi-purpose Discord bot.</description>
|
||||||
<url>https://github.com/BigBotNetwork/Hadder</url>
|
<url>https://github.com/BBN-Holding/Hadder</url>
|
||||||
|
|
||||||
<licenses>
|
<licenses>
|
||||||
<license>
|
<license>
|
||||||
<name>GNU Affero General Public License v3.0</name>
|
<name>GNU Affero General Public License v3.0</name>
|
||||||
<url>https://www.gnu.org/licenses/agpl-3.0.en.html</url>
|
<url>https://www.gnu.org/licenses/agpl-3.0.en.html</url>
|
||||||
<distribution>repo</distribution>
|
<distribution>repo</distribution>
|
||||||
</license>
|
</license>
|
||||||
</licenses>
|
</licenses>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
<maven.compiler.source>1.13</maven.compiler.source>
|
<maven.compiler.source>1.15</maven.compiler.source>
|
||||||
<maven.compiler.target>1.13</maven.compiler.target>
|
<maven.compiler.target>1.15</maven.compiler.target>
|
||||||
<maven.build.timestamp.format>yyyy-MM-dd'T'HH:mm:ss'Z'</maven.build.timestamp.format>
|
<maven.build.timestamp.format>yyyy-MM-dd'T'HH:mm:ss'Z'</maven.build.timestamp.format>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<developers>
|
<developers>
|
||||||
<developer>
|
<developer>
|
||||||
<id>Hax#6775</id>
|
<id>Hax#6775</id>
|
||||||
<name>Hax</name>
|
<name>Hax</name>
|
||||||
<email>hax@bigbotnetwork.com</email>
|
<email>hax@bbn.one</email>
|
||||||
<url>https://bigbotnetwork.com/</url>
|
<url>https://bbn.one/</url>
|
||||||
<timezone>Europe/Berlin</timezone>
|
<timezone>Europe/Berlin</timezone>
|
||||||
<properties>
|
<properties>
|
||||||
<picUrl>https://cdn.discordapp.com/avatars/261083609148948488/f2c9efc629ef65fffa634f0d63cd467e.webp</picUrl>
|
<picUrl>https://cdn.discordapp.com/avatars/261083609148948488/f2c9efc629ef65fffa634f0d63cd467e.webp
|
||||||
</properties>
|
</picUrl>
|
||||||
</developer>
|
</properties>
|
||||||
<developer>
|
</developer>
|
||||||
<id>Skidder#6775</id>
|
<developer>
|
||||||
<name>Greg</name>
|
<id>Skidder#6775</id>
|
||||||
<email>skidder@bigbotnetwork.com</email>
|
<name>Greg</name>
|
||||||
<url>https://bigbotnetwork.com/</url>
|
<email>skidder@bbn.one</email>
|
||||||
<timezone>Europe/Berlin</timezone>
|
<url>https://bbn.one/</url>
|
||||||
<properties>
|
<timezone>Europe/Berlin</timezone>
|
||||||
<picUrl>https://cdn.discordapp.com/avatars/477141528981012511/a_ba4bd8e5b381874edcd06a68d1acd3aa.gif</picUrl>
|
<properties>
|
||||||
</properties>
|
<picUrl>https://cdn.discordapp.com/avatars/401817301919465482/a_f81bd03e3862de579dec59241714d86d.gif
|
||||||
</developer>
|
</picUrl>
|
||||||
</developers>
|
</properties>
|
||||||
|
</developer>
|
||||||
|
</developers>
|
||||||
|
|
||||||
<repositories>
|
<repositories>
|
||||||
<repository>
|
<repository>
|
||||||
<id>jcenter</id>
|
<id>jcenter</id>
|
||||||
<name>jcenter-bintray</name>
|
<name>jcenter-bintray</name>
|
||||||
<url>https://jcenter.bintray.com</url>
|
<url>https://jcenter.bintray.com</url>
|
||||||
</repository>
|
</repository>
|
||||||
</repositories>
|
<repository>
|
||||||
|
<id>dv8tion</id>
|
||||||
|
<name>m2-dv8tion</name>
|
||||||
|
<url>https://m2.dv8tion.net/releases</url>
|
||||||
|
</repository>
|
||||||
|
</repositories>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.maven</groupId>
|
<groupId>org.apache.maven</groupId>
|
||||||
<artifactId>maven-model</artifactId>
|
<artifactId>maven-model</artifactId>
|
||||||
<version>3.6.3</version>
|
<version>3.8.6</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.dv8tion</groupId>
|
<groupId>net.dv8tion</groupId>
|
||||||
<artifactId>JDA</artifactId>
|
<artifactId>JDA</artifactId>
|
||||||
<version>4.1.1_157</version>
|
<version>4.4.0_352</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.json</groupId>
|
<groupId>org.json</groupId>
|
||||||
<artifactId>json</artifactId>
|
<artifactId>json</artifactId>
|
||||||
<version>20200518</version>
|
<version>20220924</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.rethinkdb</groupId>
|
<groupId>org.slf4j</groupId>
|
||||||
<artifactId>rethinkdb-driver</artifactId>
|
<artifactId>slf4j-simple</artifactId>
|
||||||
<version>2.4.4</version>
|
<version>2.0.3</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.slf4j</groupId>
|
<groupId>club.minnced</groupId>
|
||||||
<artifactId>slf4j-simple</artifactId>
|
<artifactId>discord-webhooks</artifactId>
|
||||||
<version>1.7.30</version>
|
<version>0.8.2</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>club.minnced</groupId>
|
<groupId>org.kohsuke</groupId>
|
||||||
<artifactId>discord-webhooks</artifactId>
|
<artifactId>github-api</artifactId>
|
||||||
<version>0.3.1</version>
|
<version>1.313</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.kohsuke</groupId>
|
<groupId>com.sedmelluq</groupId>
|
||||||
<artifactId>github-api</artifactId>
|
<artifactId>lavaplayer</artifactId>
|
||||||
<version>1.112</version>
|
<version>1.3.78</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.sedmelluq</groupId>
|
<groupId>org.mongodb</groupId>
|
||||||
<artifactId>lavaplayer</artifactId>
|
<artifactId>mongodb-driver-sync</artifactId>
|
||||||
<version>1.3.49</version>
|
<version>4.7.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
</dependencies>
|
||||||
<groupId>com.fasterxml.jackson.core</groupId>
|
|
||||||
<artifactId>jackson-annotations</artifactId>
|
|
||||||
<version>2.11.0</version>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
<pluginManagement>
|
<plugins>
|
||||||
<plugins>
|
<plugin>
|
||||||
<plugin>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-clean-plugin</artifactId>
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
<version>3.1.0</version>
|
<configuration>
|
||||||
</plugin>
|
<source>15</source>
|
||||||
<plugin>
|
<target>15</target>
|
||||||
<artifactId>maven-resources-plugin</artifactId>
|
</configuration>
|
||||||
<version>3.1.0</version>
|
</plugin>
|
||||||
</plugin>
|
<plugin>
|
||||||
<plugin>
|
<artifactId>maven-assembly-plugin</artifactId>
|
||||||
<artifactId>maven-surefire-plugin</artifactId>
|
<configuration>
|
||||||
<version>2.22.2</version>
|
<finalName>Hadder-Build</finalName>
|
||||||
</plugin>
|
<archive>
|
||||||
<plugin>
|
<manifest>
|
||||||
<artifactId>maven-jar-plugin</artifactId>
|
<mainClass>one.bbn.hadder.Hadder</mainClass>
|
||||||
<version>3.2.0</version>
|
</manifest>
|
||||||
<configuration>
|
</archive>
|
||||||
<finalName>Hadder-Build</finalName>
|
<descriptorRefs>
|
||||||
<archive>
|
<descriptorRef>jar-with-dependencies</descriptorRef>
|
||||||
<manifest>
|
</descriptorRefs>
|
||||||
<mainClass>com.bbn.hadder.Hadder</mainClass>
|
<appendAssemblyId>false</appendAssemblyId>
|
||||||
</manifest>
|
</configuration>
|
||||||
</archive>
|
</plugin>
|
||||||
</configuration>
|
</plugins>
|
||||||
</plugin>
|
</build>
|
||||||
<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.9.0</version>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<artifactId>maven-project-info-reports-plugin</artifactId>
|
|
||||||
<version>3.1.0</version>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
|
||||||
</pluginManagement>
|
|
||||||
<plugins>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
|
||||||
<version>3.8.1</version>
|
|
||||||
<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>
|
|
||||||
</project>
|
</project>
|
||||||
|
|
|
||||||
|
|
@ -1,56 +0,0 @@
|
||||||
/*
|
|
||||||
* 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 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;
|
|
||||||
|
|
||||||
@Perms(Perm.MANAGE_ROLES)
|
|
||||||
public class RoleAssignmentCommand implements Command {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void executed(String[] args, CommandEvent e) {
|
|
||||||
//TODO: THIS LOL
|
|
||||||
if (e.getGuild().getSelfMember().hasPermission(Permission.MANAGE_ROLES)) {
|
|
||||||
|
|
||||||
} else e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.NO_SELF_PERMISSION).build()).queue();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String[] labels() {
|
|
||||||
return new String[0];
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String description() {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String usage() {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String example() {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,170 +0,0 @@
|
||||||
/*
|
|
||||||
* 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 com.bbn.hadder.db;
|
|
||||||
|
|
||||||
import com.bbn.hadder.core.Config;
|
|
||||||
import com.rethinkdb.RethinkDB;
|
|
||||||
import com.rethinkdb.gen.exc.ReqlNonExistenceError;
|
|
||||||
import com.rethinkdb.gen.exc.ReqlOpFailedError;
|
|
||||||
import com.rethinkdb.net.Connection;
|
|
||||||
import org.json.JSONException;
|
|
||||||
import org.json.JSONObject;
|
|
||||||
|
|
||||||
import java.lang.reflect.Field;
|
|
||||||
|
|
||||||
public class Rethink {
|
|
||||||
private RethinkDB r = RethinkDB.r;
|
|
||||||
private Connection conn;
|
|
||||||
private Config config;
|
|
||||||
|
|
||||||
public 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 Object getByID(String table, String where, String column) {
|
|
||||||
return r.table(table).get(where).getField(column).run(conn).first();
|
|
||||||
}
|
|
||||||
|
|
||||||
public JSONObject getObjectByID(String table, String id) {
|
|
||||||
String response = String.valueOf(r.table(table).get(id).toJson().run(conn).first());
|
|
||||||
try {
|
|
||||||
return new JSONObject(response);
|
|
||||||
} catch (JSONException e) {
|
|
||||||
System.out.println(response);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void insert(String table, Object object) {
|
|
||||||
try {
|
|
||||||
r.table(table).insert(object).run(conn);
|
|
||||||
} catch (ClassCastException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void remove(String table, String where, String value) {
|
|
||||||
r.table(table).filter(row -> row.g(where.toLowerCase()).eq(value)).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 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")
|
|
||||||
.with("blacklisted", "none"));
|
|
||||||
}
|
|
||||||
|
|
||||||
public void insertStarboardMessage(String message_id, String guild_id, String starboard_message_id) {
|
|
||||||
this.insert("stars", r.hashMap("id", message_id).with("guild", guild_id).with("starboardmsg", starboard_message_id));
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getStarboardMessage(String message_id) {
|
|
||||||
return (String) this.getByID("stars", message_id, "starboardmsg");
|
|
||||||
}
|
|
||||||
|
|
||||||
public void removeStarboardMessage(String message_id) {
|
|
||||||
this.remove("stars", "id", message_id);
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean hasStarboardMessage(String message_id) {
|
|
||||||
try {
|
|
||||||
this.getByID("stars", message_id, "guild");
|
|
||||||
return true;
|
|
||||||
} catch (ReqlNonExistenceError e) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void push(RethinkServer server) {
|
|
||||||
JSONObject object = new JSONObject();
|
|
||||||
for (Field field : server.getClass().getDeclaredFields()) {
|
|
||||||
if (!field.getName().equals("rethink")) {
|
|
||||||
try {
|
|
||||||
object.put(field.getName(), field.get(server));
|
|
||||||
} catch (IllegalAccessException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
r.table("server").get(server.getId()).update(object.toMap()).run(conn);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void push(RethinkUser user) {
|
|
||||||
JSONObject object = new JSONObject();
|
|
||||||
for (Field field : user.getClass().getDeclaredFields()) {
|
|
||||||
if (!field.getName().equals("rethink")) {
|
|
||||||
try {
|
|
||||||
object.put(field.getName(), field.get(user));
|
|
||||||
} catch (IllegalAccessException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
r.table("user").get(user.getId()).update(object.toMap()).run(conn);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,85 +0,0 @@
|
||||||
/*
|
|
||||||
* 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 com.bbn.hadder.listener;
|
|
||||||
|
|
||||||
import com.bbn.hadder.db.Rethink;
|
|
||||||
import com.bbn.hadder.db.RethinkServer;
|
|
||||||
import com.bbn.hadder.db.RethinkUser;
|
|
||||||
import net.dv8tion.jda.api.EmbedBuilder;
|
|
||||||
import net.dv8tion.jda.api.entities.ChannelType;
|
|
||||||
import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
|
|
||||||
import net.dv8tion.jda.api.hooks.ListenerAdapter;
|
|
||||||
import org.apache.maven.model.Model;
|
|
||||||
import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
|
|
||||||
import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
|
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
|
||||||
import java.io.IOException;
|
|
||||||
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 e) {
|
|
||||||
if (!e.getAuthor().isBot()) {
|
|
||||||
RethinkServer rethinkServer = new RethinkServer(rethink.getObjectByID("server", e.getGuild().getId()), rethink);
|
|
||||||
RethinkUser rethinkUser = new RethinkUser(rethink.getObjectByID("user", e.getAuthor().getId()), rethink);
|
|
||||||
if (e.isFromType(ChannelType.TEXT) && (e.getMessage().getContentRaw().equals(e.getGuild().getSelfMember().getAsMention()) ||
|
|
||||||
e.getMessage().getContentRaw().equals(e.getGuild().getSelfMember().getAsMention().replace("@", "@!")))) {
|
|
||||||
|
|
||||||
MavenXpp3Reader reader = new MavenXpp3Reader();
|
|
||||||
Model model = null;
|
|
||||||
try {
|
|
||||||
model = reader.read(getClass().getResourceAsStream("pom.xml"));
|
|
||||||
} catch (IOException | XmlPullParserException ex) {
|
|
||||||
ex.printStackTrace();
|
|
||||||
}
|
|
||||||
EmbedBuilder builder = new EmbedBuilder()
|
|
||||||
.setTitle("Hi!")
|
|
||||||
.addField("Version", model.getVersion(), false)
|
|
||||||
.addField("User-Prefix", rethinkUser.getPrefix(), true)
|
|
||||||
.addField("Guild-Prefix", rethinkServer.getPrefix(), true);
|
|
||||||
StringBuilder stringBuilder = new StringBuilder();
|
|
||||||
model.getDependencies().forEach(
|
|
||||||
dependency -> stringBuilder.append(dependency.getArtifactId()).append(" - ").append(dependency.getVersion()).append("\n")
|
|
||||||
);
|
|
||||||
builder.addField("Dependencies", stringBuilder.toString(), false);
|
|
||||||
StringBuilder devs = new StringBuilder();
|
|
||||||
//TODO: Fix Mail stuff
|
|
||||||
model.getDevelopers().forEach(
|
|
||||||
developer -> devs.append(developer.getId()).append(" - [Website](").append(developer.getUrl()).append("), [E-Mail](https://hax.bigbotnetwork.de/redirect.html?url=mailto:").append(developer.getEmail()).append(")\n")
|
|
||||||
);
|
|
||||||
builder.addField("Developer", devs.toString(), false);
|
|
||||||
builder.addField("Join our Dev Server!", "[Click here!](https://discord.gg/58My2dM)", true);
|
|
||||||
builder.addField("Github", "[Click here!](https://github.com/BigBotNetwork/Hadder)",false);
|
|
||||||
builder.addField("Twitch", "[Click here!](https://www.twitch.tv/bigbotnetwork)", false);
|
|
||||||
e.getChannel().sendMessage(builder.build()).queue();
|
|
||||||
} else if (e.getMessage().getContentRaw().equalsIgnoreCase("@someone")) {
|
|
||||||
int member = new Random().nextInt(e.getGuild().getMembers().size() - 1);
|
|
||||||
if (member > 0 && member < e.getGuild().getMembers().size()) {
|
|
||||||
e.getChannel().sendMessage(e.getGuild().getMembers().get(member).getAsMention() + " (Executed by: " + e.getAuthor().getAsTag() + ")").queue();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,215 +0,0 @@
|
||||||
/*
|
|
||||||
* 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 com.bbn.hadder.utils;
|
|
||||||
|
|
||||||
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 DiscordBoats = "https://discord.boats/api/v2/bot/637002314162372639";
|
|
||||||
private static String YetAnotherBotList = "https://yabl.xyz/api/bot/637002314162372639/stats";
|
|
||||||
private static String DiscordExtremeList = "https://api.discordextremelist.xyz/v1/bot/637002314162372639";
|
|
||||||
private static String DiscordBots = "https://top.gg/api/bots/637002314162372639/stats";
|
|
||||||
private static String BotListSpace = "https://api.botlist.space/v1/bots/637002314162372639";
|
|
||||||
private static String DiscordBots2 = "https://discord.bots.gg/api/v1/bots/637002314162372639/stats";
|
|
||||||
private static String ArcaneBotCenter = "https://arcane-center.xyz/api/637002314162372639/stats";
|
|
||||||
|
|
||||||
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("count", Hadder.shardManager.getGuilds().size());
|
|
||||||
json.put("users", Hadder.shardManager.getUsers().size());
|
|
||||||
json.put("shard_count", Hadder.shardManager.getShards().size());
|
|
||||||
json.put("shardCount", Hadder.shardManager.getShards().size());
|
|
||||||
json.put("member_count", Hadder.shardManager.getUsers().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 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 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();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Discord Bots 2
|
|
||||||
|
|
||||||
Request discordbots2 = new Request.Builder()
|
|
||||||
.url(DiscordBots2)
|
|
||||||
.post(body)
|
|
||||||
.addHeader("Authorization", config.getDiscordBots2Token())
|
|
||||||
.build();
|
|
||||||
|
|
||||||
try {
|
|
||||||
new OkHttpClient().newCall(discordbots2).execute().close();
|
|
||||||
System.out.println("Successfully posted count to discord.bots.gg!");
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Arcane Bot Center
|
|
||||||
|
|
||||||
Request arcane = new Request.Builder()
|
|
||||||
.url(ArcaneBotCenter)
|
|
||||||
.post(body)
|
|
||||||
.addHeader("Authorization", config.getArcaneToken())
|
|
||||||
.build();
|
|
||||||
|
|
||||||
try {
|
|
||||||
new OkHttpClient().newCall(arcane).execute().close();
|
|
||||||
System.out.println("Successfully posted count to the Arcane Bot Center!");
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -14,20 +14,26 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.bbn.hadder;
|
package one.bbn.hadder;
|
||||||
|
|
||||||
import com.bbn.hadder.audio.AudioManager;
|
import net.dv8tion.jda.api.utils.cache.CacheFlag;
|
||||||
import com.bbn.hadder.commands.general.*;
|
import one.bbn.hadder.audio.AudioManager;
|
||||||
import com.bbn.hadder.commands.misc.*;
|
import one.bbn.hadder.commands.fun.AvatarCommand;
|
||||||
import com.bbn.hadder.commands.moderation.*;
|
import one.bbn.hadder.commands.fun.ClydeCommand;
|
||||||
import com.bbn.hadder.commands.nsfw.*;
|
import one.bbn.hadder.commands.fun.GifCommand;
|
||||||
import com.bbn.hadder.commands.owner.*;
|
import one.bbn.hadder.commands.fun.MemeCommand;
|
||||||
import com.bbn.hadder.commands.fun.*;
|
import one.bbn.hadder.commands.general.*;
|
||||||
import com.bbn.hadder.commands.settings.*;
|
import one.bbn.hadder.commands.misc.*;
|
||||||
import com.bbn.hadder.commands.music.*;
|
import one.bbn.hadder.commands.moderation.*;
|
||||||
import com.bbn.hadder.core.*;
|
import one.bbn.hadder.commands.music.*;
|
||||||
import com.bbn.hadder.db.Rethink;
|
import one.bbn.hadder.commands.nsfw.*;
|
||||||
import com.bbn.hadder.listener.*;
|
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.OnlineStatus;
|
||||||
import net.dv8tion.jda.api.entities.Activity;
|
import net.dv8tion.jda.api.entities.Activity;
|
||||||
import net.dv8tion.jda.api.requests.GatewayIntent;
|
import net.dv8tion.jda.api.requests.GatewayIntent;
|
||||||
|
|
@ -50,18 +56,19 @@ public class Hadder {
|
||||||
if (!config.fileExists()) config.create();
|
if (!config.fileExists()) config.create();
|
||||||
config.load();
|
config.load();
|
||||||
|
|
||||||
Rethink rethink = new Rethink(config);
|
Mongo mongo = new Mongo(config);
|
||||||
rethink.connect();
|
mongo.connect();
|
||||||
|
|
||||||
DefaultShardManagerBuilder builder = DefaultShardManagerBuilder.create(GatewayIntent.getIntents(GatewayIntent.ALL_INTENTS));
|
DefaultShardManagerBuilder builder = DefaultShardManagerBuilder.create(GatewayIntent.getIntents(14053));
|
||||||
|
|
||||||
builder.setAutoReconnect(true);
|
builder.setAutoReconnect(true);
|
||||||
builder.setShardsTotal(1);
|
builder.setShardsTotal(1);
|
||||||
builder.setChunkingFilter(ChunkingFilter.NONE);
|
builder.setChunkingFilter(ChunkingFilter.NONE);
|
||||||
builder.setBulkDeleteSplittingEnabled(true);
|
builder.setBulkDeleteSplittingEnabled(true);
|
||||||
builder.setActivity(Activity.listening("to h.help"));
|
builder.setActivity(Activity.listening("h.help"));
|
||||||
builder.setStatus(OnlineStatus.DO_NOT_DISTURB);
|
builder.setStatus(OnlineStatus.DO_NOT_DISTURB);
|
||||||
builder.setToken(config.getBotToken());
|
builder.setToken(config.getBotToken());
|
||||||
|
builder.disableCache(CacheFlag.ACTIVITY, CacheFlag.EMOTE, CacheFlag.CLIENT_STATUS);
|
||||||
|
|
||||||
HelpCommand helpCommand = new HelpCommand();
|
HelpCommand helpCommand = new HelpCommand();
|
||||||
AudioManager audioManager = new AudioManager();
|
AudioManager audioManager = new AudioManager();
|
||||||
|
|
@ -132,14 +139,14 @@ public class Hadder {
|
||||||
new CoronaCommand()), config, helpCommand);
|
new CoronaCommand()), config, helpCommand);
|
||||||
|
|
||||||
builder.addEventListeners(
|
builder.addEventListeners(
|
||||||
new MentionListener(rethink),
|
new MentionListener(mongo, config),
|
||||||
new PrivateMessageListener(rethink),
|
new PrivateMessageListener(mongo),
|
||||||
new CommandListener(rethink, commandHandler, audioManager),
|
new CommandListener(mongo, commandHandler, audioManager),
|
||||||
new GuildListener(rethink, config),
|
new GuildListener(mongo, config),
|
||||||
new ReadyListener(rethink, config),
|
new ReadyListener(config),
|
||||||
new InviteLinkListener(rethink),
|
new InviteLinkListener(mongo),
|
||||||
new RulesListener(rethink),
|
new RulesListener(mongo),
|
||||||
new StarboardListener(rethink),
|
new StarboardListener(mongo),
|
||||||
new VoiceLeaveListener(audioManager),
|
new VoiceLeaveListener(audioManager),
|
||||||
new OwnerMessageListener(config));
|
new OwnerMessageListener(config));
|
||||||
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2019-2020 GregTCLTK and Schlauer-Hax
|
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||||
*
|
*
|
||||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
* 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 not use this file except in compliance with the License.
|
||||||
|
|
@ -14,7 +14,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.bbn.hadder.audio;
|
package one.bbn.hadder.audio;
|
||||||
|
|
||||||
import com.sedmelluq.discord.lavaplayer.track.AudioTrack;
|
import com.sedmelluq.discord.lavaplayer.track.AudioTrack;
|
||||||
import net.dv8tion.jda.api.entities.Member;
|
import net.dv8tion.jda.api.entities.Member;
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2019-2020 GregTCLTK and Schlauer-Hax
|
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||||
*
|
*
|
||||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
* 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 not use this file except in compliance with the License.
|
||||||
|
|
@ -14,11 +14,14 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.bbn.hadder.audio;
|
package one.bbn.hadder.audio;
|
||||||
|
|
||||||
import com.bbn.hadder.commands.CommandEvent;
|
import one.bbn.hadder.commands.CommandEvent;
|
||||||
import com.bbn.hadder.utils.MessageEditor;
|
import one.bbn.hadder.utils.MessageEditor;
|
||||||
import com.sedmelluq.discord.lavaplayer.player.*;
|
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.source.AudioSourceManagers;
|
||||||
import com.sedmelluq.discord.lavaplayer.tools.FriendlyException;
|
import com.sedmelluq.discord.lavaplayer.tools.FriendlyException;
|
||||||
import com.sedmelluq.discord.lavaplayer.track.AudioPlaylist;
|
import com.sedmelluq.discord.lavaplayer.track.AudioPlaylist;
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2019-2020 GregTCLTK and Schlauer-Hax
|
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||||
*
|
*
|
||||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
* 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 not use this file except in compliance with the License.
|
||||||
|
|
@ -14,7 +14,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.bbn.hadder.audio;
|
package one.bbn.hadder.audio;
|
||||||
|
|
||||||
import com.sedmelluq.discord.lavaplayer.player.AudioPlayer;
|
import com.sedmelluq.discord.lavaplayer.player.AudioPlayer;
|
||||||
import com.sedmelluq.discord.lavaplayer.track.playback.AudioFrame;
|
import com.sedmelluq.discord.lavaplayer.track.playback.AudioFrame;
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2019-2020 GregTCLTK and Schlauer-Hax
|
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||||
*
|
*
|
||||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
* 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 not use this file except in compliance with the License.
|
||||||
|
|
@ -14,7 +14,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.bbn.hadder.audio;
|
package one.bbn.hadder.audio;
|
||||||
|
|
||||||
import com.sedmelluq.discord.lavaplayer.player.AudioPlayer;
|
import com.sedmelluq.discord.lavaplayer.player.AudioPlayer;
|
||||||
import com.sedmelluq.discord.lavaplayer.player.event.AudioEventAdapter;
|
import com.sedmelluq.discord.lavaplayer.player.event.AudioEventAdapter;
|
||||||
|
|
@ -24,7 +24,9 @@ import net.dv8tion.jda.api.entities.Guild;
|
||||||
import net.dv8tion.jda.api.entities.Member;
|
import net.dv8tion.jda.api.entities.Member;
|
||||||
import net.dv8tion.jda.api.entities.VoiceChannel;
|
import net.dv8tion.jda.api.entities.VoiceChannel;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.LinkedHashSet;
|
||||||
|
import java.util.Queue;
|
||||||
|
import java.util.Set;
|
||||||
import java.util.concurrent.LinkedBlockingQueue;
|
import java.util.concurrent.LinkedBlockingQueue;
|
||||||
|
|
||||||
public class TrackManager extends AudioEventAdapter {
|
public class TrackManager extends AudioEventAdapter {
|
||||||
|
|
@ -91,13 +93,11 @@ public class TrackManager extends AudioEventAdapter {
|
||||||
queue.remove(entry);
|
queue.remove(entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isLoop()
|
public boolean isLoop() {
|
||||||
{
|
|
||||||
return loop;
|
return loop;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setLoop(boolean repeating)
|
public void setLoop(boolean repeating) {
|
||||||
{
|
|
||||||
this.loop = repeating;
|
this.loop = repeating;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2019-2020 GregTCLTK and Schlauer-Hax
|
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||||
*
|
*
|
||||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
* 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 not use this file except in compliance with the License.
|
||||||
|
|
@ -14,7 +14,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.bbn.hadder.commands;
|
package one.bbn.hadder.commands;
|
||||||
|
|
||||||
public interface Command {
|
public interface Command {
|
||||||
void executed(String[] args, CommandEvent e);
|
void executed(String[] args, CommandEvent e);
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2019-2020 GregTCLTK and Schlauer-Hax
|
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||||
*
|
*
|
||||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
* 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 not use this file except in compliance with the License.
|
||||||
|
|
@ -14,17 +14,17 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.bbn.hadder.commands;
|
package one.bbn.hadder.commands;
|
||||||
|
|
||||||
import com.bbn.hadder.db.Rethink;
|
import one.bbn.hadder.audio.AudioManager;
|
||||||
import com.bbn.hadder.db.RethinkServer;
|
import one.bbn.hadder.commands.general.HelpCommand;
|
||||||
import com.bbn.hadder.db.RethinkUser;
|
import one.bbn.hadder.core.CommandHandler;
|
||||||
import com.bbn.hadder.audio.AudioManager;
|
import one.bbn.hadder.core.Config;
|
||||||
import com.bbn.hadder.commands.general.HelpCommand;
|
import one.bbn.hadder.db.Mongo;
|
||||||
import com.bbn.hadder.core.CommandHandler;
|
import one.bbn.hadder.db.MongoServer;
|
||||||
import com.bbn.hadder.core.Config;
|
import one.bbn.hadder.db.MongoUser;
|
||||||
import com.bbn.hadder.utils.EventWaiter;
|
import one.bbn.hadder.utils.EventWaiter;
|
||||||
import com.bbn.hadder.utils.MessageEditor;
|
import one.bbn.hadder.utils.MessageEditor;
|
||||||
import net.dv8tion.jda.api.JDA;
|
import net.dv8tion.jda.api.JDA;
|
||||||
import net.dv8tion.jda.api.entities.Message;
|
import net.dv8tion.jda.api.entities.Message;
|
||||||
import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
|
import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
|
||||||
|
|
@ -33,34 +33,34 @@ import javax.annotation.Nonnull;
|
||||||
|
|
||||||
public class CommandEvent extends MessageReceivedEvent {
|
public class CommandEvent extends MessageReceivedEvent {
|
||||||
|
|
||||||
private Rethink rethink;
|
private Mongo mongo;
|
||||||
private Config config;
|
private Config config;
|
||||||
private CommandHandler commandHandler;
|
private CommandHandler commandHandler;
|
||||||
private HelpCommand helpCommand;
|
private HelpCommand helpCommand;
|
||||||
private MessageEditor messageEditor;
|
private MessageEditor messageEditor;
|
||||||
private EventWaiter eventWaiter;
|
private EventWaiter eventWaiter;
|
||||||
private AudioManager audioManager;
|
private AudioManager audioManager;
|
||||||
private RethinkUser rethinkUser;
|
private MongoUser mongoUser;
|
||||||
private RethinkServer rethinkServer;
|
private MongoServer mongoServer;
|
||||||
|
|
||||||
public CommandEvent(@Nonnull JDA api, long responseNumber, @Nonnull Message message, Rethink rethink, Config config,
|
public CommandEvent(@Nonnull JDA api, long responseNumber, @Nonnull Message message, Mongo mongo, Config config,
|
||||||
CommandHandler commandHandler, HelpCommand helpCommand, MessageEditor messageEditor,
|
CommandHandler commandHandler, HelpCommand helpCommand, MessageEditor messageEditor,
|
||||||
EventWaiter eventWaiter, AudioManager audioManager, RethinkUser rethinkUser,
|
EventWaiter eventWaiter, AudioManager audioManager, MongoUser mongoUser,
|
||||||
RethinkServer rethinkServer) {
|
MongoServer mongoServer) {
|
||||||
super(api, responseNumber, message);
|
super(api, responseNumber, message);
|
||||||
this.rethink = rethink;
|
this.mongo = mongo;
|
||||||
this.config = config;
|
this.config = config;
|
||||||
this.commandHandler = commandHandler;
|
this.commandHandler = commandHandler;
|
||||||
this.helpCommand = helpCommand;
|
this.helpCommand = helpCommand;
|
||||||
this.messageEditor = messageEditor;
|
this.messageEditor = messageEditor;
|
||||||
this.eventWaiter = eventWaiter;
|
this.eventWaiter = eventWaiter;
|
||||||
this.audioManager = audioManager;
|
this.audioManager = audioManager;
|
||||||
this.rethinkUser = rethinkUser;
|
this.mongoUser = mongoUser;
|
||||||
this.rethinkServer = rethinkServer;
|
this.mongoServer = mongoServer;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Rethink getRethink() {
|
public Mongo getMongo() {
|
||||||
return rethink;
|
return mongo;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Config getConfig() {
|
public Config getConfig() {
|
||||||
|
|
@ -87,11 +87,11 @@ public class CommandEvent extends MessageReceivedEvent {
|
||||||
return audioManager;
|
return audioManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
public RethinkServer getRethinkServer() {
|
public MongoServer getMongoServer() {
|
||||||
return rethinkServer;
|
return mongoServer;
|
||||||
}
|
}
|
||||||
|
|
||||||
public RethinkUser getRethinkUser() {
|
public MongoUser getMongoUser() {
|
||||||
return rethinkUser;
|
return mongoUser;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2019-2020 GregTCLTK and Schlauer-Hax
|
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||||
*
|
*
|
||||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
* 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 not use this file except in compliance with the License.
|
||||||
|
|
@ -14,11 +14,11 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.bbn.hadder.commands.fun;
|
package one.bbn.hadder.commands.fun;
|
||||||
|
|
||||||
import com.bbn.hadder.commands.Command;
|
import one.bbn.hadder.commands.Command;
|
||||||
import com.bbn.hadder.commands.CommandEvent;
|
import one.bbn.hadder.commands.CommandEvent;
|
||||||
import com.bbn.hadder.utils.MessageEditor;
|
import one.bbn.hadder.utils.MessageEditor;
|
||||||
import net.dv8tion.jda.api.entities.User;
|
import net.dv8tion.jda.api.entities.User;
|
||||||
import okhttp3.OkHttpClient;
|
import okhttp3.OkHttpClient;
|
||||||
import okhttp3.Request;
|
import okhttp3.Request;
|
||||||
|
|
@ -31,7 +31,7 @@ public class AvatarCommand implements Command {
|
||||||
@Override
|
@Override
|
||||||
public void executed(String[] args, CommandEvent e) {
|
public void executed(String[] args, CommandEvent e) {
|
||||||
if (args.length == 0) {
|
if (args.length == 0) {
|
||||||
User u = e.getAuthor();
|
User u = e.getAuthor();
|
||||||
e.getTextChannel().sendMessage(
|
e.getTextChannel().sendMessage(
|
||||||
e.getMessageEditor().getMessage(
|
e.getMessageEditor().getMessage(
|
||||||
MessageEditor.MessageType.INFO,
|
MessageEditor.MessageType.INFO,
|
||||||
|
|
@ -39,9 +39,9 @@ public class AvatarCommand implements Command {
|
||||||
u.getAsTag(),
|
u.getAsTag(),
|
||||||
"",
|
"",
|
||||||
"")
|
"")
|
||||||
.setImage(u.getAvatarUrl())
|
.setImage(u.getAvatarUrl())
|
||||||
.setFooter(u.getAsTag())
|
.setFooter(u.getAsTag())
|
||||||
.build()).queue();
|
.build()).queue();
|
||||||
} else if (e.getMessage().getMentionedUsers().size() == 1) {
|
} else if (e.getMessage().getMentionedUsers().size() == 1) {
|
||||||
User u = e.getMessage().getMentionedUsers().get(0);
|
User u = e.getMessage().getMentionedUsers().get(0);
|
||||||
e.getTextChannel().sendMessage(
|
e.getTextChannel().sendMessage(
|
||||||
|
|
@ -51,9 +51,9 @@ public class AvatarCommand implements Command {
|
||||||
u.getAsTag(),
|
u.getAsTag(),
|
||||||
"",
|
"",
|
||||||
"")
|
"")
|
||||||
.setImage(u.getAvatarUrl())
|
.setImage(u.getAvatarUrl())
|
||||||
.setFooter(u.getAsTag())
|
.setFooter(u.getAsTag())
|
||||||
.build()).queue();
|
.build()).queue();
|
||||||
} else if (args[0].length() == 18) {
|
} else if (args[0].length() == 18) {
|
||||||
try {
|
try {
|
||||||
User u = e.getJDA().getUserById(args[0]);
|
User u = e.getJDA().getUserById(args[0]);
|
||||||
|
|
@ -70,21 +70,21 @@ public class AvatarCommand implements Command {
|
||||||
} catch (NullPointerException ignore) {
|
} catch (NullPointerException ignore) {
|
||||||
|
|
||||||
OkHttpClient client = new OkHttpClient();
|
OkHttpClient client = new OkHttpClient();
|
||||||
Request request = new Request.Builder().url("https://canary.discordapp.com/api/v6/users/" + args[0]).addHeader("Authorization", "Bot " + e.getConfig().getBotToken()).build();
|
Request request = new Request.Builder().url("https://canary.discord.com/api/v8/users/" + args[0]).addHeader("Authorization", "Bot " + e.getConfig().getBotToken()).build();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Response response = client.newCall(request).execute();
|
Response response = client.newCall(request).execute();
|
||||||
JSONObject json = new JSONObject(response.body().string());
|
JSONObject json = new JSONObject(response.body().string());
|
||||||
String url = "https://cdn.discordapp.com/avatars/" + args[0] + "/" + json.getString("avatar") + ".png";
|
String url = "https://cdn.discordapp.com/avatars/" + args[0] + "/" + json.getString("avatar") + ".png";
|
||||||
e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(
|
e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(
|
||||||
MessageEditor.MessageType.INFO,
|
MessageEditor.MessageType.INFO,
|
||||||
"commands.fun.avatar.success.title",
|
"commands.fun.avatar.success.title",
|
||||||
json.getString("username") + "#" + json.getString("discriminator"),
|
json.getString("username") + "#" + json.getString("discriminator"),
|
||||||
"",
|
"",
|
||||||
"")
|
"")
|
||||||
.setImage(url)
|
.setImage(url)
|
||||||
.setFooter(json.getString("username") + "#" + json.getString("discriminator"))
|
.setFooter(json.getString("username") + "#" + json.getString("discriminator"))
|
||||||
.build()).queue();
|
.build()).queue();
|
||||||
} catch (JSONException ex) {
|
} catch (JSONException ex) {
|
||||||
e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.ERROR,
|
e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.ERROR,
|
||||||
"commands.fun.avatar.error.title",
|
"commands.fun.avatar.error.title",
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2019-2020 GregTCLTK and Schlauer-Hax
|
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||||
*
|
*
|
||||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
* 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 not use this file except in compliance with the License.
|
||||||
|
|
@ -14,15 +14,15 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.bbn.hadder.commands.fun;
|
package one.bbn.hadder.commands.fun;
|
||||||
|
|
||||||
import club.minnced.discord.webhook.WebhookClient;
|
import club.minnced.discord.webhook.WebhookClient;
|
||||||
import club.minnced.discord.webhook.WebhookClientBuilder;
|
import club.minnced.discord.webhook.WebhookClientBuilder;
|
||||||
import com.bbn.hadder.commands.Command;
|
import one.bbn.hadder.commands.Command;
|
||||||
import com.bbn.hadder.commands.CommandEvent;
|
import one.bbn.hadder.commands.CommandEvent;
|
||||||
import com.bbn.hadder.core.Perm;
|
import one.bbn.hadder.core.Perm;
|
||||||
import com.bbn.hadder.core.Perms;
|
import one.bbn.hadder.core.Perms;
|
||||||
import com.bbn.hadder.utils.MessageEditor;
|
import one.bbn.hadder.utils.MessageEditor;
|
||||||
import net.dv8tion.jda.api.Permission;
|
import net.dv8tion.jda.api.Permission;
|
||||||
import net.dv8tion.jda.api.entities.Icon;
|
import net.dv8tion.jda.api.entities.Icon;
|
||||||
import net.dv8tion.jda.api.entities.TextChannel;
|
import net.dv8tion.jda.api.entities.TextChannel;
|
||||||
|
|
@ -40,7 +40,7 @@ public class ClydeCommand implements Command {
|
||||||
if (args.length > 0) {
|
if (args.length > 0) {
|
||||||
if (e.getGuild().getSelfMember().hasPermission(Permission.MANAGE_WEBHOOKS)) {
|
if (e.getGuild().getSelfMember().hasPermission(Permission.MANAGE_WEBHOOKS)) {
|
||||||
TextChannel channel = e.getMessage().getTextChannel();
|
TextChannel channel = e.getMessage().getTextChannel();
|
||||||
String content = e.getMessage().getContentRaw().replace(e.getRethinkServer().getPrefix(), "").replace(e.getRethinkUser().getPrefix(), "").replace("clyde", "");
|
String content = e.getMessage().getContentRaw().replace(e.getMongoServer().getPrefix(), "").replace(e.getMongoUser().getPrefix(), "").replace("clyde", "");
|
||||||
|
|
||||||
Webhook webhook = channel.createWebhook(e.getConfig().getClydeName()).complete();
|
Webhook webhook = channel.createWebhook(e.getConfig().getClydeName()).complete();
|
||||||
try {
|
try {
|
||||||
|
|
@ -66,7 +66,8 @@ public class ClydeCommand implements Command {
|
||||||
}
|
}
|
||||||
webhook.delete().queue();
|
webhook.delete().queue();
|
||||||
e.getMessage().delete().queue();
|
e.getMessage().delete().queue();
|
||||||
} else e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.NO_SELF_PERMISSION).build()).queue();
|
} else
|
||||||
|
e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.NO_SELF_PERMISSION).build()).queue();
|
||||||
} else e.getHelpCommand().sendHelp(this, e);
|
} else e.getHelpCommand().sendHelp(this, e);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2019-2020 GregTCLTK and Schlauer-Hax
|
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||||
*
|
*
|
||||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
* 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 not use this file except in compliance with the License.
|
||||||
|
|
@ -14,11 +14,11 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.bbn.hadder.commands.fun;
|
package one.bbn.hadder.commands.fun;
|
||||||
|
|
||||||
import com.bbn.hadder.commands.Command;
|
import one.bbn.hadder.commands.Command;
|
||||||
import com.bbn.hadder.commands.CommandEvent;
|
import one.bbn.hadder.commands.CommandEvent;
|
||||||
import com.bbn.hadder.utils.MessageEditor;
|
import one.bbn.hadder.utils.MessageEditor;
|
||||||
import okhttp3.OkHttpClient;
|
import okhttp3.OkHttpClient;
|
||||||
import okhttp3.Request;
|
import okhttp3.Request;
|
||||||
import okhttp3.Response;
|
import okhttp3.Response;
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2019-2020 GregTCLTK and Schlauer-Hax
|
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||||
*
|
*
|
||||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
* 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 not use this file except in compliance with the License.
|
||||||
|
|
@ -14,11 +14,11 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.bbn.hadder.commands.fun;
|
package one.bbn.hadder.commands.fun;
|
||||||
|
|
||||||
import com.bbn.hadder.commands.Command;
|
import one.bbn.hadder.commands.Command;
|
||||||
import com.bbn.hadder.commands.CommandEvent;
|
import one.bbn.hadder.commands.CommandEvent;
|
||||||
import com.bbn.hadder.utils.MessageEditor;
|
import one.bbn.hadder.utils.MessageEditor;
|
||||||
import okhttp3.OkHttpClient;
|
import okhttp3.OkHttpClient;
|
||||||
import okhttp3.Request;
|
import okhttp3.Request;
|
||||||
import okhttp3.Response;
|
import okhttp3.Response;
|
||||||
|
|
@ -41,18 +41,18 @@ public class MemeCommand implements Command {
|
||||||
String url = json.getString("url");
|
String url = json.getString("url");
|
||||||
e.getTextChannel().sendMessage(
|
e.getTextChannel().sendMessage(
|
||||||
e.getMessageEditor().getMessage(MessageEditor.MessageType.INFO,
|
e.getMessageEditor().getMessage(MessageEditor.MessageType.INFO,
|
||||||
"commands.fun.meme.success.title", "")
|
"commands.fun.meme.success.title", "")
|
||||||
.setImage(url)
|
.setImage(url)
|
||||||
.setAuthor("Subreddit: " + json.getString("subreddit"))
|
.setAuthor("Subreddit: " + json.getString("subreddit"))
|
||||||
.build()).queue();
|
.build()).queue();
|
||||||
} catch (IOException ignore) {
|
} catch (IOException ignore) {
|
||||||
e.getTextChannel().sendMessage(
|
e.getTextChannel().sendMessage(
|
||||||
e.getMessageEditor().getMessage(
|
e.getMessageEditor().getMessage(
|
||||||
MessageEditor.MessageType.ERROR,
|
MessageEditor.MessageType.ERROR,
|
||||||
"error",
|
"error",
|
||||||
"commands.fun.meme.api.error")
|
"commands.fun.meme.api.error")
|
||||||
.setColor(Color.RED)
|
.setColor(Color.RED)
|
||||||
.build()).queue();
|
.build()).queue();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2019-2020 GregTCLTK and Schlauer-Hax
|
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||||
*
|
*
|
||||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
* 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 not use this file except in compliance with the License.
|
||||||
|
|
@ -14,11 +14,11 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.bbn.hadder.commands.general;
|
package one.bbn.hadder.commands.general;
|
||||||
|
|
||||||
import com.bbn.hadder.commands.Command;
|
import one.bbn.hadder.commands.Command;
|
||||||
import com.bbn.hadder.commands.CommandEvent;
|
import one.bbn.hadder.commands.CommandEvent;
|
||||||
import com.bbn.hadder.utils.MessageEditor;
|
import one.bbn.hadder.utils.MessageEditor;
|
||||||
|
|
||||||
public class AboutCommand implements Command {
|
public class AboutCommand implements Command {
|
||||||
|
|
||||||
|
|
@ -30,8 +30,8 @@ public class AboutCommand implements Command {
|
||||||
"commands.general.about.success.title",
|
"commands.general.about.success.title",
|
||||||
"commands.general.about.success.description")
|
"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)
|
.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://bigbotnetwork.com/images/Hadder.png")
|
.setThumbnail("https://bbn.one/images/Hadder.png")
|
||||||
.build()).queue();
|
.build()).queue();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2019-2020 GregTCLTK and Schlauer-Hax
|
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||||
*
|
*
|
||||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
* 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 not use this file except in compliance with the License.
|
||||||
|
|
@ -14,12 +14,12 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.bbn.hadder.commands.general;
|
package one.bbn.hadder.commands.general;
|
||||||
|
|
||||||
import com.bbn.hadder.commands.Command;
|
import one.bbn.hadder.commands.Command;
|
||||||
import com.bbn.hadder.commands.CommandEvent;
|
import one.bbn.hadder.commands.CommandEvent;
|
||||||
import com.bbn.hadder.utils.EventWaiter;
|
import one.bbn.hadder.utils.EventWaiter;
|
||||||
import com.bbn.hadder.utils.MessageEditor;
|
import one.bbn.hadder.utils.MessageEditor;
|
||||||
|
|
||||||
public class EqualsCommand implements Command {
|
public class EqualsCommand implements Command {
|
||||||
|
|
||||||
|
|
@ -41,10 +41,10 @@ public class EqualsCommand implements Command {
|
||||||
String secondString = msge2.getMessage().getContentRaw();
|
String secondString = msge2.getMessage().getContentRaw();
|
||||||
e.getChannel().sendMessage(
|
e.getChannel().sendMessage(
|
||||||
e.getMessageEditor().getMessage(MessageEditor.MessageType.INFO)
|
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"))
|
.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.first"), firstString, false)
|
||||||
.addField(e.getMessageEditor().getTerm( "commands.general.equals.string.second"), secondString, 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)
|
.addField(e.getMessageEditor().getTerm("commands.general.equals.string.result"), String.valueOf(firstString.equals(secondString)), false)
|
||||||
.build()).queue();
|
.build()).queue();
|
||||||
}, e.getJDA(), e.getAuthor());
|
}, e.getJDA(), e.getAuthor());
|
||||||
}, e.getJDA(), e.getAuthor());
|
}, e.getJDA(), e.getAuthor());
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2019-2020 GregTCLTK and Schlauer-Hax
|
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||||
*
|
*
|
||||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
* 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 not use this file except in compliance with the License.
|
||||||
|
|
@ -14,11 +14,11 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.bbn.hadder.commands.general;
|
package one.bbn.hadder.commands.general;
|
||||||
|
|
||||||
import com.bbn.hadder.commands.Command;
|
import one.bbn.hadder.commands.Command;
|
||||||
import com.bbn.hadder.commands.CommandEvent;
|
import one.bbn.hadder.commands.CommandEvent;
|
||||||
import com.bbn.hadder.utils.MessageEditor;
|
import one.bbn.hadder.utils.MessageEditor;
|
||||||
import net.dv8tion.jda.api.EmbedBuilder;
|
import net.dv8tion.jda.api.EmbedBuilder;
|
||||||
import net.dv8tion.jda.api.Permission;
|
import net.dv8tion.jda.api.Permission;
|
||||||
|
|
||||||
|
|
@ -79,10 +79,10 @@ public class HelpCommand implements Command {
|
||||||
StringBuilder b = new StringBuilder();
|
StringBuilder b = new StringBuilder();
|
||||||
b.append(e.getMessageEditor().getTerm("commands.general.help.description")).append(" ").append(e.getMessageEditor().getTerm(cmd.description())).append("\n");
|
b.append(e.getMessageEditor().getTerm("commands.general.help.description")).append(" ").append(e.getMessageEditor().getTerm(cmd.description())).append("\n");
|
||||||
if (cmd.usage() != null) {
|
if (cmd.usage() != null) {
|
||||||
b.append(e.getMessageEditor().getTerm("commands.general.help.usage")).append(" ").append(e.getRethinkServer().getPrefix()).append(name).append(" ").append(cmd.usage()).append("\n");
|
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) {
|
if (cmd.example() != null) {
|
||||||
b.append(e.getMessageEditor().getTerm("commands.general.help.example")).append(" ").append(e.getRethinkServer().getPrefix()).append(name).append(" ").append(cmd.example());
|
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(
|
e.getChannel().sendMessage(e.getMessageEditor().getMessage(
|
||||||
MessageEditor.MessageType.INFO)
|
MessageEditor.MessageType.INFO)
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2019-2020 GregTCLTK and Schlauer-Hax
|
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||||
*
|
*
|
||||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
* 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 not use this file except in compliance with the License.
|
||||||
|
|
@ -14,11 +14,11 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.bbn.hadder.commands.general;
|
package one.bbn.hadder.commands.general;
|
||||||
|
|
||||||
import com.bbn.hadder.commands.Command;
|
import one.bbn.hadder.commands.Command;
|
||||||
import com.bbn.hadder.commands.CommandEvent;
|
import one.bbn.hadder.commands.CommandEvent;
|
||||||
import com.bbn.hadder.utils.MessageEditor;
|
import one.bbn.hadder.utils.MessageEditor;
|
||||||
|
|
||||||
public class InviteCommand implements Command {
|
public class InviteCommand implements Command {
|
||||||
|
|
||||||
|
|
@ -30,10 +30,10 @@ public class InviteCommand implements Command {
|
||||||
"commands.general.invite.success.title",
|
"commands.general.invite.success.title",
|
||||||
"",
|
"",
|
||||||
"commands.general.invite.success.description",
|
"commands.general.invite.success.description",
|
||||||
"(https://discordapp.com/oauth2/authorize?client_id="
|
"(https://discord.com/oauth2/authorize?client_id="
|
||||||
+ e.getJDA().getSelfUser().getId()
|
+ e.getJDA().getSelfUser().getId()
|
||||||
+ "&scope=bot&permissions=1043852663)")
|
+ "&scope=bot&permissions=1043852663)")
|
||||||
.build()).queue();
|
.build()).queue();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2019-2020 GregTCLTK and Schlauer-Hax
|
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||||
*
|
*
|
||||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
* 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 not use this file except in compliance with the License.
|
||||||
|
|
@ -14,11 +14,11 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.bbn.hadder.commands.general;
|
package one.bbn.hadder.commands.general;
|
||||||
|
|
||||||
import com.bbn.hadder.commands.Command;
|
import one.bbn.hadder.commands.Command;
|
||||||
import com.bbn.hadder.commands.CommandEvent;
|
import one.bbn.hadder.commands.CommandEvent;
|
||||||
import com.bbn.hadder.utils.MessageEditor;
|
import one.bbn.hadder.utils.MessageEditor;
|
||||||
|
|
||||||
public class PingCommand implements Command {
|
public class PingCommand implements Command {
|
||||||
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2019-2020 GregTCLTK and Schlauer-Hax
|
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||||
*
|
*
|
||||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
* 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 not use this file except in compliance with the License.
|
||||||
|
|
@ -14,11 +14,11 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.bbn.hadder.commands.misc;
|
package one.bbn.hadder.commands.misc;
|
||||||
|
|
||||||
import com.bbn.hadder.commands.Command;
|
import one.bbn.hadder.commands.Command;
|
||||||
import com.bbn.hadder.commands.CommandEvent;
|
import one.bbn.hadder.commands.CommandEvent;
|
||||||
import com.bbn.hadder.utils.MessageEditor;
|
import one.bbn.hadder.utils.MessageEditor;
|
||||||
import okhttp3.OkHttpClient;
|
import okhttp3.OkHttpClient;
|
||||||
import okhttp3.Request;
|
import okhttp3.Request;
|
||||||
import okhttp3.Response;
|
import okhttp3.Response;
|
||||||
|
|
@ -31,7 +31,7 @@ public class CodeCommand implements Command {
|
||||||
public void executed(String[] args, CommandEvent e) {
|
public void executed(String[] args, CommandEvent e) {
|
||||||
if (args.length > 0) {
|
if (args.length > 0) {
|
||||||
OkHttpClient client = new OkHttpClient();
|
OkHttpClient client = new OkHttpClient();
|
||||||
Request request = new Request.Builder().url("https://canary.discordapp.com/api/v6/invite/" + args[0] + "?with_counts=true").addHeader("Authorization", "Bot " + e.getConfig().getBotToken()).build();
|
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 {
|
try {
|
||||||
Response response = client.newCall(request).execute();
|
Response response = client.newCall(request).execute();
|
||||||
|
|
@ -77,6 +77,6 @@ public class CodeCommand implements Command {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String example() {
|
public String example() {
|
||||||
return "58My2dM";
|
return "nPwjaJk";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2019-2020 GregTCLTK and Schlauer-Hax
|
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||||
*
|
*
|
||||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
* 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 not use this file except in compliance with the License.
|
||||||
|
|
@ -14,11 +14,11 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.bbn.hadder.commands.misc;
|
package one.bbn.hadder.commands.misc;
|
||||||
|
|
||||||
import com.bbn.hadder.commands.Command;
|
import one.bbn.hadder.commands.Command;
|
||||||
import com.bbn.hadder.commands.CommandEvent;
|
import one.bbn.hadder.commands.CommandEvent;
|
||||||
import com.bbn.hadder.utils.MessageEditor;
|
import one.bbn.hadder.utils.MessageEditor;
|
||||||
import okhttp3.OkHttpClient;
|
import okhttp3.OkHttpClient;
|
||||||
import okhttp3.Request;
|
import okhttp3.Request;
|
||||||
import okhttp3.Response;
|
import okhttp3.Response;
|
||||||
|
|
@ -48,9 +48,9 @@ public class CoronaCommand implements Command {
|
||||||
.build()).queue();
|
.build()).queue();
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.ERROR)
|
e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.ERROR)
|
||||||
.setTitle("API Error")
|
.setTitle("API Error")
|
||||||
.setDescription("Try again later!")
|
.setDescription("Try again later!")
|
||||||
.build()).queue();
|
.build()).queue();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2019-2020 GregTCLTK and Schlauer-Hax
|
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||||
*
|
*
|
||||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
* 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 not use this file except in compliance with the License.
|
||||||
|
|
@ -14,12 +14,12 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.bbn.hadder.commands.misc;
|
package one.bbn.hadder.commands.misc;
|
||||||
|
|
||||||
import com.bbn.hadder.commands.Command;
|
import one.bbn.hadder.commands.Command;
|
||||||
import com.bbn.hadder.commands.CommandEvent;
|
import one.bbn.hadder.commands.CommandEvent;
|
||||||
import com.bbn.hadder.utils.EventWaiter;
|
import one.bbn.hadder.utils.EventWaiter;
|
||||||
import com.bbn.hadder.utils.MessageEditor;
|
import one.bbn.hadder.utils.MessageEditor;
|
||||||
import org.kohsuke.github.GHIssue;
|
import org.kohsuke.github.GHIssue;
|
||||||
import org.kohsuke.github.GHRepository;
|
import org.kohsuke.github.GHRepository;
|
||||||
import org.kohsuke.github.GitHub;
|
import org.kohsuke.github.GitHub;
|
||||||
|
|
@ -33,21 +33,21 @@ public class FeedbackCommand implements Command {
|
||||||
e.getTextChannel().sendMessage(
|
e.getTextChannel().sendMessage(
|
||||||
e.getMessageEditor().getMessage(
|
e.getMessageEditor().getMessage(
|
||||||
MessageEditor.MessageType.INFO,
|
MessageEditor.MessageType.INFO,
|
||||||
"commands.misc.feedback.title.request.title",
|
"commands.misc.feedback.title.request.title",
|
||||||
"commands.misc.feedback.title.request.description")
|
"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();
|
.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 -> {
|
new EventWaiter().newOnMessageEventWaiter(e2 -> {
|
||||||
String description = e2.getMessage().getContentDisplay();
|
String description = e2.getMessage().getContentDisplay();
|
||||||
try {
|
try {
|
||||||
GitHub connection = GitHub.connectUsingOAuth(e.getConfig().getGitHubToken());
|
GitHub connection = GitHub.connectUsingOAuth(e.getConfig().getGitHubToken());
|
||||||
GHRepository Hadder = connection.getOrganization("BigBotNetwork").getRepository("Hadder");
|
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();
|
GHIssue issue = Hadder.createIssue(title).body("<strong>Feedback by " + e.getAuthor().getAsTag() + "</strong><br>" + description).label("feedback").create();
|
||||||
issue.addLabels("feedback");
|
issue.addLabels("feedback");
|
||||||
e.getTextChannel().sendMessage(
|
e.getTextChannel().sendMessage(
|
||||||
|
|
@ -56,12 +56,12 @@ public class FeedbackCommand implements Command {
|
||||||
"commands.misc.feedback.success.title",
|
"commands.misc.feedback.success.title",
|
||||||
"")
|
"")
|
||||||
.setDescription(issue.getHtmlUrl().toString())
|
.setDescription(issue.getHtmlUrl().toString())
|
||||||
.build()).queue();
|
.build()).queue();
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
}
|
}
|
||||||
}, e.getJDA(), e.getAuthor());
|
|
||||||
}, e.getJDA(), e.getAuthor());
|
}, e.getJDA(), e.getAuthor());
|
||||||
|
}, e.getJDA(), e.getAuthor());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2019-2020 GregTCLTK and Schlauer-Hax
|
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||||
*
|
*
|
||||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
* 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 not use this file except in compliance with the License.
|
||||||
|
|
@ -14,11 +14,11 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.bbn.hadder.commands.misc;
|
package one.bbn.hadder.commands.misc;
|
||||||
|
|
||||||
import com.bbn.hadder.commands.Command;
|
import one.bbn.hadder.commands.Command;
|
||||||
import com.bbn.hadder.commands.CommandEvent;
|
import one.bbn.hadder.commands.CommandEvent;
|
||||||
import com.bbn.hadder.utils.MessageEditor;
|
import one.bbn.hadder.utils.MessageEditor;
|
||||||
import okhttp3.OkHttpClient;
|
import okhttp3.OkHttpClient;
|
||||||
import okhttp3.Request;
|
import okhttp3.Request;
|
||||||
import okhttp3.Response;
|
import okhttp3.Response;
|
||||||
|
|
@ -54,10 +54,12 @@ public class GitHubCommand implements Command {
|
||||||
String website = "None";
|
String website = "None";
|
||||||
try {
|
try {
|
||||||
bio = json.getString("bio");
|
bio = json.getString("bio");
|
||||||
} catch (JSONException ignored) {}
|
} catch (JSONException ignored) {
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
location = json.getString("location");
|
location = json.getString("location");
|
||||||
} catch (JSONException ignored) {}
|
} catch (JSONException ignored) {
|
||||||
|
}
|
||||||
|
|
||||||
if (!json.getString("blog").equals("")) website = json.getString("blog");
|
if (!json.getString("blog").equals("")) website = json.getString("blog");
|
||||||
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2019-2020 GregTCLTK and Schlauer-Hax
|
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||||
*
|
*
|
||||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
* 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 not use this file except in compliance with the License.
|
||||||
|
|
@ -14,12 +14,13 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.bbn.hadder.commands.misc;
|
package one.bbn.hadder.commands.misc;
|
||||||
import com.bbn.hadder.commands.Command;
|
|
||||||
import com.bbn.hadder.commands.CommandEvent;
|
import one.bbn.hadder.commands.Command;
|
||||||
import com.bbn.hadder.core.Perm;
|
import one.bbn.hadder.commands.CommandEvent;
|
||||||
import com.bbn.hadder.core.Perms;
|
import one.bbn.hadder.core.Perm;
|
||||||
import com.bbn.hadder.utils.MessageEditor;
|
import one.bbn.hadder.core.Perms;
|
||||||
|
import one.bbn.hadder.utils.MessageEditor;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
@Perms(Perm.VOICE_MOVE_OTHERS)
|
@Perms(Perm.VOICE_MOVE_OTHERS)
|
||||||
|
|
@ -55,6 +56,27 @@ public class MoveAllCommand implements Command {
|
||||||
"commands.misc.moveall.error.source.int.title",
|
"commands.misc.moveall.error.source.int.title",
|
||||||
"commands.misc.moveall.error.source.int.description").build()).queue();
|
"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);
|
} else e.getHelpCommand().sendHelp(this, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -70,7 +92,7 @@ public class MoveAllCommand implements Command {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String usage() {
|
public String usage() {
|
||||||
return "[source-channel] [target-channel]";
|
return "([source-channel]) [target-channel]";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2019-2020 GregTCLTK and Schlauer-Hax
|
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||||
*
|
*
|
||||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
* 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 not use this file except in compliance with the License.
|
||||||
|
|
@ -14,11 +14,11 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.bbn.hadder.commands.misc;
|
package one.bbn.hadder.commands.misc;
|
||||||
|
|
||||||
import com.bbn.hadder.commands.Command;
|
import one.bbn.hadder.commands.Command;
|
||||||
import com.bbn.hadder.commands.CommandEvent;
|
import one.bbn.hadder.commands.CommandEvent;
|
||||||
import com.bbn.hadder.utils.MessageEditor;
|
import one.bbn.hadder.utils.MessageEditor;
|
||||||
import net.dv8tion.jda.api.EmbedBuilder;
|
import net.dv8tion.jda.api.EmbedBuilder;
|
||||||
import net.dv8tion.jda.api.entities.User;
|
import net.dv8tion.jda.api.entities.User;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2019-2020 GregTCLTK and Schlauer-Hax
|
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||||
*
|
*
|
||||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
* 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 not use this file except in compliance with the License.
|
||||||
|
|
@ -14,14 +14,12 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.bbn.hadder.commands.misc;
|
package one.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 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.EmbedBuilder;
|
||||||
import net.dv8tion.jda.api.entities.VoiceChannel;
|
import net.dv8tion.jda.api.entities.VoiceChannel;
|
||||||
|
|
||||||
|
|
@ -31,13 +29,13 @@ public class ScreenShareCommand implements Command {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void executed(String[] args, CommandEvent e) {
|
public void executed(String[] args, CommandEvent e) {
|
||||||
if (args.length>0) {
|
if (args.length > 0) {
|
||||||
if (args[0].matches("[0-9]*") && args.length==1 && args[0].length() == 18) {
|
if (args[0].matches("[0-9]*") && args.length == 1 && args[0].length() == 18) {
|
||||||
if (e.getGuild().getVoiceChannelById(args[0]) != null) {
|
if (e.getGuild().getVoiceChannelById(args[0]) != null) {
|
||||||
e.getChannel().sendMessage(e.getMessageEditor().getMessage(
|
e.getChannel().sendMessage(e.getMessageEditor().getMessage(
|
||||||
MessageEditor.MessageType.INFO,
|
MessageEditor.MessageType.INFO,
|
||||||
"commands.misc.screenshare.success.title", "")
|
"commands.misc.screenshare.success.title", "")
|
||||||
.setDescription("http://discordapp.com/channels/" + e.getGuild().getId() + "/" + args[0] + "/").build()).queue();
|
.setDescription("http://discord.com/channels/" + e.getGuild().getId() + "/" + args[0] + "/").build()).queue();
|
||||||
} else {
|
} 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.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);
|
e.getHelpCommand().sendHelp(this, e);
|
||||||
|
|
@ -45,7 +43,7 @@ public class ScreenShareCommand implements Command {
|
||||||
} else {
|
} else {
|
||||||
List<VoiceChannel> vcs = e.getGuild().getVoiceChannelsByName(String.join(" ", args), true);
|
List<VoiceChannel> vcs = e.getGuild().getVoiceChannelsByName(String.join(" ", args), true);
|
||||||
if (vcs.size() > 1) {
|
if (vcs.size() > 1) {
|
||||||
EmbedBuilder eb = e.getMessageEditor().getMessage(MessageType.WARNING, "commands.misc.screenshare.channel.error.title", "commands.misc.screenshare.channel.error.description");
|
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++) {
|
for (int i = 0; i < vcs.size(); i++) {
|
||||||
VoiceChannel voiceChannel = vcs.get(i);
|
VoiceChannel voiceChannel = vcs.get(i);
|
||||||
eb.addField(i + ": " + voiceChannel.getName(), voiceChannel.getId(), false);
|
eb.addField(i + ": " + voiceChannel.getName(), voiceChannel.getId(), false);
|
||||||
|
|
@ -56,7 +54,7 @@ public class ScreenShareCommand implements Command {
|
||||||
int i = Integer.parseInt(msge.getMessage().getContentRaw());
|
int i = Integer.parseInt(msge.getMessage().getContentRaw());
|
||||||
if (vcs.size() > i) {
|
if (vcs.size() > i) {
|
||||||
e.getChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.INFO, "commands.misc.screenshare.success.title", "")
|
e.getChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.INFO, "commands.misc.screenshare.success.title", "")
|
||||||
.setDescription("http://discordapp.com/channels/" + e.getGuild().getId() + "/" + vcs.get(i).getId() + "/").build()).queue();
|
.setDescription("http://discord.com/channels/" + e.getGuild().getId() + "/" + vcs.get(i).getId() + "/").build()).queue();
|
||||||
} else {
|
} else {
|
||||||
e.getChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.ERROR, "commands.misc.screenshare.number.error.title", "").build()).queue();
|
e.getChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.ERROR, "commands.misc.screenshare.number.error.title", "").build()).queue();
|
||||||
e.getHelpCommand().sendHelp(this, e);
|
e.getHelpCommand().sendHelp(this, e);
|
||||||
|
|
@ -66,12 +64,12 @@ public class ScreenShareCommand implements Command {
|
||||||
e.getHelpCommand().sendHelp(this, e);
|
e.getHelpCommand().sendHelp(this, e);
|
||||||
}
|
}
|
||||||
}, e.getJDA(), e.getAuthor());
|
}, e.getJDA(), e.getAuthor());
|
||||||
} else if (vcs.size()==0) {
|
} 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.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);
|
e.getHelpCommand().sendHelp(this, e);
|
||||||
} else {
|
} else {
|
||||||
e.getChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.INFO, "commands.misc.screenshare.success.title", "")
|
e.getChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.INFO, "commands.misc.screenshare.success.title", "")
|
||||||
.setDescription("http://discordapp.com/channels/" + e.getGuild().getId() + "/" + vcs.get(0).getId() + "/").build()).queue();
|
.setDescription("http://discord.com/channels/" + e.getGuild().getId() + "/" + vcs.get(0).getId() + "/").build()).queue();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else e.getHelpCommand().sendHelp(this, e);
|
} else e.getHelpCommand().sendHelp(this, e);
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2019-2020 GregTCLTK and Schlauer-Hax
|
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||||
*
|
*
|
||||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
* 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 not use this file except in compliance with the License.
|
||||||
|
|
@ -14,11 +14,11 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.bbn.hadder.commands.misc;
|
package one.bbn.hadder.commands.misc;
|
||||||
|
|
||||||
import com.bbn.hadder.commands.Command;
|
import one.bbn.hadder.commands.Command;
|
||||||
import com.bbn.hadder.commands.CommandEvent;
|
import one.bbn.hadder.commands.CommandEvent;
|
||||||
import com.bbn.hadder.utils.MessageEditor;
|
import one.bbn.hadder.utils.MessageEditor;
|
||||||
import net.dv8tion.jda.api.EmbedBuilder;
|
import net.dv8tion.jda.api.EmbedBuilder;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
@ -38,7 +38,7 @@ public class ServerStatsCommand implements Command {
|
||||||
.addField("Emotes", String.valueOf(e.getGuild().getEmotes().size()), true)
|
.addField("Emotes", String.valueOf(e.getGuild().getEmotes().size()), true)
|
||||||
.addField("Categories", String.valueOf(e.getGuild().getCategories().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("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("Verification Level", e.getGuild().getVerificationLevel().getKey() + ": " + e.getGuild().getVerificationLevel(), true)
|
||||||
.addField("MFA Level", String.valueOf(e.getGuild().getRequiredMFALevel().getKey()), true)
|
.addField("MFA Level", String.valueOf(e.getGuild().getRequiredMFALevel().getKey()), true)
|
||||||
.addField("Member Count", String.valueOf(e.getGuild().getMemberCount()), true)
|
.addField("Member Count", String.valueOf(e.getGuild().getMemberCount()), true)
|
||||||
.addField("Explicit Content Level", e.getGuild().getExplicitContentLevel().getKey() + ": " + e.getGuild().getExplicitContentLevel(), true)
|
.addField("Explicit Content Level", e.getGuild().getExplicitContentLevel().getKey() + ": " + e.getGuild().getExplicitContentLevel(), true)
|
||||||
|
|
@ -48,7 +48,8 @@ public class ServerStatsCommand implements Command {
|
||||||
.setImage(e.getGuild().getBannerUrl());
|
.setImage(e.getGuild().getBannerUrl());
|
||||||
|
|
||||||
if (e.getGuild().getDescription() != null) eb.addField("Description", e.getGuild().getDescription(), true);
|
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);
|
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();
|
e.getTextChannel().sendMessage(eb.build()).queue();
|
||||||
}
|
}
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2019-2020 GregTCLTK and Schlauer-Hax
|
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||||
*
|
*
|
||||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
* 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 not use this file except in compliance with the License.
|
||||||
|
|
@ -14,13 +14,13 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.bbn.hadder.commands.moderation;
|
package one.bbn.hadder.commands.moderation;
|
||||||
|
|
||||||
import com.bbn.hadder.commands.Command;
|
import one.bbn.hadder.commands.Command;
|
||||||
import com.bbn.hadder.commands.CommandEvent;
|
import one.bbn.hadder.commands.CommandEvent;
|
||||||
import com.bbn.hadder.core.Perm;
|
import one.bbn.hadder.core.Perm;
|
||||||
import com.bbn.hadder.core.Perms;
|
import one.bbn.hadder.core.Perms;
|
||||||
import com.bbn.hadder.utils.MessageEditor;
|
import one.bbn.hadder.utils.MessageEditor;
|
||||||
import net.dv8tion.jda.api.entities.Member;
|
import net.dv8tion.jda.api.entities.Member;
|
||||||
|
|
||||||
@Perms(Perm.BAN_MEMBERS)
|
@Perms(Perm.BAN_MEMBERS)
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2019-2020 GregTCLTK and Schlauer-Hax
|
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||||
*
|
*
|
||||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
* 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 not use this file except in compliance with the License.
|
||||||
|
|
@ -14,13 +14,13 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.bbn.hadder.commands.moderation;
|
package one.bbn.hadder.commands.moderation;
|
||||||
|
|
||||||
import com.bbn.hadder.commands.Command;
|
import one.bbn.hadder.commands.Command;
|
||||||
import com.bbn.hadder.commands.CommandEvent;
|
import one.bbn.hadder.commands.CommandEvent;
|
||||||
import com.bbn.hadder.core.Perm;
|
import one.bbn.hadder.core.Perm;
|
||||||
import com.bbn.hadder.core.Perms;
|
import one.bbn.hadder.core.Perms;
|
||||||
import com.bbn.hadder.utils.MessageEditor;
|
import one.bbn.hadder.utils.MessageEditor;
|
||||||
import net.dv8tion.jda.api.Permission;
|
import net.dv8tion.jda.api.Permission;
|
||||||
import net.dv8tion.jda.api.entities.Message;
|
import net.dv8tion.jda.api.entities.Message;
|
||||||
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2019-2020 GregTCLTK and Schlauer-Hax
|
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||||
*
|
*
|
||||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
* 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 not use this file except in compliance with the License.
|
||||||
|
|
@ -14,13 +14,13 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.bbn.hadder.commands.moderation;
|
package one.bbn.hadder.commands.moderation;
|
||||||
|
|
||||||
import com.bbn.hadder.commands.Command;
|
import one.bbn.hadder.commands.Command;
|
||||||
import com.bbn.hadder.commands.CommandEvent;
|
import one.bbn.hadder.commands.CommandEvent;
|
||||||
import com.bbn.hadder.core.Perm;
|
import one.bbn.hadder.core.Perm;
|
||||||
import com.bbn.hadder.core.Perms;
|
import one.bbn.hadder.core.Perms;
|
||||||
import com.bbn.hadder.utils.MessageEditor;
|
import one.bbn.hadder.utils.MessageEditor;
|
||||||
import net.dv8tion.jda.api.entities.TextChannel;
|
import net.dv8tion.jda.api.entities.TextChannel;
|
||||||
|
|
||||||
@Perms(Perm.MANAGE_SERVER)
|
@Perms(Perm.MANAGE_SERVER)
|
||||||
|
|
@ -28,7 +28,7 @@ public class EditRulesCommand implements Command {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void executed(String[] args, CommandEvent e) {
|
public void executed(String[] args, CommandEvent e) {
|
||||||
if (e.getRethinkServer().getMessageID().length() == 18) {
|
if (e.getMongoServer().getMessageID().length() == 18) {
|
||||||
e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.INFO,
|
e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.INFO,
|
||||||
"commands.moderation.editrules.message.title",
|
"commands.moderation.editrules.message.title",
|
||||||
"commands.moderation.editrules.message.description").build()).queue();
|
"commands.moderation.editrules.message.description").build()).queue();
|
||||||
|
|
@ -68,13 +68,13 @@ public class EditRulesCommand implements Command {
|
||||||
} else {
|
} else {
|
||||||
e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.ERROR,
|
e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.ERROR,
|
||||||
"commands.moderation.editrules.error.title", "",
|
"commands.moderation.editrules.error.title", "",
|
||||||
"commands.moderation.editrules.error.description", e.getRethinkServer().getPrefix()).build()).queue();
|
"commands.moderation.editrules.error.description", e.getMongoServer().getPrefix()).build()).queue();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void checkChannel(CommandEvent e, String rules, TextChannel channel) {
|
public void checkChannel(CommandEvent e, String rules, TextChannel channel) {
|
||||||
try {
|
try {
|
||||||
channel.retrieveMessageById(e.getRethinkServer().getMessageID()).queue();
|
channel.retrieveMessageById(e.getMongoServer().getMessageID()).queue();
|
||||||
setRules(e, rules, channel);
|
setRules(e, rules, channel);
|
||||||
e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.INFO,
|
e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.INFO,
|
||||||
"commands.moderation.editrules.success.title",
|
"commands.moderation.editrules.success.title",
|
||||||
|
|
@ -87,7 +87,7 @@ public class EditRulesCommand implements Command {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setRules(CommandEvent e, String rules, TextChannel channel) {
|
public void setRules(CommandEvent e, String rules, TextChannel channel) {
|
||||||
channel.retrieveMessageById(e.getRethinkServer().getMessageID()).complete().editMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.INFO)
|
channel.retrieveMessageById(e.getMongoServer().getMessageID()).complete().editMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.INFO)
|
||||||
.setTitle("Rules")
|
.setTitle("Rules")
|
||||||
.setDescription(rules)
|
.setDescription(rules)
|
||||||
.build()).queue();
|
.build()).queue();
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2019-2020 GregTCLTK and Schlauer-Hax
|
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||||
*
|
*
|
||||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
* 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 not use this file except in compliance with the License.
|
||||||
|
|
@ -14,13 +14,13 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.bbn.hadder.commands.moderation;
|
package one.bbn.hadder.commands.moderation;
|
||||||
|
|
||||||
import com.bbn.hadder.commands.Command;
|
import one.bbn.hadder.commands.Command;
|
||||||
import com.bbn.hadder.commands.CommandEvent;
|
import one.bbn.hadder.commands.CommandEvent;
|
||||||
import com.bbn.hadder.core.Perm;
|
import one.bbn.hadder.core.Perm;
|
||||||
import com.bbn.hadder.core.Perms;
|
import one.bbn.hadder.core.Perms;
|
||||||
import com.bbn.hadder.utils.MessageEditor;
|
import one.bbn.hadder.utils.MessageEditor;
|
||||||
|
|
||||||
@Perms(Perm.MANAGE_SERVER)
|
@Perms(Perm.MANAGE_SERVER)
|
||||||
public class InviteDetectCommand implements Command {
|
public class InviteDetectCommand implements Command {
|
||||||
|
|
@ -31,15 +31,15 @@ public class InviteDetectCommand implements Command {
|
||||||
String opinion = args[0].toLowerCase();
|
String opinion = args[0].toLowerCase();
|
||||||
switch (opinion) {
|
switch (opinion) {
|
||||||
case "on":
|
case "on":
|
||||||
if (!e.getRethinkServer().hasInviteDetect()) {
|
if (!e.getMongoServer().hasInviteDetect()) {
|
||||||
e.getRethinkServer().setInviteDetect(true);
|
e.getMongoServer().setInviteDetect(true);
|
||||||
e.getTextChannel().sendMessage(
|
e.getTextChannel().sendMessage(
|
||||||
e.getMessageEditor().getMessage(
|
e.getMessageEditor().getMessage(
|
||||||
MessageEditor.MessageType.INFO,
|
MessageEditor.MessageType.INFO,
|
||||||
"commands.moderation.invitedetect.activate.success.title",
|
"commands.moderation.invitedetect.activate.success.title",
|
||||||
"commands.moderation.invitedetect.activate.success.description")
|
"commands.moderation.invitedetect.activate.success.description")
|
||||||
.build()).queue();
|
.build()).queue();
|
||||||
e.getRethinkServer().push();
|
e.getMongoServer().push();
|
||||||
} else {
|
} else {
|
||||||
e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(
|
e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(
|
||||||
MessageEditor.MessageType.ERROR,
|
MessageEditor.MessageType.ERROR,
|
||||||
|
|
@ -50,14 +50,14 @@ public class InviteDetectCommand implements Command {
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "off":
|
case "off":
|
||||||
if (e.getRethinkServer().hasInviteDetect()) {
|
if (e.getMongoServer().hasInviteDetect()) {
|
||||||
e.getRethinkServer().setInviteDetect(false);
|
e.getMongoServer().setInviteDetect(false);
|
||||||
e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(
|
e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(
|
||||||
MessageEditor.MessageType.INFO,
|
MessageEditor.MessageType.INFO,
|
||||||
"commands.moderation.invitedetect.deactivate.success.title",
|
"commands.moderation.invitedetect.deactivate.success.title",
|
||||||
"commands.moderation.invitedetect.deactivate.success.description")
|
"commands.moderation.invitedetect.deactivate.success.description")
|
||||||
.build()).queue();
|
.build()).queue();
|
||||||
e.getRethinkServer().push();
|
e.getMongoServer().push();
|
||||||
} else {
|
} else {
|
||||||
e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(
|
e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(
|
||||||
MessageEditor.MessageType.ERROR,
|
MessageEditor.MessageType.ERROR,
|
||||||
|
|
@ -68,13 +68,14 @@ public class InviteDetectCommand implements Command {
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
e.getHelpCommand().sendHelp(this, e);
|
e.getHelpCommand().sendHelp(this, e);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
} else e.getHelpCommand().sendHelp(this, e);
|
} else e.getHelpCommand().sendHelp(this, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String[] labels() {
|
public String[] labels() {
|
||||||
return new String[]{"invitedetect", "detectinvite"};
|
return new String[]{"invitedetect", "detectinvite", "invite-detect"};
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2019-2020 GregTCLTK and Schlauer-Hax
|
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||||
*
|
*
|
||||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
* 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 not use this file except in compliance with the License.
|
||||||
|
|
@ -14,13 +14,13 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.bbn.hadder.commands.moderation;
|
package one.bbn.hadder.commands.moderation;
|
||||||
|
|
||||||
import com.bbn.hadder.commands.Command;
|
import one.bbn.hadder.commands.Command;
|
||||||
import com.bbn.hadder.commands.CommandEvent;
|
import one.bbn.hadder.commands.CommandEvent;
|
||||||
import com.bbn.hadder.core.Perm;
|
import one.bbn.hadder.core.Perm;
|
||||||
import com.bbn.hadder.core.Perms;
|
import one.bbn.hadder.core.Perms;
|
||||||
import com.bbn.hadder.utils.MessageEditor;
|
import one.bbn.hadder.utils.MessageEditor;
|
||||||
import net.dv8tion.jda.api.entities.Member;
|
import net.dv8tion.jda.api.entities.Member;
|
||||||
|
|
||||||
@Perms(Perm.KICK_MEMBERS)
|
@Perms(Perm.KICK_MEMBERS)
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2019-2020 GregTCLTK and Schlauer-Hax
|
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||||
*
|
*
|
||||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
* 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 not use this file except in compliance with the License.
|
||||||
|
|
@ -14,13 +14,13 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.bbn.hadder.commands.moderation;
|
package one.bbn.hadder.commands.moderation;
|
||||||
|
|
||||||
import com.bbn.hadder.commands.Command;
|
import one.bbn.hadder.commands.Command;
|
||||||
import com.bbn.hadder.commands.CommandEvent;
|
import one.bbn.hadder.commands.CommandEvent;
|
||||||
import com.bbn.hadder.core.Perm;
|
import one.bbn.hadder.core.Perm;
|
||||||
import com.bbn.hadder.core.Perms;
|
import one.bbn.hadder.core.Perms;
|
||||||
import com.bbn.hadder.utils.MessageEditor;
|
import one.bbn.hadder.utils.MessageEditor;
|
||||||
import net.dv8tion.jda.api.Permission;
|
import net.dv8tion.jda.api.Permission;
|
||||||
import net.dv8tion.jda.api.entities.Member;
|
import net.dv8tion.jda.api.entities.Member;
|
||||||
|
|
||||||
|
|
@ -34,8 +34,8 @@ public class NickCommand implements Command {
|
||||||
if (!e.getMessage().getMentionedMembers().get(0).getId().equals(e.getGuild().getSelfMember().getId())) {
|
if (!e.getMessage().getMentionedMembers().get(0).getId().equals(e.getGuild().getSelfMember().getId())) {
|
||||||
if (e.getGuild().getSelfMember().canInteract(e.getMessage().getMentionedMembers().get(0))) {
|
if (e.getGuild().getSelfMember().canInteract(e.getMessage().getMentionedMembers().get(0))) {
|
||||||
if (args.length > 1) {
|
if (args.length > 1) {
|
||||||
if (e.getMessage().getContentRaw().startsWith(e.getRethinkUser().getPrefix())) {
|
if (e.getMessage().getContentRaw().startsWith(e.getMongoUser().getPrefix())) {
|
||||||
e.getGuild().modifyNickname(e.getMessage().getMentionedMembers().get(0), e.getMessage().getContentRaw().replaceFirst(e.getRethinkUser().getPrefix() + "nick " + args[0], "")).reason("Nicked by " + e.getAuthor().getAsTag()).queue();
|
e.getGuild().modifyNickname(e.getMessage().getMentionedMembers().get(0), e.getMessage().getContentRaw().replaceFirst(e.getMongoUser().getPrefix() + "nick " + args[0], "")).reason("Nicked by " + e.getAuthor().getAsTag()).queue();
|
||||||
e.getTextChannel().sendMessage(
|
e.getTextChannel().sendMessage(
|
||||||
e.getMessageEditor().getMessage(
|
e.getMessageEditor().getMessage(
|
||||||
MessageEditor.MessageType.INFO,
|
MessageEditor.MessageType.INFO,
|
||||||
|
|
@ -44,8 +44,8 @@ public class NickCommand implements Command {
|
||||||
"commands.moderation.nick.success.description",
|
"commands.moderation.nick.success.description",
|
||||||
e.getMessage().getMentionedMembers().get(0).getUser().getAsTag()
|
e.getMessage().getMentionedMembers().get(0).getUser().getAsTag()
|
||||||
).build()).queue();
|
).build()).queue();
|
||||||
} else if (e.getMessage().getContentRaw().startsWith(e.getRethinkServer().getPrefix())) {
|
} else if (e.getMessage().getContentRaw().startsWith(e.getMongoServer().getPrefix())) {
|
||||||
e.getGuild().modifyNickname(e.getMessage().getMentionedMembers().get(0), e.getMessage().getContentRaw().replaceFirst(e.getRethinkServer().getPrefix() + "nick " + args[0], "")).reason("Nicked by " + e.getAuthor().getAsTag()).queue();
|
e.getGuild().modifyNickname(e.getMessage().getMentionedMembers().get(0), e.getMessage().getContentRaw().replaceFirst(e.getMongoServer().getPrefix() + "nick " + args[0], "")).reason("Nicked by " + e.getAuthor().getAsTag()).queue();
|
||||||
e.getTextChannel().sendMessage(
|
e.getTextChannel().sendMessage(
|
||||||
e.getMessageEditor().getMessage(
|
e.getMessageEditor().getMessage(
|
||||||
MessageEditor.MessageType.INFO,
|
MessageEditor.MessageType.INFO,
|
||||||
|
|
@ -59,8 +59,8 @@ public class NickCommand implements Command {
|
||||||
e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.NO_SELF_PERMISSION).build()).queue();
|
e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.NO_SELF_PERMISSION).build()).queue();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (e.getMessage().getContentRaw().startsWith(e.getRethinkUser().getPrefix())) {
|
if (e.getMessage().getContentRaw().startsWith(e.getMongoUser().getPrefix())) {
|
||||||
e.getGuild().getSelfMember().modifyNickname(e.getMessage().getContentRaw().replaceFirst(e.getRethinkUser().getPrefix() + "nick " + args[0], "")).reason("Nicked by " + e.getAuthor().getAsTag()).queue();
|
e.getGuild().getSelfMember().modifyNickname(e.getMessage().getContentRaw().replaceFirst(e.getMongoUser().getPrefix() + "nick " + args[0], "")).reason("Nicked by " + e.getAuthor().getAsTag()).queue();
|
||||||
e.getTextChannel().sendMessage(
|
e.getTextChannel().sendMessage(
|
||||||
e.getMessageEditor().getMessage(
|
e.getMessageEditor().getMessage(
|
||||||
MessageEditor.MessageType.INFO,
|
MessageEditor.MessageType.INFO,
|
||||||
|
|
@ -68,8 +68,8 @@ public class NickCommand implements Command {
|
||||||
"✅",
|
"✅",
|
||||||
"commands.moderation.nick.myself.success.description",
|
"commands.moderation.nick.myself.success.description",
|
||||||
"").build()).queue();
|
"").build()).queue();
|
||||||
} else if (e.getMessage().getContentRaw().startsWith(e.getRethinkServer().getPrefix())) {
|
} else if (e.getMessage().getContentRaw().startsWith(e.getMongoServer().getPrefix())) {
|
||||||
e.getGuild().getSelfMember().modifyNickname(e.getMessage().getContentRaw().replaceFirst(e.getRethinkServer().getPrefix() + "nick " + args[0], "")).reason("Nicked by " + e.getAuthor().getAsTag()).queue();
|
e.getGuild().getSelfMember().modifyNickname(e.getMessage().getContentRaw().replaceFirst(e.getMongoServer().getPrefix() + "nick " + args[0], "")).reason("Nicked by " + e.getAuthor().getAsTag()).queue();
|
||||||
e.getTextChannel().sendMessage(
|
e.getTextChannel().sendMessage(
|
||||||
e.getMessageEditor().getMessage(
|
e.getMessageEditor().getMessage(
|
||||||
MessageEditor.MessageType.INFO,
|
MessageEditor.MessageType.INFO,
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2019-2020 GregTCLTK and Schlauer-Hax
|
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||||
*
|
*
|
||||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
* 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 not use this file except in compliance with the License.
|
||||||
|
|
@ -14,13 +14,13 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.bbn.hadder.commands.moderation;
|
package one.bbn.hadder.commands.moderation;
|
||||||
|
|
||||||
import com.bbn.hadder.commands.Command;
|
import one.bbn.hadder.commands.Command;
|
||||||
import com.bbn.hadder.commands.CommandEvent;
|
import one.bbn.hadder.commands.CommandEvent;
|
||||||
import com.bbn.hadder.core.Perm;
|
import one.bbn.hadder.core.Perm;
|
||||||
import com.bbn.hadder.core.Perms;
|
import one.bbn.hadder.core.Perms;
|
||||||
import com.bbn.hadder.utils.MessageEditor;
|
import one.bbn.hadder.utils.MessageEditor;
|
||||||
|
|
||||||
@Perms(Perm.MANAGE_SERVER)
|
@Perms(Perm.MANAGE_SERVER)
|
||||||
public class PrefixCommand implements Command {
|
public class PrefixCommand implements Command {
|
||||||
|
|
@ -29,8 +29,8 @@ public class PrefixCommand implements Command {
|
||||||
public void executed(String[] args, CommandEvent e) {
|
public void executed(String[] args, CommandEvent e) {
|
||||||
if (args.length == 1) {
|
if (args.length == 1) {
|
||||||
if (!args[0].contains("\"")) {
|
if (!args[0].contains("\"")) {
|
||||||
e.getRethinkServer().setPrefix(args[0]);
|
e.getMongoServer().setPrefix(args[0]);
|
||||||
e.getRethinkServer().push();
|
e.getMongoServer().push();
|
||||||
e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(
|
e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(
|
||||||
MessageEditor.MessageType.INFO,
|
MessageEditor.MessageType.INFO,
|
||||||
"commands.moderation.prefix.success.title",
|
"commands.moderation.prefix.success.title",
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2019-2020 GregTCLTK and Schlauer-Hax
|
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||||
*
|
*
|
||||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
* 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 not use this file except in compliance with the License.
|
||||||
|
|
@ -14,13 +14,13 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.bbn.hadder.commands.moderation;
|
package one.bbn.hadder.commands.moderation;
|
||||||
|
|
||||||
import com.bbn.hadder.commands.Command;
|
import one.bbn.hadder.commands.Command;
|
||||||
import com.bbn.hadder.commands.CommandEvent;
|
import one.bbn.hadder.commands.CommandEvent;
|
||||||
import com.bbn.hadder.core.Perm;
|
import one.bbn.hadder.core.Perm;
|
||||||
import com.bbn.hadder.core.Perms;
|
import one.bbn.hadder.core.Perms;
|
||||||
import com.bbn.hadder.utils.MessageEditor;
|
import one.bbn.hadder.utils.MessageEditor;
|
||||||
import net.dv8tion.jda.api.Permission;
|
import net.dv8tion.jda.api.Permission;
|
||||||
import net.dv8tion.jda.api.Region;
|
import net.dv8tion.jda.api.Region;
|
||||||
|
|
||||||
|
|
@ -108,14 +108,14 @@ public class RegionChangeCommand implements Command {
|
||||||
.build()).queue();
|
.build()).queue();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setRegion (Region region, String region_name, CommandEvent e) {
|
public void setRegion(Region region, String region_name, CommandEvent e) {
|
||||||
e.getGuild().getManager().setRegion(region).reason("Region changed by " + e.getAuthor().getAsTag()).queue();
|
e.getGuild().getManager().setRegion(region).reason("Region changed by " + e.getAuthor().getAsTag()).queue();
|
||||||
e.getTextChannel().sendMessage(
|
e.getTextChannel().sendMessage(
|
||||||
e.getMessageEditor().getMessage(
|
e.getMessageEditor().getMessage(
|
||||||
MessageEditor.MessageType.INFO,
|
MessageEditor.MessageType.INFO,
|
||||||
"commands.moderation.regionchange.success.title", "",
|
"commands.moderation.regionchange.success.title", "",
|
||||||
"commands.moderation.regionchange.success.description", region_name)
|
"commands.moderation.regionchange.success.description", region_name)
|
||||||
.build()).queue();
|
.build()).queue();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2019-2020 GregTCLTK and Schlauer-Hax
|
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||||
*
|
*
|
||||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
* 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 not use this file except in compliance with the License.
|
||||||
|
|
@ -14,13 +14,13 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.bbn.hadder.commands.moderation;
|
package one.bbn.hadder.commands.moderation;
|
||||||
|
|
||||||
import com.bbn.hadder.commands.Command;
|
import one.bbn.hadder.commands.Command;
|
||||||
import com.bbn.hadder.commands.CommandEvent;
|
import one.bbn.hadder.commands.CommandEvent;
|
||||||
import com.bbn.hadder.core.Perm;
|
import one.bbn.hadder.core.Perm;
|
||||||
import com.bbn.hadder.core.Perms;
|
import one.bbn.hadder.core.Perms;
|
||||||
import com.bbn.hadder.utils.MessageEditor;
|
import one.bbn.hadder.utils.MessageEditor;
|
||||||
import net.dv8tion.jda.api.Permission;
|
import net.dv8tion.jda.api.Permission;
|
||||||
import net.dv8tion.jda.api.entities.Member;
|
import net.dv8tion.jda.api.entities.Member;
|
||||||
import net.dv8tion.jda.api.entities.Role;
|
import net.dv8tion.jda.api.entities.Role;
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2019-2020 GregTCLTK and Schlauer-Hax
|
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||||
*
|
*
|
||||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
* 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 not use this file except in compliance with the License.
|
||||||
|
|
@ -14,14 +14,14 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.bbn.hadder.commands.moderation;
|
package one.bbn.hadder.commands.moderation;
|
||||||
|
|
||||||
import com.bbn.hadder.commands.Command;
|
import one.bbn.hadder.commands.Command;
|
||||||
import com.bbn.hadder.commands.CommandEvent;
|
import one.bbn.hadder.commands.CommandEvent;
|
||||||
import com.bbn.hadder.core.Perm;
|
import one.bbn.hadder.core.Perm;
|
||||||
import com.bbn.hadder.core.Perms;
|
import one.bbn.hadder.core.Perms;
|
||||||
import com.bbn.hadder.utils.EventWaiter;
|
import one.bbn.hadder.utils.EventWaiter;
|
||||||
import com.bbn.hadder.utils.MessageEditor;
|
import one.bbn.hadder.utils.MessageEditor;
|
||||||
import net.dv8tion.jda.api.Permission;
|
import net.dv8tion.jda.api.Permission;
|
||||||
import net.dv8tion.jda.api.entities.Emote;
|
import net.dv8tion.jda.api.entities.Emote;
|
||||||
import net.dv8tion.jda.api.entities.Message;
|
import net.dv8tion.jda.api.entities.Message;
|
||||||
|
|
@ -86,7 +86,7 @@ public class RulesCommand implements Command {
|
||||||
"",
|
"",
|
||||||
"commands.moderation.rules.rules.description",
|
"commands.moderation.rules.rules.description",
|
||||||
channel.getName())
|
channel.getName())
|
||||||
.build()).queue();
|
.build()).queue();
|
||||||
e.getEventWaiter().newOnMessageEventWaiter(e2 -> {
|
e.getEventWaiter().newOnMessageEventWaiter(e2 -> {
|
||||||
String message = e2.getMessage().getContentRaw();
|
String message = e2.getMessage().getContentRaw();
|
||||||
e2.getChannel().sendMessage(
|
e2.getChannel().sendMessage(
|
||||||
|
|
@ -94,21 +94,21 @@ public class RulesCommand implements Command {
|
||||||
MessageEditor.MessageType.INFO,
|
MessageEditor.MessageType.INFO,
|
||||||
"commands.moderation.rules.role.title",
|
"commands.moderation.rules.role.title",
|
||||||
"commands.moderation.rules.role.description")
|
"commands.moderation.rules.role.description")
|
||||||
.build()).queue();
|
.build()).queue();
|
||||||
new EventWaiter().newOnMessageEventWaiter(e3 -> {
|
new EventWaiter().newOnMessageEventWaiter(e3 -> {
|
||||||
if (e3.getMessage().getMentionedRoles().size() == 1) {
|
if (e3.getMessage().getMentionedRoles().size() == 1) {
|
||||||
Role role = e3.getMessage().getMentionedRoles().get(0);
|
Role role = e3.getMessage().getMentionedRoles().get(0);
|
||||||
setRole(e, channel, message, e3, role);
|
setRole(e, channel, message, e3, role);
|
||||||
} else if (e3.getGuild().getRolesByName(e3.getMessage().getContentRaw(), true).size() > 0) {
|
} else if (e3.getGuild().getRolesByName(e3.getMessage().getContentRaw(), true).size() > 0) {
|
||||||
Role role = e3.getGuild().getRolesByName(e3.getMessage().getContentRaw(), true).get(0);
|
Role role = e3.getGuild().getRolesByName(e3.getMessage().getContentRaw(), true).get(0);
|
||||||
setRole(e, channel, message, e3, role);
|
setRole(e, channel, message, e3, role);
|
||||||
} else {
|
} else {
|
||||||
e3.getChannel().sendMessage(
|
e3.getChannel().sendMessage(
|
||||||
e.getMessageEditor().getMessage(
|
e.getMessageEditor().getMessage(
|
||||||
MessageEditor.MessageType.ERROR,
|
MessageEditor.MessageType.ERROR,
|
||||||
"commands.moderation.rules.role.error.title",
|
"commands.moderation.rules.role.error.title",
|
||||||
"commands.moderation.rules.role.error.description")
|
"commands.moderation.rules.role.error.description")
|
||||||
.build()).queue();
|
.build()).queue();
|
||||||
}
|
}
|
||||||
}, e.getJDA(), e.getAuthor());
|
}, e.getJDA(), e.getAuthor());
|
||||||
}, e.getJDA(), e.getAuthor());
|
}, e.getJDA(), e.getAuthor());
|
||||||
|
|
@ -124,7 +124,7 @@ public class RulesCommand implements Command {
|
||||||
MessageEditor.MessageType.ERROR,
|
MessageEditor.MessageType.ERROR,
|
||||||
"commands.moderation.rules.guild.error.title",
|
"commands.moderation.rules.guild.error.title",
|
||||||
"commands.moderation.rules.guild.error.description")
|
"commands.moderation.rules.guild.error.description")
|
||||||
.build()).queue();
|
.build()).queue();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -174,8 +174,8 @@ public class RulesCommand implements Command {
|
||||||
.build()).queue();
|
.build()).queue();
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
}
|
}
|
||||||
e.getRethinkServer().updateRules(rules.getId(), role.getId(), aemote.toString(), demote.toString());
|
e.getMongoServer().updateRules(rules.getId(), role.getId(), aemote.toString(), demote.toString());
|
||||||
e.getRethinkServer().push();
|
e.getMongoServer().push();
|
||||||
} else {
|
} else {
|
||||||
e.getTextChannel().sendMessage(
|
e.getTextChannel().sendMessage(
|
||||||
e.getMessageEditor().getMessage(
|
e.getMessageEditor().getMessage(
|
||||||
|
|
@ -220,8 +220,8 @@ public class RulesCommand implements Command {
|
||||||
.build()).queue();
|
.build()).queue();
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
}
|
}
|
||||||
e.getRethinkServer().updateRules(rules.getId(), role.getId(), aemote, demote);
|
e.getMongoServer().updateRules(rules.getId(), role.getId(), aemote, demote);
|
||||||
e.getRethinkServer().push();
|
e.getMongoServer().push();
|
||||||
} else {
|
} else {
|
||||||
e.getTextChannel().sendMessage(
|
e.getTextChannel().sendMessage(
|
||||||
e.getMessageEditor().getMessage(
|
e.getMessageEditor().getMessage(
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2019-2020 GregTCLTK and Schlauer-Hax
|
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||||
*
|
*
|
||||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
* 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 not use this file except in compliance with the License.
|
||||||
|
|
@ -14,39 +14,39 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.bbn.hadder.commands.moderation;
|
package one.bbn.hadder.commands.moderation;
|
||||||
|
|
||||||
import com.bbn.hadder.commands.Command;
|
import one.bbn.hadder.commands.Command;
|
||||||
import com.bbn.hadder.commands.CommandEvent;
|
import one.bbn.hadder.commands.CommandEvent;
|
||||||
import com.bbn.hadder.utils.MessageEditor;
|
import one.bbn.hadder.utils.MessageEditor;
|
||||||
import net.dv8tion.jda.api.entities.TextChannel;
|
import net.dv8tion.jda.api.entities.TextChannel;
|
||||||
|
|
||||||
public class StarboardCommand implements Command {
|
public class StarboardCommand implements Command {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void executed(String[] args, CommandEvent e) {
|
public void executed(String[] args, CommandEvent e) {
|
||||||
if (e.getMessage().getMentionedChannels().size()==1) {
|
if (e.getMessage().getMentionedChannels().size() == 1) {
|
||||||
e.getRethinkServer().setStarboard(e.getMessage().getMentionedChannels().get(0).getId());
|
e.getMongoServer().setStarboard(e.getMessage().getMentionedChannels().get(0).getId());
|
||||||
e.getChannel().sendMessage(
|
e.getChannel().sendMessage(
|
||||||
e.getMessageEditor().getMessage(
|
e.getMessageEditor().getMessage(
|
||||||
MessageEditor.MessageType.INFO,
|
MessageEditor.MessageType.INFO,
|
||||||
"commands.moderation.starboard.success.title","")
|
"commands.moderation.starboard.success.title", "")
|
||||||
.build())
|
.build())
|
||||||
.queue();
|
.queue();
|
||||||
} else {
|
} else {
|
||||||
if (args.length>0) {
|
if (args.length > 0) {
|
||||||
TextChannel channel = e.getGuild().getTextChannelById(args[0]);
|
TextChannel channel = e.getGuild().getTextChannelById(args[0]);
|
||||||
if (channel!=null) {
|
if (channel != null) {
|
||||||
e.getRethinkServer().setStarboard(channel.getId());
|
e.getMongoServer().setStarboard(channel.getId());
|
||||||
}
|
}
|
||||||
} else e.getHelpCommand().sendHelp(this, e);
|
} else e.getHelpCommand().sendHelp(this, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args.length == 2) {
|
if (args.length == 2) {
|
||||||
e.getRethinkServer().setNeededStars(args[1]);
|
e.getMongoServer().setNeededStars(args[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
e.getRethinkServer().push();
|
e.getMongoServer().push();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2019-2020 GregTCLTK and Schlauer-Hax
|
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||||
*
|
*
|
||||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
* 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 not use this file except in compliance with the License.
|
||||||
|
|
@ -14,16 +14,16 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.bbn.hadder.commands.music;
|
package one.bbn.hadder.commands.music;
|
||||||
|
|
||||||
import com.bbn.hadder.commands.Command;
|
import one.bbn.hadder.commands.Command;
|
||||||
import com.bbn.hadder.commands.CommandEvent;
|
import one.bbn.hadder.commands.CommandEvent;
|
||||||
import com.bbn.hadder.utils.MessageEditor;
|
import one.bbn.hadder.utils.MessageEditor;
|
||||||
import com.sedmelluq.discord.lavaplayer.filter.equalizer.EqualizerFactory;
|
import com.sedmelluq.discord.lavaplayer.filter.equalizer.EqualizerFactory;
|
||||||
|
|
||||||
public class BassCommand implements Command {
|
public class BassCommand implements Command {
|
||||||
private static final float[] BASS_BOOST = { 0.2f, 0.15f, 0.1f, 0.05f, 0.0f, -0.05f, -0.1f, -0.1f, -0.1f, -0.1f, -0.1f,
|
private static final float[] BASS_BOOST = {0.2f, 0.15f, 0.1f, 0.05f, 0.0f, -0.05f, -0.1f, -0.1f, -0.1f, -0.1f, -0.1f,
|
||||||
-0.1f, -0.1f, -0.1f, -0.1f };
|
-0.1f, -0.1f, -0.1f, -0.1f};
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void executed(String[] args, CommandEvent e) {
|
public void executed(String[] args, CommandEvent e) {
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2019-2020 GregTCLTK and Schlauer-Hax
|
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||||
*
|
*
|
||||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
* 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 not use this file except in compliance with the License.
|
||||||
|
|
@ -14,12 +14,12 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.bbn.hadder.commands.music;
|
package one.bbn.hadder.commands.music;
|
||||||
|
|
||||||
import com.bbn.hadder.audio.AudioPlayerSendHandler;
|
import one.bbn.hadder.audio.AudioPlayerSendHandler;
|
||||||
import com.bbn.hadder.commands.Command;
|
import one.bbn.hadder.commands.Command;
|
||||||
import com.bbn.hadder.commands.CommandEvent;
|
import one.bbn.hadder.commands.CommandEvent;
|
||||||
import com.bbn.hadder.utils.MessageEditor;
|
import one.bbn.hadder.utils.MessageEditor;
|
||||||
import net.dv8tion.jda.api.entities.Guild;
|
import net.dv8tion.jda.api.entities.Guild;
|
||||||
import net.dv8tion.jda.api.managers.AudioManager;
|
import net.dv8tion.jda.api.managers.AudioManager;
|
||||||
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2019-2020 GregTCLTK and Schlauer-Hax
|
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||||
*
|
*
|
||||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
* 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 not use this file except in compliance with the License.
|
||||||
|
|
@ -14,11 +14,11 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.bbn.hadder.commands.music;
|
package one.bbn.hadder.commands.music;
|
||||||
|
|
||||||
import com.bbn.hadder.commands.Command;
|
import one.bbn.hadder.commands.Command;
|
||||||
import com.bbn.hadder.commands.CommandEvent;
|
import one.bbn.hadder.commands.CommandEvent;
|
||||||
import com.bbn.hadder.utils.MessageEditor;
|
import one.bbn.hadder.utils.MessageEditor;
|
||||||
import com.sedmelluq.discord.lavaplayer.track.AudioTrack;
|
import com.sedmelluq.discord.lavaplayer.track.AudioTrack;
|
||||||
|
|
||||||
public class InfoCommand implements Command {
|
public class InfoCommand implements Command {
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2019-2020 GregTCLTK and Schlauer-Hax
|
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||||
*
|
*
|
||||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
* 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 not use this file except in compliance with the License.
|
||||||
|
|
@ -14,11 +14,11 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.bbn.hadder.commands.music;
|
package one.bbn.hadder.commands.music;
|
||||||
|
|
||||||
import com.bbn.hadder.commands.Command;
|
import one.bbn.hadder.commands.Command;
|
||||||
import com.bbn.hadder.commands.CommandEvent;
|
import one.bbn.hadder.commands.CommandEvent;
|
||||||
import com.bbn.hadder.utils.MessageEditor;
|
import one.bbn.hadder.utils.MessageEditor;
|
||||||
import net.dv8tion.jda.api.entities.VoiceChannel;
|
import net.dv8tion.jda.api.entities.VoiceChannel;
|
||||||
import net.dv8tion.jda.api.exceptions.InsufficientPermissionException;
|
import net.dv8tion.jda.api.exceptions.InsufficientPermissionException;
|
||||||
import net.dv8tion.jda.api.managers.AudioManager;
|
import net.dv8tion.jda.api.managers.AudioManager;
|
||||||
|
|
@ -29,7 +29,7 @@ public class JoinCommand implements Command {
|
||||||
public void executed(String[] args, CommandEvent e) {
|
public void executed(String[] args, CommandEvent e) {
|
||||||
if (e.getMember().getVoiceState().inVoiceChannel()) {
|
if (e.getMember().getVoiceState().inVoiceChannel()) {
|
||||||
AudioManager audioManager = e.getGuild().getAudioManager();
|
AudioManager audioManager = e.getGuild().getAudioManager();
|
||||||
if(!audioManager.isAttemptingToConnect()) {
|
if (!audioManager.isAttemptingToConnect()) {
|
||||||
VoiceChannel vc = e.getMember().getVoiceState().getChannel();
|
VoiceChannel vc = e.getMember().getVoiceState().getChannel();
|
||||||
if (e.getGuild().getSelfMember().getVoiceState().inVoiceChannel()) {
|
if (e.getGuild().getSelfMember().getVoiceState().inVoiceChannel()) {
|
||||||
if (!e.getGuild().getSelfMember().getVoiceState().getChannel().getId().equals(vc.getId())) {
|
if (!e.getGuild().getSelfMember().getVoiceState().getChannel().getId().equals(vc.getId())) {
|
||||||
|
|
@ -51,11 +51,11 @@ public class JoinCommand implements Command {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
e.getTextChannel().sendMessage(
|
e.getTextChannel().sendMessage(
|
||||||
e.getMessageEditor().getMessage(
|
e.getMessageEditor().getMessage(
|
||||||
MessageEditor.MessageType.WARNING,
|
MessageEditor.MessageType.WARNING,
|
||||||
"commands.music.join.error.connecting.already.title",
|
"commands.music.join.error.connecting.already.title",
|
||||||
"commands.music.join.error.connecting.already.description")
|
"commands.music.join.error.connecting.already.description")
|
||||||
.build()).queue();
|
.build()).queue();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
|
|
@ -74,16 +74,16 @@ public class JoinCommand implements Command {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(
|
e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(
|
||||||
MessageEditor.MessageType.WARNING,
|
MessageEditor.MessageType.WARNING,
|
||||||
"commands.music.join.error.connecting.trying.title",
|
"commands.music.join.error.connecting.trying.title",
|
||||||
"commands.music.join.error.connecting.trying.description")
|
"commands.music.join.error.connecting.trying.description")
|
||||||
.build()).queue();
|
.build()).queue();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(
|
e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(
|
||||||
MessageEditor.MessageType.ERROR,
|
MessageEditor.MessageType.ERROR,
|
||||||
"commands.music.join.error.channel.title",
|
"commands.music.join.error.channel.title",
|
||||||
"commands.music.join.error.channel.description")
|
"commands.music.join.error.channel.description")
|
||||||
.build()).queue();
|
.build()).queue();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2019-2020 GregTCLTK and Schlauer-Hax
|
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||||
*
|
*
|
||||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
* 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 not use this file except in compliance with the License.
|
||||||
|
|
@ -14,11 +14,11 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.bbn.hadder.commands.music;
|
package one.bbn.hadder.commands.music;
|
||||||
|
|
||||||
import com.bbn.hadder.commands.Command;
|
import one.bbn.hadder.commands.Command;
|
||||||
import com.bbn.hadder.commands.CommandEvent;
|
import one.bbn.hadder.commands.CommandEvent;
|
||||||
import com.bbn.hadder.utils.MessageEditor;
|
import one.bbn.hadder.utils.MessageEditor;
|
||||||
|
|
||||||
public class LoopCommand implements Command {
|
public class LoopCommand implements Command {
|
||||||
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2019-2020 GregTCLTK and Schlauer-Hax
|
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||||
*
|
*
|
||||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
* 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 not use this file except in compliance with the License.
|
||||||
|
|
@ -14,11 +14,11 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.bbn.hadder.commands.music;
|
package one.bbn.hadder.commands.music;
|
||||||
|
|
||||||
import com.bbn.hadder.commands.Command;
|
import one.bbn.hadder.commands.Command;
|
||||||
import com.bbn.hadder.commands.CommandEvent;
|
import one.bbn.hadder.commands.CommandEvent;
|
||||||
import com.bbn.hadder.utils.MessageEditor;
|
import one.bbn.hadder.utils.MessageEditor;
|
||||||
|
|
||||||
public class PauseCommand implements Command {
|
public class PauseCommand implements Command {
|
||||||
|
|
||||||
|
|
@ -35,7 +35,7 @@ public class PauseCommand implements Command {
|
||||||
} else {
|
} else {
|
||||||
e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.ERROR,
|
e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.ERROR,
|
||||||
"commands.music.pause.error.paused.title", "",
|
"commands.music.pause.error.paused.title", "",
|
||||||
"commands.music.pause.error.paused.description", e.getRethinkServer().getPrefix())
|
"commands.music.pause.error.paused.description", e.getMongoServer().getPrefix())
|
||||||
.build()).queue();
|
.build()).queue();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2019-2020 GregTCLTK and Schlauer-Hax
|
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||||
*
|
*
|
||||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
* 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 not use this file except in compliance with the License.
|
||||||
|
|
@ -14,11 +14,11 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.bbn.hadder.commands.music;
|
package one.bbn.hadder.commands.music;
|
||||||
|
|
||||||
import com.bbn.hadder.commands.Command;
|
import one.bbn.hadder.commands.Command;
|
||||||
import com.bbn.hadder.commands.CommandEvent;
|
import one.bbn.hadder.commands.CommandEvent;
|
||||||
import com.bbn.hadder.utils.MessageEditor;
|
import one.bbn.hadder.utils.MessageEditor;
|
||||||
import net.dv8tion.jda.api.entities.Message;
|
import net.dv8tion.jda.api.entities.Message;
|
||||||
import net.dv8tion.jda.api.exceptions.InsufficientPermissionException;
|
import net.dv8tion.jda.api.exceptions.InsufficientPermissionException;
|
||||||
|
|
||||||
|
|
@ -30,7 +30,7 @@ public class PlayCommand implements Command {
|
||||||
public void executed(String[] args, CommandEvent e) {
|
public void executed(String[] args, CommandEvent e) {
|
||||||
if (args.length > 0) {
|
if (args.length > 0) {
|
||||||
if (e.getMember().getVoiceState().inVoiceChannel()) {
|
if (e.getMember().getVoiceState().inVoiceChannel()) {
|
||||||
String input = e.getMessage().getContentRaw().replaceFirst(e.getRethinkServer().getPrefix() + "play ", "").replaceFirst(e.getRethinkUser().getPrefix() + "play ", "");
|
String input = e.getMessage().getContentRaw().replaceFirst(e.getMongoServer().getPrefix() + "play ", "").replaceFirst(e.getMongoUser().getPrefix() + "play ", "");
|
||||||
try {
|
try {
|
||||||
new URL(input).toURI();
|
new URL(input).toURI();
|
||||||
Message msg = e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.INFO,
|
Message msg = e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.INFO,
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2019-2020 GregTCLTK and Schlauer-Hax
|
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||||
*
|
*
|
||||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
* 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 not use this file except in compliance with the License.
|
||||||
|
|
@ -14,12 +14,12 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.bbn.hadder.commands.music;
|
package one.bbn.hadder.commands.music;
|
||||||
|
|
||||||
import com.bbn.hadder.audio.AudioInfo;
|
import one.bbn.hadder.audio.AudioInfo;
|
||||||
import com.bbn.hadder.commands.Command;
|
import one.bbn.hadder.commands.Command;
|
||||||
import com.bbn.hadder.commands.CommandEvent;
|
import one.bbn.hadder.commands.CommandEvent;
|
||||||
import com.bbn.hadder.utils.MessageEditor;
|
import one.bbn.hadder.utils.MessageEditor;
|
||||||
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
|
@ -38,10 +38,10 @@ public class QueueCommand implements Command {
|
||||||
long queuelength = 0;
|
long queuelength = 0;
|
||||||
for (AudioInfo g : queue) {
|
for (AudioInfo g : queue) {
|
||||||
queuelength = queuelength + g.getTrack().getInfo().length;
|
queuelength = queuelength + g.getTrack().getInfo().length;
|
||||||
builder.append("("+e.getAudioManager().getTimestamp(g.getTrack().getInfo().length)+") **").append(g.getTrack().getInfo().author).append("**: `").append(g.getTrack().getInfo().title).append("` \n");
|
builder.append("(" + e.getAudioManager().getTimestamp(g.getTrack().getInfo().length) + ") **").append(g.getTrack().getInfo().author).append("**: `").append(g.getTrack().getInfo().title).append("` \n");
|
||||||
}
|
}
|
||||||
e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.INFO,
|
e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.INFO,
|
||||||
"commands.music.queue.success.title", "("+String.valueOf(e.getAudioManager().getTimestamp(queuelength))+")",
|
"commands.music.queue.success.title", "(" + String.valueOf(e.getAudioManager().getTimestamp(queuelength)) + ")",
|
||||||
"commands.music.queue.success.description", builder.toString())
|
"commands.music.queue.success.description", builder.toString())
|
||||||
.build()).queue();
|
.build()).queue();
|
||||||
}
|
}
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2019-2020 GregTCLTK and Schlauer-Hax
|
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||||
*
|
*
|
||||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
* 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 not use this file except in compliance with the License.
|
||||||
|
|
@ -14,12 +14,12 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.bbn.hadder.commands.music;
|
package one.bbn.hadder.commands.music;
|
||||||
|
|
||||||
import com.bbn.hadder.commands.Command;
|
import one.bbn.hadder.commands.Command;
|
||||||
import com.bbn.hadder.commands.CommandEvent;
|
import one.bbn.hadder.commands.CommandEvent;
|
||||||
import com.bbn.hadder.core.Perm;
|
import one.bbn.hadder.core.Perm;
|
||||||
import com.bbn.hadder.core.Perms;
|
import one.bbn.hadder.core.Perms;
|
||||||
import net.dv8tion.jda.api.audio.AudioReceiveHandler;
|
import net.dv8tion.jda.api.audio.AudioReceiveHandler;
|
||||||
import net.dv8tion.jda.api.audio.AudioSendHandler;
|
import net.dv8tion.jda.api.audio.AudioSendHandler;
|
||||||
import net.dv8tion.jda.api.audio.UserAudio;
|
import net.dv8tion.jda.api.audio.UserAudio;
|
||||||
|
|
@ -51,7 +51,7 @@ public class RecordCommand implements Command {
|
||||||
audioManager.openAudioConnection(event.getMember().getVoiceState().getChannel());
|
audioManager.openAudioConnection(event.getMember().getVoiceState().getChannel());
|
||||||
} else {
|
} else {
|
||||||
for (Map.Entry<String, Queue<byte[]>> key : queue.entrySet()) {
|
for (Map.Entry<String, Queue<byte[]>> key : queue.entrySet()) {
|
||||||
File file = new File("./"+event.getJDA().getUserById(key.getKey())+".wav");
|
File file = new File("./" + event.getJDA().getUserById(key.getKey()) + ".wav");
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2019-2020 GregTCLTK and Schlauer-Hax
|
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||||
*
|
*
|
||||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
* 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 not use this file except in compliance with the License.
|
||||||
|
|
@ -14,11 +14,11 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.bbn.hadder.commands.music;
|
package one.bbn.hadder.commands.music;
|
||||||
|
|
||||||
import com.bbn.hadder.commands.Command;
|
import one.bbn.hadder.commands.Command;
|
||||||
import com.bbn.hadder.commands.CommandEvent;
|
import one.bbn.hadder.commands.CommandEvent;
|
||||||
import com.bbn.hadder.utils.MessageEditor;
|
import one.bbn.hadder.utils.MessageEditor;
|
||||||
|
|
||||||
public class SkipCommand implements Command {
|
public class SkipCommand implements Command {
|
||||||
|
|
||||||
|
|
@ -32,7 +32,12 @@ public class SkipCommand implements Command {
|
||||||
"commands.music.skip.success.title",
|
"commands.music.skip.success.title",
|
||||||
"commands.music.skip.success.description").build()).queue();
|
"commands.music.skip.success.description").build()).queue();
|
||||||
} else {
|
} else {
|
||||||
e.getTextChannel().sendMessage("Get rekt lol Mach Loop aus noob").queue();
|
e.getAudioManager().getTrackManager(e.getGuild()).setLoop(false);
|
||||||
|
e.getAudioManager().forceSkipTrack(e);
|
||||||
|
e.getAudioManager().getTrackManager(e.getGuild()).setLoop(true);
|
||||||
|
e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.INFO,
|
||||||
|
"commands.music.skip.success.title",
|
||||||
|
"commands.music.skip.success.description").build()).queue();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.ERROR,
|
e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.ERROR,
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2019-2020 GregTCLTK and Schlauer-Hax
|
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||||
*
|
*
|
||||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
* 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 not use this file except in compliance with the License.
|
||||||
|
|
@ -14,11 +14,11 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.bbn.hadder.commands.music;
|
package one.bbn.hadder.commands.music;
|
||||||
|
|
||||||
import com.bbn.hadder.commands.Command;
|
import one.bbn.hadder.commands.Command;
|
||||||
import com.bbn.hadder.commands.CommandEvent;
|
import one.bbn.hadder.commands.CommandEvent;
|
||||||
import com.bbn.hadder.utils.MessageEditor;
|
import one.bbn.hadder.utils.MessageEditor;
|
||||||
|
|
||||||
public class StopCommand implements Command {
|
public class StopCommand implements Command {
|
||||||
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2019-2020 GregTCLTK and Schlauer-Hax
|
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||||
*
|
*
|
||||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
* 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 not use this file except in compliance with the License.
|
||||||
|
|
@ -14,12 +14,12 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.bbn.hadder.commands.music;
|
package one.bbn.hadder.commands.music;
|
||||||
|
|
||||||
import com.bbn.hadder.commands.Command;
|
import one.bbn.hadder.commands.Command;
|
||||||
import com.bbn.hadder.commands.CommandEvent;
|
import one.bbn.hadder.commands.CommandEvent;
|
||||||
import com.bbn.hadder.utils.MessageEditor;
|
import one.bbn.hadder.utils.MessageEditor;
|
||||||
import org.jsoup.internal.StringUtil;
|
import org.codehaus.plexus.util.StringUtils;
|
||||||
|
|
||||||
public class VolumeCommand implements Command {
|
public class VolumeCommand implements Command {
|
||||||
|
|
||||||
|
|
@ -28,7 +28,7 @@ public class VolumeCommand implements Command {
|
||||||
if (args.length > 0) {
|
if (args.length > 0) {
|
||||||
if (e.getAudioManager().hasPlayer(e.getGuild()) && e.getAudioManager().getPlayer(e.getGuild()).getPlayingTrack() != null) {
|
if (e.getAudioManager().hasPlayer(e.getGuild()) && e.getAudioManager().getPlayer(e.getGuild()).getPlayingTrack() != null) {
|
||||||
if (e.getMember().getVoiceState().inVoiceChannel() && e.getGuild().getSelfMember().getVoiceState().inVoiceChannel() && e.getGuild().getSelfMember().getVoiceState().getChannel().equals(e.getMember().getVoiceState().getChannel())) {
|
if (e.getMember().getVoiceState().inVoiceChannel() && e.getGuild().getSelfMember().getVoiceState().inVoiceChannel() && e.getGuild().getSelfMember().getVoiceState().getChannel().equals(e.getMember().getVoiceState().getChannel())) {
|
||||||
if (StringUtil.isNumeric(args[0])) {
|
if (StringUtils.isNumeric(args[0])) {
|
||||||
int volume = Integer.parseInt(args[0]);
|
int volume = Integer.parseInt(args[0]);
|
||||||
if (volume < 201 && volume > 0 || e.getConfig().getOwners().contains(e.getAuthor().getIdLong())) {
|
if (volume < 201 && volume > 0 || e.getConfig().getOwners().contains(e.getAuthor().getIdLong())) {
|
||||||
e.getAudioManager().getPlayer(e.getGuild()).setVolume(volume);
|
e.getAudioManager().getPlayer(e.getGuild()).setVolume(volume);
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2019-2020 GregTCLTK and Schlauer-Hax
|
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||||
*
|
*
|
||||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
* 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 not use this file except in compliance with the License.
|
||||||
|
|
@ -14,12 +14,12 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.bbn.hadder.commands.nsfw;
|
package one.bbn.hadder.commands.nsfw;
|
||||||
|
|
||||||
import com.bbn.hadder.commands.Command;
|
import one.bbn.hadder.commands.Command;
|
||||||
import com.bbn.hadder.commands.CommandEvent;
|
import one.bbn.hadder.commands.CommandEvent;
|
||||||
import com.bbn.hadder.utils.MessageEditor;
|
import one.bbn.hadder.utils.Http;
|
||||||
import com.bbn.hadder.utils.Http;
|
import one.bbn.hadder.utils.MessageEditor;
|
||||||
|
|
||||||
public class AnalCommand implements Command {
|
public class AnalCommand implements Command {
|
||||||
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2019-2020 GregTCLTK and Schlauer-Hax
|
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||||
*
|
*
|
||||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
* 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 not use this file except in compliance with the License.
|
||||||
|
|
@ -14,12 +14,12 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.bbn.hadder.commands.nsfw;
|
package one.bbn.hadder.commands.nsfw;
|
||||||
|
|
||||||
import com.bbn.hadder.commands.Command;
|
import one.bbn.hadder.commands.Command;
|
||||||
import com.bbn.hadder.commands.CommandEvent;
|
import one.bbn.hadder.commands.CommandEvent;
|
||||||
import com.bbn.hadder.utils.MessageEditor;
|
import one.bbn.hadder.utils.Http;
|
||||||
import com.bbn.hadder.utils.Http;
|
import one.bbn.hadder.utils.MessageEditor;
|
||||||
|
|
||||||
public class BDSMCommand implements Command {
|
public class BDSMCommand implements Command {
|
||||||
|
|
||||||
|
|
@ -42,7 +42,7 @@ public class BDSMCommand implements Command {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String[] labels() {
|
public String[] labels() {
|
||||||
return new String[] { "bdsm" };
|
return new String[]{"bdsm"};
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2019-2020 GregTCLTK and Schlauer-Hax
|
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||||
*
|
*
|
||||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
* 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 not use this file except in compliance with the License.
|
||||||
|
|
@ -14,12 +14,12 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.bbn.hadder.commands.nsfw;
|
package one.bbn.hadder.commands.nsfw;
|
||||||
|
|
||||||
import com.bbn.hadder.commands.Command;
|
import one.bbn.hadder.commands.Command;
|
||||||
import com.bbn.hadder.commands.CommandEvent;
|
import one.bbn.hadder.commands.CommandEvent;
|
||||||
import com.bbn.hadder.utils.MessageEditor;
|
import one.bbn.hadder.utils.Http;
|
||||||
import com.bbn.hadder.utils.Http;
|
import one.bbn.hadder.utils.MessageEditor;
|
||||||
|
|
||||||
public class BlowjobCommand implements Command {
|
public class BlowjobCommand implements Command {
|
||||||
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2019-2020 GregTCLTK and Schlauer-Hax
|
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||||
*
|
*
|
||||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
* 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 not use this file except in compliance with the License.
|
||||||
|
|
@ -14,12 +14,12 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.bbn.hadder.commands.nsfw;
|
package one.bbn.hadder.commands.nsfw;
|
||||||
|
|
||||||
import com.bbn.hadder.commands.Command;
|
import one.bbn.hadder.commands.Command;
|
||||||
import com.bbn.hadder.commands.CommandEvent;
|
import one.bbn.hadder.commands.CommandEvent;
|
||||||
import com.bbn.hadder.utils.MessageEditor;
|
import one.bbn.hadder.utils.Http;
|
||||||
import com.bbn.hadder.utils.Http;
|
import one.bbn.hadder.utils.MessageEditor;
|
||||||
|
|
||||||
public class BoobsCommand implements Command {
|
public class BoobsCommand implements Command {
|
||||||
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2019-2020 GregTCLTK and Schlauer-Hax
|
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||||
*
|
*
|
||||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
* 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 not use this file except in compliance with the License.
|
||||||
|
|
@ -14,12 +14,12 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.bbn.hadder.commands.nsfw;
|
package one.bbn.hadder.commands.nsfw;
|
||||||
|
|
||||||
import com.bbn.hadder.commands.Command;
|
import one.bbn.hadder.commands.Command;
|
||||||
import com.bbn.hadder.commands.CommandEvent;
|
import one.bbn.hadder.commands.CommandEvent;
|
||||||
import com.bbn.hadder.utils.MessageEditor;
|
import one.bbn.hadder.utils.Http;
|
||||||
import com.bbn.hadder.utils.Http;
|
import one.bbn.hadder.utils.MessageEditor;
|
||||||
|
|
||||||
public class CumCommand implements Command {
|
public class CumCommand implements Command {
|
||||||
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2019-2020 GregTCLTK and Schlauer-Hax
|
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||||
*
|
*
|
||||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
* 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 not use this file except in compliance with the License.
|
||||||
|
|
@ -14,12 +14,12 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.bbn.hadder.commands.nsfw;
|
package one.bbn.hadder.commands.nsfw;
|
||||||
|
|
||||||
import com.bbn.hadder.commands.Command;
|
import one.bbn.hadder.commands.Command;
|
||||||
import com.bbn.hadder.commands.CommandEvent;
|
import one.bbn.hadder.commands.CommandEvent;
|
||||||
import com.bbn.hadder.utils.MessageEditor;
|
import one.bbn.hadder.utils.Http;
|
||||||
import com.bbn.hadder.utils.Http;
|
import one.bbn.hadder.utils.MessageEditor;
|
||||||
|
|
||||||
public class EroticCommand implements Command {
|
public class EroticCommand implements Command {
|
||||||
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2019-2020 GregTCLTK and Schlauer-Hax
|
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||||
*
|
*
|
||||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
* 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 not use this file except in compliance with the License.
|
||||||
|
|
@ -14,12 +14,12 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.bbn.hadder.commands.nsfw;
|
package one.bbn.hadder.commands.nsfw;
|
||||||
|
|
||||||
import com.bbn.hadder.commands.Command;
|
import one.bbn.hadder.commands.Command;
|
||||||
import com.bbn.hadder.commands.CommandEvent;
|
import one.bbn.hadder.commands.CommandEvent;
|
||||||
import com.bbn.hadder.utils.MessageEditor;
|
import one.bbn.hadder.utils.Http;
|
||||||
import com.bbn.hadder.utils.Http;
|
import one.bbn.hadder.utils.MessageEditor;
|
||||||
|
|
||||||
public class FeetCommand implements Command {
|
public class FeetCommand implements Command {
|
||||||
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2019-2020 GregTCLTK and Schlauer-Hax
|
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||||
*
|
*
|
||||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
* 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 not use this file except in compliance with the License.
|
||||||
|
|
@ -14,12 +14,12 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.bbn.hadder.commands.nsfw;
|
package one.bbn.hadder.commands.nsfw;
|
||||||
|
|
||||||
import com.bbn.hadder.commands.Command;
|
import one.bbn.hadder.commands.Command;
|
||||||
import com.bbn.hadder.commands.CommandEvent;
|
import one.bbn.hadder.commands.CommandEvent;
|
||||||
import com.bbn.hadder.utils.MessageEditor;
|
import one.bbn.hadder.utils.Http;
|
||||||
import com.bbn.hadder.utils.Http;
|
import one.bbn.hadder.utils.MessageEditor;
|
||||||
|
|
||||||
public class FingeringCommand implements Command {
|
public class FingeringCommand implements Command {
|
||||||
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2019-2020 GregTCLTK and Schlauer-Hax
|
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||||
*
|
*
|
||||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
* 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 not use this file except in compliance with the License.
|
||||||
|
|
@ -14,12 +14,12 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.bbn.hadder.commands.nsfw;
|
package one.bbn.hadder.commands.nsfw;
|
||||||
|
|
||||||
import com.bbn.hadder.commands.Command;
|
import one.bbn.hadder.commands.Command;
|
||||||
import com.bbn.hadder.commands.CommandEvent;
|
import one.bbn.hadder.commands.CommandEvent;
|
||||||
import com.bbn.hadder.utils.MessageEditor;
|
import one.bbn.hadder.utils.Http;
|
||||||
import com.bbn.hadder.utils.Http;
|
import one.bbn.hadder.utils.MessageEditor;
|
||||||
|
|
||||||
public class LickingCommand implements Command {
|
public class LickingCommand implements Command {
|
||||||
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2019-2020 GregTCLTK and Schlauer-Hax
|
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||||
*
|
*
|
||||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
* 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 not use this file except in compliance with the License.
|
||||||
|
|
@ -14,12 +14,12 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.bbn.hadder.commands.nsfw;
|
package one.bbn.hadder.commands.nsfw;
|
||||||
|
|
||||||
import com.bbn.hadder.commands.Command;
|
import one.bbn.hadder.commands.Command;
|
||||||
import com.bbn.hadder.commands.CommandEvent;
|
import one.bbn.hadder.commands.CommandEvent;
|
||||||
import com.bbn.hadder.utils.MessageEditor;
|
import one.bbn.hadder.utils.Http;
|
||||||
import com.bbn.hadder.utils.Http;
|
import one.bbn.hadder.utils.MessageEditor;
|
||||||
|
|
||||||
public class PornCommand implements Command {
|
public class PornCommand implements Command {
|
||||||
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2019-2020 GregTCLTK and Schlauer-Hax
|
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||||
*
|
*
|
||||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
* 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 not use this file except in compliance with the License.
|
||||||
|
|
@ -14,12 +14,12 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.bbn.hadder.commands.nsfw;
|
package one.bbn.hadder.commands.nsfw;
|
||||||
|
|
||||||
import com.bbn.hadder.commands.Command;
|
import one.bbn.hadder.commands.Command;
|
||||||
import com.bbn.hadder.commands.CommandEvent;
|
import one.bbn.hadder.commands.CommandEvent;
|
||||||
import com.bbn.hadder.utils.MessageEditor;
|
import one.bbn.hadder.utils.Http;
|
||||||
import com.bbn.hadder.utils.Http;
|
import one.bbn.hadder.utils.MessageEditor;
|
||||||
|
|
||||||
public class PussyCommand implements Command {
|
public class PussyCommand implements Command {
|
||||||
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2019-2020 GregTCLTK and Schlauer-Hax
|
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||||
*
|
*
|
||||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
* 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 not use this file except in compliance with the License.
|
||||||
|
|
@ -14,12 +14,12 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.bbn.hadder.commands.nsfw;
|
package one.bbn.hadder.commands.nsfw;
|
||||||
|
|
||||||
import com.bbn.hadder.commands.Command;
|
import one.bbn.hadder.commands.Command;
|
||||||
import com.bbn.hadder.commands.CommandEvent;
|
import one.bbn.hadder.commands.CommandEvent;
|
||||||
import com.bbn.hadder.utils.MessageEditor;
|
import one.bbn.hadder.utils.Http;
|
||||||
import com.bbn.hadder.utils.Http;
|
import one.bbn.hadder.utils.MessageEditor;
|
||||||
|
|
||||||
public class RandomPornCommand implements Command {
|
public class RandomPornCommand implements Command {
|
||||||
|
|
||||||
|
|
@ -44,7 +44,7 @@ public class RandomPornCommand implements Command {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String[] labels() {
|
public String[] labels() {
|
||||||
return new String[] { "randomporn", "pornrandom" };
|
return new String[]{"randomporn", "pornrandom"};
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2019-2020 GregTCLTK and Schlauer-Hax
|
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||||
*
|
*
|
||||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
* 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 not use this file except in compliance with the License.
|
||||||
|
|
@ -14,12 +14,12 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.bbn.hadder.commands.nsfw;
|
package one.bbn.hadder.commands.nsfw;
|
||||||
|
|
||||||
import com.bbn.hadder.commands.Command;
|
import one.bbn.hadder.commands.Command;
|
||||||
import com.bbn.hadder.commands.CommandEvent;
|
import one.bbn.hadder.commands.CommandEvent;
|
||||||
import com.bbn.hadder.utils.MessageEditor;
|
import one.bbn.hadder.utils.Http;
|
||||||
import com.bbn.hadder.utils.Http;
|
import one.bbn.hadder.utils.MessageEditor;
|
||||||
|
|
||||||
public class SoloCommand implements Command {
|
public class SoloCommand implements Command {
|
||||||
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2019-2020 GregTCLTK and Schlauer-Hax
|
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||||
*
|
*
|
||||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
* 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 not use this file except in compliance with the License.
|
||||||
|
|
@ -14,12 +14,12 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.bbn.hadder.commands.nsfw;
|
package one.bbn.hadder.commands.nsfw;
|
||||||
|
|
||||||
import com.bbn.hadder.commands.Command;
|
import one.bbn.hadder.commands.Command;
|
||||||
import com.bbn.hadder.commands.CommandEvent;
|
import one.bbn.hadder.commands.CommandEvent;
|
||||||
import com.bbn.hadder.utils.MessageEditor;
|
import one.bbn.hadder.utils.Http;
|
||||||
import com.bbn.hadder.utils.Http;
|
import one.bbn.hadder.utils.MessageEditor;
|
||||||
|
|
||||||
public class SpankCommand implements Command {
|
public class SpankCommand implements Command {
|
||||||
|
|
||||||
|
|
@ -42,7 +42,7 @@ public class SpankCommand implements Command {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String[] labels() {
|
public String[] labels() {
|
||||||
return new String[] { "spank", "beat", "hit" };
|
return new String[]{"spank", "beat", "hit"};
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2019-2020 GregTCLTK and Schlauer-Hax
|
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||||
*
|
*
|
||||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
* 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 not use this file except in compliance with the License.
|
||||||
|
|
@ -14,12 +14,12 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.bbn.hadder.commands.nsfw;
|
package one.bbn.hadder.commands.nsfw;
|
||||||
|
|
||||||
import com.bbn.hadder.commands.Command;
|
import one.bbn.hadder.commands.Command;
|
||||||
import com.bbn.hadder.commands.CommandEvent;
|
import one.bbn.hadder.commands.CommandEvent;
|
||||||
import com.bbn.hadder.utils.MessageEditor;
|
import one.bbn.hadder.utils.Http;
|
||||||
import com.bbn.hadder.utils.Http;
|
import one.bbn.hadder.utils.MessageEditor;
|
||||||
|
|
||||||
public class TransCommand implements Command {
|
public class TransCommand implements Command {
|
||||||
|
|
||||||
|
|
@ -43,7 +43,7 @@ public class TransCommand implements Command {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String[] labels() {
|
public String[] labels() {
|
||||||
return new String[] { "trans" };
|
return new String[]{"trans"};
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2019-2020 GregTCLTK and Schlauer-Hax
|
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||||
*
|
*
|
||||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
* 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 not use this file except in compliance with the License.
|
||||||
|
|
@ -14,14 +14,14 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.bbn.hadder.commands.owner;
|
package one.bbn.hadder.commands.owner;
|
||||||
|
|
||||||
import com.bbn.hadder.db.RethinkUser;
|
import one.bbn.hadder.commands.Command;
|
||||||
import com.bbn.hadder.commands.Command;
|
import one.bbn.hadder.commands.CommandEvent;
|
||||||
import com.bbn.hadder.commands.CommandEvent;
|
import one.bbn.hadder.core.Perm;
|
||||||
import com.bbn.hadder.core.Perm;
|
import one.bbn.hadder.core.Perms;
|
||||||
import com.bbn.hadder.core.Perms;
|
import one.bbn.hadder.db.MongoUser;
|
||||||
import com.bbn.hadder.utils.MessageEditor;
|
import one.bbn.hadder.utils.MessageEditor;
|
||||||
import net.dv8tion.jda.api.entities.User;
|
import net.dv8tion.jda.api.entities.User;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
@ -41,21 +41,21 @@ public class BlacklistCommand implements Command {
|
||||||
case "add":
|
case "add":
|
||||||
case "remove":
|
case "remove":
|
||||||
if (args.length == 3 && e.getMessage().getMentionedUsers().size() == 1) {
|
if (args.length == 3 && e.getMessage().getMentionedUsers().size() == 1) {
|
||||||
RethinkUser u = new RethinkUser(e.getRethink().getObjectByID("user", e.getMessage().getMentionedUsers().get(0).getId()), e.getRethink());
|
MongoUser u = new MongoUser(e.getMongo().getObjectByID("user", e.getMessage().getMentionedUsers().get(0).getId()), e.getMongo());
|
||||||
String blacklisted = e.getRethinkUser().getBlacklisted();
|
String blacklisted = e.getMongoUser().getBlacklisted();
|
||||||
List<String> commands = new ArrayList<>();
|
List<String> commands = new ArrayList<>();
|
||||||
if (!"none".equals(blacklisted)) commands.addAll(Arrays.asList(blacklisted.split(",")));
|
if (!"none".equals(blacklisted)) commands.addAll(Arrays.asList(blacklisted.split(",")));
|
||||||
if (args[0].toLowerCase().equals("add")) commands.addAll(Arrays.asList(args[1].split(",")));
|
if (args[0].equalsIgnoreCase("add")) commands.addAll(Arrays.asList(args[1].split(",")));
|
||||||
else commands.removeAll(Arrays.asList(args[1].split(",")));
|
else commands.removeAll(Arrays.asList(args[1].split(",")));
|
||||||
LinkedHashSet<String> hashSet = new LinkedHashSet<>(commands);
|
LinkedHashSet<String> hashSet = new LinkedHashSet<>(commands);
|
||||||
|
|
||||||
ArrayList<String> commandsWithoutDuplicates = new ArrayList<>(hashSet);
|
ArrayList<String> commandsWithoutDuplicates = new ArrayList<>(hashSet);
|
||||||
String newblacklisted = ((commandsWithoutDuplicates.size()!=0) ? String.join(",", commandsWithoutDuplicates) : "none");
|
String newblacklisted = ((commandsWithoutDuplicates.size() != 0) ? String.join(",", commandsWithoutDuplicates) : "none");
|
||||||
u.setBlacklisted(newblacklisted);
|
u.setBlacklisted(newblacklisted);
|
||||||
e.getTextChannel().sendMessage(
|
e.getTextChannel().sendMessage(
|
||||||
e.getMessageEditor().getMessage(MessageEditor.MessageType.INFO,
|
e.getMessageEditor().getMessage(MessageEditor.MessageType.INFO,
|
||||||
"commands.owner.blacklist.success."+args[0].toLowerCase()+".title", "",
|
"commands.owner.blacklist.success." + args[0].toLowerCase() + ".title", "",
|
||||||
"commands.owner.blacklist.success."+args[0].toLowerCase()+".description", newblacklisted)
|
"commands.owner.blacklist.success." + args[0].toLowerCase() + ".description", newblacklisted)
|
||||||
.build()).queue();
|
.build()).queue();
|
||||||
u.push();
|
u.push();
|
||||||
} else e.getHelpCommand().sendHelp(this, e);
|
} else e.getHelpCommand().sendHelp(this, e);
|
||||||
|
|
@ -65,7 +65,7 @@ public class BlacklistCommand implements Command {
|
||||||
StringBuilder stringBuilder = new StringBuilder();
|
StringBuilder stringBuilder = new StringBuilder();
|
||||||
for (User user : e.getJDA().getUsers()) {
|
for (User user : e.getJDA().getUsers()) {
|
||||||
if (!user.getId().equals(e.getJDA().getSelfUser().getId())) {
|
if (!user.getId().equals(e.getJDA().getSelfUser().getId())) {
|
||||||
RethinkUser u = new RethinkUser(e.getRethink().getObjectByID("user", user.getId()), e.getRethink());
|
MongoUser u = new MongoUser(e.getMongo().getObjectByID("user", user.getId()), e.getMongo());
|
||||||
String blacklisted = u.getBlacklisted();
|
String blacklisted = u.getBlacklisted();
|
||||||
if (!"none".equals(blacklisted)) {
|
if (!"none".equals(blacklisted)) {
|
||||||
stringBuilder.append(user.getAsTag()).append(" (").append(user.getId()).append(") - ").append(blacklisted).append("\n");
|
stringBuilder.append(user.getAsTag()).append(" (").append(user.getId()).append(") - ").append(blacklisted).append("\n");
|
||||||
|
|
@ -75,7 +75,7 @@ public class BlacklistCommand implements Command {
|
||||||
e.getTextChannel().sendMessage(
|
e.getTextChannel().sendMessage(
|
||||||
e.getMessageEditor().getMessage(MessageEditor.MessageType.INFO)
|
e.getMessageEditor().getMessage(MessageEditor.MessageType.INFO)
|
||||||
.setTitle("Blacklisted Users")
|
.setTitle("Blacklisted Users")
|
||||||
.setDescription((stringBuilder.length()!=0) ? ("``" + stringBuilder.toString() + "``") : "No blacklisted Users")
|
.setDescription((stringBuilder.length() != 0) ? ("``" + stringBuilder.toString() + "``") : "No blacklisted Users")
|
||||||
.build()).queue();
|
.build()).queue();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2019-2020 GregTCLTK and Schlauer-Hax
|
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||||
*
|
*
|
||||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
* 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 not use this file except in compliance with the License.
|
||||||
|
|
@ -14,14 +14,14 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.bbn.hadder.commands.owner;
|
package one.bbn.hadder.commands.owner;
|
||||||
|
|
||||||
import com.bbn.hadder.Hadder;
|
import one.bbn.hadder.Hadder;
|
||||||
import com.bbn.hadder.commands.Command;
|
import one.bbn.hadder.commands.Command;
|
||||||
import com.bbn.hadder.commands.CommandEvent;
|
import one.bbn.hadder.commands.CommandEvent;
|
||||||
import com.bbn.hadder.core.Perm;
|
import one.bbn.hadder.core.Perm;
|
||||||
import com.bbn.hadder.core.Perms;
|
import one.bbn.hadder.core.Perms;
|
||||||
import com.bbn.hadder.utils.MessageEditor;
|
import one.bbn.hadder.utils.MessageEditor;
|
||||||
|
|
||||||
import javax.script.ScriptEngine;
|
import javax.script.ScriptEngine;
|
||||||
import javax.script.ScriptEngineManager;
|
import javax.script.ScriptEngineManager;
|
||||||
|
|
@ -45,7 +45,7 @@ public class EvalCommand implements Command {
|
||||||
}
|
}
|
||||||
engine.put("msg".toLowerCase(), e.getMessage());
|
engine.put("msg".toLowerCase(), e.getMessage());
|
||||||
engine.put("shardmanager".toLowerCase(), Hadder.shardManager);
|
engine.put("shardmanager".toLowerCase(), Hadder.shardManager);
|
||||||
engine.put("rethink".toLowerCase(), e.getRethink());
|
engine.put("rethink".toLowerCase(), e.getMongo());
|
||||||
engine.put("e".toLowerCase(), e);
|
engine.put("e".toLowerCase(), e);
|
||||||
engine.put("jda".toLowerCase(), e.getJDA());
|
engine.put("jda".toLowerCase(), e.getJDA());
|
||||||
engine.put("message".toLowerCase(), e.getMessage());
|
engine.put("message".toLowerCase(), e.getMessage());
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2019-2020 GregTCLTK and Schlauer-Hax
|
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||||
*
|
*
|
||||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
* 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 not use this file except in compliance with the License.
|
||||||
|
|
@ -14,13 +14,13 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.bbn.hadder.commands.owner;
|
package one.bbn.hadder.commands.owner;
|
||||||
|
|
||||||
import com.bbn.hadder.commands.Command;
|
import one.bbn.hadder.commands.Command;
|
||||||
import com.bbn.hadder.commands.CommandEvent;
|
import one.bbn.hadder.commands.CommandEvent;
|
||||||
import com.bbn.hadder.core.Perm;
|
import one.bbn.hadder.core.Perm;
|
||||||
import com.bbn.hadder.core.Perms;
|
import one.bbn.hadder.core.Perms;
|
||||||
import com.bbn.hadder.utils.MessageEditor;
|
import one.bbn.hadder.utils.MessageEditor;
|
||||||
import net.dv8tion.jda.api.entities.Guild;
|
import net.dv8tion.jda.api.entities.Guild;
|
||||||
|
|
||||||
@Perms(Perm.BOT_OWNER)
|
@Perms(Perm.BOT_OWNER)
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2019-2020 GregTCLTK and Schlauer-Hax
|
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||||
*
|
*
|
||||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
* 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 not use this file except in compliance with the License.
|
||||||
|
|
@ -14,12 +14,12 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.bbn.hadder.commands.owner;
|
package one.bbn.hadder.commands.owner;
|
||||||
|
|
||||||
import com.bbn.hadder.commands.Command;
|
import one.bbn.hadder.commands.Command;
|
||||||
import com.bbn.hadder.commands.CommandEvent;
|
import one.bbn.hadder.commands.CommandEvent;
|
||||||
import com.bbn.hadder.core.Perm;
|
import one.bbn.hadder.core.Perm;
|
||||||
import com.bbn.hadder.core.Perms;
|
import one.bbn.hadder.core.Perms;
|
||||||
|
|
||||||
@Perms(Perm.BOT_OWNER)
|
@Perms(Perm.BOT_OWNER)
|
||||||
public class RebootCommand implements Command {
|
public class RebootCommand implements Command {
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2019-2020 GregTCLTK and Schlauer-Hax
|
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||||
*
|
*
|
||||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
* 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 not use this file except in compliance with the License.
|
||||||
|
|
@ -14,13 +14,13 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.bbn.hadder.commands.owner;
|
package one.bbn.hadder.commands.owner;
|
||||||
|
|
||||||
import com.bbn.hadder.commands.Command;
|
import one.bbn.hadder.commands.Command;
|
||||||
import com.bbn.hadder.commands.CommandEvent;
|
import one.bbn.hadder.commands.CommandEvent;
|
||||||
import com.bbn.hadder.core.Perm;
|
import one.bbn.hadder.core.Perm;
|
||||||
import com.bbn.hadder.core.Perms;
|
import one.bbn.hadder.core.Perms;
|
||||||
import com.bbn.hadder.utils.MessageEditor;
|
import one.bbn.hadder.utils.MessageEditor;
|
||||||
|
|
||||||
@Perms(Perm.BOT_OWNER)
|
@Perms(Perm.BOT_OWNER)
|
||||||
public class ShutdownCommand implements Command {
|
public class ShutdownCommand implements Command {
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2019-2020 GregTCLTK and Schlauer-Hax
|
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||||
*
|
*
|
||||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
* 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 not use this file except in compliance with the License.
|
||||||
|
|
@ -14,11 +14,11 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.bbn.hadder.commands.owner;
|
package one.bbn.hadder.commands.owner;
|
||||||
|
|
||||||
import com.bbn.hadder.commands.Command;
|
import one.bbn.hadder.commands.Command;
|
||||||
import com.bbn.hadder.commands.CommandEvent;
|
import one.bbn.hadder.commands.CommandEvent;
|
||||||
import com.bbn.hadder.utils.MessageEditor.MessageType;
|
import one.bbn.hadder.utils.MessageEditor.MessageType;
|
||||||
|
|
||||||
public class TestCommand implements Command {
|
public class TestCommand implements Command {
|
||||||
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2019-2020 GregTCLTK and Schlauer-Hax
|
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||||
*
|
*
|
||||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
* 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 not use this file except in compliance with the License.
|
||||||
|
|
@ -14,11 +14,11 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.bbn.hadder.commands.settings;
|
package one.bbn.hadder.commands.settings;
|
||||||
|
|
||||||
import com.bbn.hadder.commands.Command;
|
import one.bbn.hadder.commands.Command;
|
||||||
import com.bbn.hadder.commands.CommandEvent;
|
import one.bbn.hadder.commands.CommandEvent;
|
||||||
import com.bbn.hadder.utils.MessageEditor;
|
import one.bbn.hadder.utils.MessageEditor;
|
||||||
|
|
||||||
public class LanguageCommand implements Command {
|
public class LanguageCommand implements Command {
|
||||||
|
|
||||||
|
|
@ -49,28 +49,28 @@ public class LanguageCommand implements Command {
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.INFO,
|
e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.INFO,
|
||||||
"List",
|
"commands.settings.language.error.title", "",
|
||||||
"`de`, `en`, `es`, `fr`, `ru`, `tr`, `zh`")
|
"commands.settings.language.error.description", "`de`, `en`, `es`, `fr`, `ru`, `tr`, `zh`")
|
||||||
.build()).queue();
|
.build()).queue();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else e.getHelpCommand().sendHelp(this, e);
|
} else e.getHelpCommand().sendHelp(this, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setLanguage(String language_code, String language, CommandEvent e) {
|
public void setLanguage(String language_code, String language, CommandEvent e) {
|
||||||
e.getRethinkUser().setLanguage(language_code);
|
e.getMongoUser().setLanguage(language_code);
|
||||||
e.getTextChannel()
|
e.getTextChannel()
|
||||||
.sendMessage(
|
.sendMessage(
|
||||||
e.getMessageEditor()
|
e.getMessageEditor()
|
||||||
.getMessage(MessageEditor.MessageType.INFO, "commands.settings.language.success.title",
|
.getMessage(MessageEditor.MessageType.INFO, "commands.settings.language.success.title",
|
||||||
"", "commands.settings.language.success.description", language)
|
"", "commands.settings.language.success.description", language)
|
||||||
.build()).queue();
|
.build()).queue();
|
||||||
e.getRethinkUser().push();
|
e.getMongoUser().push();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String[] labels() {
|
public String[] labels() {
|
||||||
return new String[] { "language" };
|
return new String[]{"language"};
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2019-2020 GregTCLTK and Schlauer-Hax
|
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||||
*
|
*
|
||||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
* 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 not use this file except in compliance with the License.
|
||||||
|
|
@ -14,30 +14,30 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.bbn.hadder.commands.settings;
|
package one.bbn.hadder.commands.settings;
|
||||||
|
|
||||||
import com.bbn.hadder.commands.Command;
|
import one.bbn.hadder.commands.Command;
|
||||||
import com.bbn.hadder.commands.CommandEvent;
|
import one.bbn.hadder.commands.CommandEvent;
|
||||||
import com.bbn.hadder.utils.MessageEditor;
|
import one.bbn.hadder.utils.MessageEditor;
|
||||||
|
|
||||||
public class UserPrefixCommand implements Command {
|
public class UserPrefixCommand implements Command {
|
||||||
|
|
||||||
public void executed(String[] args, CommandEvent e) {
|
public void executed(String[] args, CommandEvent e) {
|
||||||
if (args.length == 1) {
|
if (args.length == 1) {
|
||||||
e.getRethinkUser().setPrefix(args[0]);
|
e.getMongoUser().setPrefix(args[0]);
|
||||||
e.getTextChannel()
|
e.getTextChannel()
|
||||||
.sendMessage(e.getMessageEditor()
|
.sendMessage(e.getMessageEditor()
|
||||||
.getMessage(MessageEditor.MessageType.INFO, "commands.settings.prefix.success.title", "",
|
.getMessage(MessageEditor.MessageType.INFO, "commands.settings.prefix.success.title", "",
|
||||||
"commands.settings.prefix.success.description", args[0])
|
"commands.settings.prefix.success.description", args[0])
|
||||||
.build())
|
.build())
|
||||||
.queue();
|
.queue();
|
||||||
e.getRethinkUser().push();
|
e.getMongoUser().push();
|
||||||
} else e.getHelpCommand().sendHelp(this, e);
|
} else e.getHelpCommand().sendHelp(this, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String[] labels() {
|
public String[] labels() {
|
||||||
return new String[] { "userprefix" };
|
return new String[]{"userprefix"};
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2019-2020 GregTCLTK and Schlauer-Hax
|
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||||
*
|
*
|
||||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
* 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 not use this file except in compliance with the License.
|
||||||
|
|
@ -14,17 +14,17 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.bbn.hadder.core;
|
package one.bbn.hadder.core;
|
||||||
|
|
||||||
import com.bbn.hadder.db.Rethink;
|
import one.bbn.hadder.audio.AudioManager;
|
||||||
import com.bbn.hadder.db.RethinkServer;
|
import one.bbn.hadder.commands.Command;
|
||||||
import com.bbn.hadder.db.RethinkUser;
|
import one.bbn.hadder.commands.CommandEvent;
|
||||||
import com.bbn.hadder.audio.AudioManager;
|
import one.bbn.hadder.commands.general.HelpCommand;
|
||||||
import com.bbn.hadder.commands.Command;
|
import one.bbn.hadder.db.Mongo;
|
||||||
import com.bbn.hadder.commands.CommandEvent;
|
import one.bbn.hadder.db.MongoServer;
|
||||||
import com.bbn.hadder.commands.general.HelpCommand;
|
import one.bbn.hadder.db.MongoUser;
|
||||||
import com.bbn.hadder.utils.EventWaiter;
|
import one.bbn.hadder.utils.EventWaiter;
|
||||||
import com.bbn.hadder.utils.MessageEditor;
|
import one.bbn.hadder.utils.MessageEditor;
|
||||||
import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
|
import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
|
@ -42,7 +42,7 @@ public class CommandHandler {
|
||||||
this.helpCommand = helpCommand;
|
this.helpCommand = helpCommand;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void handle(MessageReceivedEvent event, Rethink rethink, String prefix, AudioManager audioManager, RethinkUser rethinkUser, RethinkServer rethinkServer) {
|
public void handle(MessageReceivedEvent event, Mongo mongo, String prefix, AudioManager audioManager, MongoUser mongoUser, MongoServer mongoServer) {
|
||||||
String invoke = event.getMessage().getContentRaw().replaceFirst(prefix, "").split(" ")[0];
|
String invoke = event.getMessage().getContentRaw().replaceFirst(prefix, "").split(" ")[0];
|
||||||
for (Command cmd : commandList) {
|
for (Command cmd : commandList) {
|
||||||
for (String label : cmd.labels()) {
|
for (String label : cmd.labels()) {
|
||||||
|
|
@ -53,8 +53,8 @@ public class CommandHandler {
|
||||||
String[] args = argString.split(" ");
|
String[] args = argString.split(" ");
|
||||||
if (args.length > 0 && args[0].equals("")) args = new String[0];
|
if (args.length > 0 && args[0].equals("")) args = new String[0];
|
||||||
|
|
||||||
CommandEvent commandEvent = new CommandEvent(event.getJDA(), event.getResponseNumber(), event.getMessage(), rethink,
|
CommandEvent commandEvent = new CommandEvent(event.getJDA(), event.getResponseNumber(), event.getMessage(), mongo,
|
||||||
config, this, helpCommand, new MessageEditor(rethinkUser, event.getAuthor()), new EventWaiter(), audioManager, rethinkUser, rethinkServer);
|
config, this, helpCommand, new MessageEditor(mongoUser, event.getAuthor()), new EventWaiter(), audioManager, mongoUser, mongoServer);
|
||||||
if (cmd.getClass().getAnnotations().length > 0 && !Arrays.asList(cmd.getClass().getAnnotations()).contains(Perms.class)) {
|
if (cmd.getClass().getAnnotations().length > 0 && !Arrays.asList(cmd.getClass().getAnnotations()).contains(Perms.class)) {
|
||||||
for (Perm perm : cmd.getClass().getAnnotation(Perms.class).value()) {
|
for (Perm perm : cmd.getClass().getAnnotation(Perms.class).value()) {
|
||||||
if (!perm.check(commandEvent)) {
|
if (!perm.check(commandEvent)) {
|
||||||
|
|
@ -68,7 +68,7 @@ public class CommandHandler {
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean run = true;
|
boolean run = true;
|
||||||
String blacklisted = rethinkUser.getBlacklisted();
|
String blacklisted = mongoUser.getBlacklisted();
|
||||||
if (!"none".equals(blacklisted)) {
|
if (!"none".equals(blacklisted)) {
|
||||||
for (String BLLabel : blacklisted.split(",")) {
|
for (String BLLabel : blacklisted.split(",")) {
|
||||||
if (Arrays.asList(cmd.labels()).contains(BLLabel)) {
|
if (Arrays.asList(cmd.labels()).contains(BLLabel)) {
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2019-2020 GregTCLTK and Schlauer-Hax
|
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||||
*
|
*
|
||||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
* 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 not use this file except in compliance with the License.
|
||||||
|
|
@ -14,7 +14,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.bbn.hadder.core;
|
package one.bbn.hadder.core;
|
||||||
|
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
import org.json.JSONStringer;
|
import org.json.JSONStringer;
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2019-2020 GregTCLTK and Schlauer-Hax
|
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||||
*
|
*
|
||||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
* 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 not use this file except in compliance with the License.
|
||||||
|
|
@ -14,9 +14,9 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.bbn.hadder.core;
|
package one.bbn.hadder.core;
|
||||||
|
|
||||||
import com.bbn.hadder.commands.CommandEvent;
|
import one.bbn.hadder.commands.CommandEvent;
|
||||||
import net.dv8tion.jda.api.Permission;
|
import net.dv8tion.jda.api.Permission;
|
||||||
|
|
||||||
public enum Perm {
|
public enum Perm {
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2019-2020 GregTCLTK and Schlauer-Hax
|
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||||
*
|
*
|
||||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
* 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 not use this file except in compliance with the License.
|
||||||
|
|
@ -14,7 +14,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.bbn.hadder.core;
|
package one.bbn.hadder.core;
|
||||||
|
|
||||||
import java.lang.annotation.Retention;
|
import java.lang.annotation.Retention;
|
||||||
import java.lang.annotation.RetentionPolicy;
|
import java.lang.annotation.RetentionPolicy;
|
||||||
154
src/main/java/one/bbn/hadder/db/Mongo.java
Normal file
154
src/main/java/one/bbn/hadder/db/Mongo.java
Normal file
|
|
@ -0,0 +1,154 @@
|
||||||
|
/*
|
||||||
|
* 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.db;
|
||||||
|
|
||||||
|
import com.mongodb.BasicDBObject;
|
||||||
|
import com.mongodb.client.*;
|
||||||
|
import one.bbn.hadder.core.Config;
|
||||||
|
import org.bson.Document;
|
||||||
|
import org.json.JSONObject;
|
||||||
|
|
||||||
|
import java.lang.reflect.Field;
|
||||||
|
import java.util.NoSuchElementException;
|
||||||
|
|
||||||
|
public class Mongo {
|
||||||
|
|
||||||
|
MongoDatabase db;
|
||||||
|
Config config;
|
||||||
|
|
||||||
|
public Mongo(Config config) {
|
||||||
|
this.config = config;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void connect() {
|
||||||
|
db = MongoClients.create("mongodb://" + config.getDatabaseUsername() + ":" + config.getDatabasePassword() + "@" + config.getDatabaseIP() + ":" + config.getDatabasePort() + "/?authSource=admin").getDatabase("Hadder");
|
||||||
|
}
|
||||||
|
|
||||||
|
public Object getByID(String collection_name, String where, String what, String column) {
|
||||||
|
MongoCollection<Document> collection = db.getCollection(collection_name);
|
||||||
|
BasicDBObject whereQuery = new BasicDBObject();
|
||||||
|
whereQuery.put(where, what);
|
||||||
|
FindIterable<Document> it = collection.find(whereQuery);
|
||||||
|
try {
|
||||||
|
return it.cursor().next().get(column);
|
||||||
|
} catch (NoSuchElementException ignore) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public JSONObject getObjectByID(String collection, String id) {
|
||||||
|
BasicDBObject whereQuery = new BasicDBObject();
|
||||||
|
whereQuery.put("id", id);
|
||||||
|
try {
|
||||||
|
String response = db.getCollection(collection).find(whereQuery).cursor().next().toJson();
|
||||||
|
return new JSONObject(response);
|
||||||
|
} catch (NoSuchElementException e) {
|
||||||
|
if (collection.equals("user"))
|
||||||
|
insertUser(id);
|
||||||
|
else if (collection.equals("server"))
|
||||||
|
insertGuild(id);
|
||||||
|
String response2 = db.getCollection(collection).find(whereQuery).cursor().next().toJson();
|
||||||
|
return new JSONObject(response2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void remove(String table, String where, String value) {
|
||||||
|
BasicDBObject whereQuery = new BasicDBObject();
|
||||||
|
whereQuery.put(where, value);
|
||||||
|
db.getCollection(table).deleteOne(whereQuery);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void insert(String table, Document doc) {
|
||||||
|
db.getCollection(table).insertOne(doc);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void insertUser(String id) {
|
||||||
|
this.insert("user", new Document("id", id)
|
||||||
|
.append("prefix", "h.")
|
||||||
|
.append("language", "en")
|
||||||
|
.append("blacklisted", "none"));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void insertGuild(String id) {
|
||||||
|
this.insert("server", new Document("id", id)
|
||||||
|
.append("prefix", "h.")
|
||||||
|
.append("message_id", "")
|
||||||
|
.append("role_id", "")
|
||||||
|
.append("invite_detect", false)
|
||||||
|
.append("starboard", "")
|
||||||
|
.append("neededstars", "4")
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void push(MongoServer server) {
|
||||||
|
Document object = new Document();
|
||||||
|
for (Field field : server.getClass().getDeclaredFields()) {
|
||||||
|
if (!field.getName().equals("mongo")) {
|
||||||
|
try {
|
||||||
|
object.append(field.getName(), field.get(server));
|
||||||
|
} catch (IllegalAccessException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
BasicDBObject whereQuery = new BasicDBObject();
|
||||||
|
whereQuery.put("id", server.getId());
|
||||||
|
|
||||||
|
BasicDBObject updateObject = new BasicDBObject();
|
||||||
|
updateObject.put("$set", object);
|
||||||
|
|
||||||
|
db.getCollection("server").updateOne(whereQuery, updateObject);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void push(MongoUser user) {
|
||||||
|
Document object = new Document();
|
||||||
|
for (Field field : user.getClass().getDeclaredFields()) {
|
||||||
|
if (!field.getName().equals("mongo")) {
|
||||||
|
try {
|
||||||
|
object.append(field.getName(), field.get(user));
|
||||||
|
} catch (IllegalAccessException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
BasicDBObject whereQuery = new BasicDBObject();
|
||||||
|
whereQuery.put("id", user.getId());
|
||||||
|
|
||||||
|
BasicDBObject updateObject = new BasicDBObject();
|
||||||
|
updateObject.put("$set", object);
|
||||||
|
|
||||||
|
db.getCollection("user").updateOne(whereQuery, updateObject);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean hasStarboardMessage(String message_id) {
|
||||||
|
return this.getByID("stars", "id", message_id, "guild") != null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void insertStarboardMessage(String message_id, String guild_id, String starboard_message_id) {
|
||||||
|
this.insert("stars", new Document("id", message_id).append("guild", guild_id).append("starboardmsg", starboard_message_id));
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStarboardMessage(String message_id) {
|
||||||
|
return (String) this.getByID("stars", "id", message_id, "starboardmsg");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void removeStarboardMessage(String message_id) {
|
||||||
|
this.remove("stars", "id", message_id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -14,15 +14,15 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.bbn.hadder.db;
|
package one.bbn.hadder.db;
|
||||||
|
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
|
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
|
|
||||||
public class RethinkServer {
|
public class MongoServer {
|
||||||
|
|
||||||
private Rethink rethink;
|
private Mongo mongo;
|
||||||
|
|
||||||
public String accept_emote = "";
|
public String accept_emote = "";
|
||||||
public String decline_emote = "";
|
public String decline_emote = "";
|
||||||
|
|
@ -34,9 +34,9 @@ public class RethinkServer {
|
||||||
public String role_id = "";
|
public String role_id = "";
|
||||||
public String starboard = "";
|
public String starboard = "";
|
||||||
|
|
||||||
public RethinkServer(JSONObject object, Rethink rethink) {
|
public MongoServer(JSONObject object, Mongo mongo) {
|
||||||
for (Field field : this.getClass().getDeclaredFields()) {
|
for (Field field : this.getClass().getDeclaredFields()) {
|
||||||
if (!field.getName().equals("rethink")) {
|
if (!field.getName().equals("mongo")) {
|
||||||
try {
|
try {
|
||||||
if (object.has(field.getName()))
|
if (object.has(field.getName()))
|
||||||
field.set(this, object.get(field.getName()));
|
field.set(this, object.get(field.getName()));
|
||||||
|
|
@ -45,7 +45,7 @@ public class RethinkServer {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.rethink = rethink;
|
this.mongo = mongo;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getAcceptEmote() {
|
public String getAcceptEmote() {
|
||||||
|
|
@ -128,6 +128,6 @@ public class RethinkServer {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void push() {
|
public void push() {
|
||||||
rethink.push(this);
|
mongo.push(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -14,24 +14,24 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.bbn.hadder.db;
|
package one.bbn.hadder.db;
|
||||||
|
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
|
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
|
|
||||||
public class RethinkUser {
|
public class MongoUser {
|
||||||
|
|
||||||
private Rethink rethink;
|
private Mongo mongo;
|
||||||
|
|
||||||
public String id;
|
public String id;
|
||||||
public String prefix = "h.";
|
public String prefix = "h.";
|
||||||
public String language = "en";
|
public String language = "en";
|
||||||
public String blacklisted = "none";
|
public String blacklisted = "none";
|
||||||
|
|
||||||
public RethinkUser(JSONObject object, Rethink rethink) {
|
public MongoUser(JSONObject object, Mongo mongo) {
|
||||||
for (Field field : this.getClass().getDeclaredFields()) {
|
for (Field field : this.getClass().getDeclaredFields()) {
|
||||||
if (!field.getName().equals("rethink")) {
|
if (!field.getName().equals("mongo")) {
|
||||||
try {
|
try {
|
||||||
if (object.has(field.getName()))
|
if (object.has(field.getName()))
|
||||||
field.set(this, object.getString(field.getName()));
|
field.set(this, object.getString(field.getName()));
|
||||||
|
|
@ -40,11 +40,11 @@ public class RethinkUser {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.rethink = rethink;
|
this.mongo = mongo;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Rethink getRethink() {
|
public Mongo getMongo() {
|
||||||
return rethink;
|
return mongo;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getId() {
|
public String getId() {
|
||||||
|
|
@ -76,6 +76,6 @@ public class RethinkUser {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void push() {
|
public void push() {
|
||||||
rethink.push(this);
|
mongo.push(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2019-2020 GregTCLTK and Schlauer-Hax
|
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||||
*
|
*
|
||||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
* 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 not use this file except in compliance with the License.
|
||||||
|
|
@ -14,13 +14,13 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.bbn.hadder.listener;
|
package one.bbn.hadder.listener;
|
||||||
|
|
||||||
import com.bbn.hadder.db.Rethink;
|
import one.bbn.hadder.audio.AudioManager;
|
||||||
import com.bbn.hadder.db.RethinkServer;
|
import one.bbn.hadder.core.CommandHandler;
|
||||||
import com.bbn.hadder.db.RethinkUser;
|
import one.bbn.hadder.db.Mongo;
|
||||||
import com.bbn.hadder.audio.AudioManager;
|
import one.bbn.hadder.db.MongoServer;
|
||||||
import com.bbn.hadder.core.CommandHandler;
|
import one.bbn.hadder.db.MongoUser;
|
||||||
import net.dv8tion.jda.api.EmbedBuilder;
|
import net.dv8tion.jda.api.EmbedBuilder;
|
||||||
import net.dv8tion.jda.api.Permission;
|
import net.dv8tion.jda.api.Permission;
|
||||||
import net.dv8tion.jda.api.entities.ChannelType;
|
import net.dv8tion.jda.api.entities.ChannelType;
|
||||||
|
|
@ -33,12 +33,12 @@ import java.time.Instant;
|
||||||
|
|
||||||
public class CommandListener extends ListenerAdapter {
|
public class CommandListener extends ListenerAdapter {
|
||||||
|
|
||||||
private Rethink rethink;
|
private final Mongo mongo;
|
||||||
private CommandHandler handler;
|
private final CommandHandler handler;
|
||||||
private AudioManager audioManager;
|
private final AudioManager audioManager;
|
||||||
|
|
||||||
public CommandListener(Rethink rethink, CommandHandler handler, AudioManager audioManager) {
|
public CommandListener(Mongo mongo, CommandHandler handler, AudioManager audioManager) {
|
||||||
this.rethink = rethink;
|
this.mongo = mongo;
|
||||||
this.handler = handler;
|
this.handler = handler;
|
||||||
this.audioManager = audioManager;
|
this.audioManager = audioManager;
|
||||||
}
|
}
|
||||||
|
|
@ -48,19 +48,19 @@ public class CommandListener extends ListenerAdapter {
|
||||||
if (e.isFromType(ChannelType.TEXT) && !e.getAuthor().isBot()) {
|
if (e.isFromType(ChannelType.TEXT) && !e.getAuthor().isBot()) {
|
||||||
if (e.getGuild().getSelfMember().hasPermission(Permission.MESSAGE_WRITE)) {
|
if (e.getGuild().getSelfMember().hasPermission(Permission.MESSAGE_WRITE)) {
|
||||||
if (e.getGuild().getSelfMember().hasPermission(Permission.MESSAGE_EMBED_LINKS)) {
|
if (e.getGuild().getSelfMember().hasPermission(Permission.MESSAGE_EMBED_LINKS)) {
|
||||||
RethinkUser rethinkUser = new RethinkUser(rethink.getObjectByID("user", e.getAuthor().getId()), rethink);
|
MongoUser mongoUser = new MongoUser(mongo.getObjectByID("user", e.getAuthor().getId()), mongo);
|
||||||
RethinkServer rethinkServer = new RethinkServer(rethink.getObjectByID("server", e.getGuild().getId()), rethink);
|
MongoServer mongoServer = new MongoServer(mongo.getObjectByID("server", e.getGuild().getId()), mongo);
|
||||||
rethinkUser.push();
|
mongoUser.push();
|
||||||
rethinkServer.push();
|
mongoServer.push();
|
||||||
String[] prefixes = {
|
String[] prefixes = {
|
||||||
rethinkUser.getPrefix(), rethinkServer.getPrefix(),
|
mongoUser.getPrefix(), mongoServer.getPrefix(),
|
||||||
e.getGuild().getSelfMember().getAsMention() + " ", e.getGuild().getSelfMember().getAsMention(),
|
e.getGuild().getSelfMember().getAsMention() + " ", e.getGuild().getSelfMember().getAsMention(),
|
||||||
e.getGuild().getSelfMember().getAsMention().replace("@", "@!") + " ",
|
e.getGuild().getSelfMember().getAsMention().replace("@", "@!") + " ",
|
||||||
e.getGuild().getSelfMember().getAsMention().replace("@", "@!")
|
e.getGuild().getSelfMember().getAsMention().replace("@", "@!")
|
||||||
};
|
};
|
||||||
for (String prefix : prefixes) {
|
for (String prefix : prefixes) {
|
||||||
if (e.getMessage().getContentRaw().startsWith(prefix)) {
|
if (e.getMessage().getContentRaw().startsWith(prefix)) {
|
||||||
handler.handle(e, rethink, prefix, audioManager, rethinkUser, rethinkServer);
|
handler.handle(e, mongo, prefix, audioManager, mongoUser, mongoServer);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -70,7 +70,7 @@ public class CommandListener extends ListenerAdapter {
|
||||||
.setTitle("No permission")
|
.setTitle("No permission")
|
||||||
.setDescription("I need the `MESSAGE EMBED LINKS` permission in order to work!")
|
.setDescription("I need the `MESSAGE EMBED LINKS` permission in order to work!")
|
||||||
.setColor(Color.RED)
|
.setColor(Color.RED)
|
||||||
.setFooter("Hadder", "https://bigbotnetwork.com/images/Hadder.png")
|
.setFooter("Hadder", "https://bbn.one/images/Hadder.png")
|
||||||
.setTimestamp(Instant.now())
|
.setTimestamp(Instant.now())
|
||||||
.build()).queue();
|
.build()).queue();
|
||||||
} catch (ErrorResponseException ex) {
|
} catch (ErrorResponseException ex) {
|
||||||
|
|
@ -78,13 +78,16 @@ public class CommandListener extends ListenerAdapter {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
e.getAuthor().openPrivateChannel().complete().sendMessage(new EmbedBuilder()
|
try {
|
||||||
.setTitle("No permission")
|
e.getAuthor().openPrivateChannel().complete().sendMessage(new EmbedBuilder()
|
||||||
.setDescription("I need the `MESSAGE WRITE` permission in order to work!")
|
.setTitle("No permission")
|
||||||
.setColor(Color.RED)
|
.setDescription("I need the `MESSAGE WRITE` permission in order to work!")
|
||||||
.setFooter("Hadder", "https://bigbotnetwork.com/images/Hadder.png")
|
.setColor(Color.RED)
|
||||||
.setTimestamp(Instant.now())
|
.setFooter("Hadder", "https://bbn.one/images/Hadder.png")
|
||||||
.build()).queue();
|
.setTimestamp(Instant.now())
|
||||||
|
.build()).queue();
|
||||||
|
} catch (ErrorResponseException ignore) {}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2019-2020 GregTCLTK and Schlauer-Hax
|
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||||
*
|
*
|
||||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
* 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 not use this file except in compliance with the License.
|
||||||
|
|
@ -14,13 +14,12 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.bbn.hadder.listener;
|
package one.bbn.hadder.listener;
|
||||||
|
|
||||||
import com.bbn.hadder.db.Rethink;
|
import one.bbn.hadder.core.Config;
|
||||||
import com.bbn.hadder.core.Config;
|
import one.bbn.hadder.db.Mongo;
|
||||||
import com.bbn.hadder.utils.BotList;
|
import one.bbn.hadder.utils.BotList;
|
||||||
import com.bbn.hadder.utils.MessageEditor;
|
import one.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.GuildJoinEvent;
|
||||||
import net.dv8tion.jda.api.events.guild.GuildLeaveEvent;
|
import net.dv8tion.jda.api.events.guild.GuildLeaveEvent;
|
||||||
import net.dv8tion.jda.api.events.guild.member.GuildMemberJoinEvent;
|
import net.dv8tion.jda.api.events.guild.member.GuildMemberJoinEvent;
|
||||||
|
|
@ -30,25 +29,17 @@ import java.time.Instant;
|
||||||
|
|
||||||
public class GuildListener extends ListenerAdapter {
|
public class GuildListener extends ListenerAdapter {
|
||||||
|
|
||||||
private Rethink rethink;
|
private final Mongo mongo;
|
||||||
private Config config;
|
private final Config config;
|
||||||
|
|
||||||
public GuildListener(Rethink rethink, Config config) {
|
public GuildListener(Mongo mongo, Config config) {
|
||||||
this.rethink = rethink;
|
this.mongo = mongo;
|
||||||
this.config = config;
|
this.config = config;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onGuildJoin(GuildJoinEvent e) {
|
public void onGuildJoin(GuildJoinEvent e) {
|
||||||
new Thread(() -> {
|
mongo.insertGuild(e.getGuild().getId());
|
||||||
for (Member member : e.getGuild().getMembers()) {
|
e.getJDA().getTextChannelById("759783393230979142").sendMessage(new MessageEditor(null, null).getMessage(MessageEditor.MessageType.INFO)
|
||||||
if (!member.getUser().getId().equals(e.getJDA().getSelfUser().getId())) {
|
|
||||||
rethink.insertUser(member.getUser().getId());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}).start();
|
|
||||||
|
|
||||||
rethink.insertGuild(e.getGuild().getId());
|
|
||||||
e.getJDA().getTextChannelById("475722540140986369").sendMessage(new MessageEditor(null, null).getMessage(MessageEditor.MessageType.INFO)
|
|
||||||
.setTitle("Joined Server")
|
.setTitle("Joined Server")
|
||||||
.setThumbnail(e.getGuild().getIconUrl())
|
.setThumbnail(e.getGuild().getIconUrl())
|
||||||
.addField("Name", e.getGuild().getName(), true)
|
.addField("Name", e.getGuild().getName(), true)
|
||||||
|
|
@ -63,7 +54,7 @@ public class GuildListener extends ListenerAdapter {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onGuildLeave(GuildLeaveEvent e) {
|
public void onGuildLeave(GuildLeaveEvent e) {
|
||||||
e.getJDA().getTextChannelById("475722540140986369").sendMessage(new MessageEditor(null, null).getMessage(MessageEditor.MessageType.INFO)
|
e.getJDA().getTextChannelById("759783393230979142").sendMessage(new MessageEditor(null, null).getMessage(MessageEditor.MessageType.INFO)
|
||||||
.setTitle("Left Server")
|
.setTitle("Left Server")
|
||||||
.setThumbnail(e.getGuild().getIconUrl())
|
.setThumbnail(e.getGuild().getIconUrl())
|
||||||
.addField("Name", e.getGuild().getName(), true)
|
.addField("Name", e.getGuild().getName(), true)
|
||||||
|
|
@ -79,7 +70,7 @@ public class GuildListener extends ListenerAdapter {
|
||||||
|
|
||||||
public void onGuildMemberJoin(GuildMemberJoinEvent e) {
|
public void onGuildMemberJoin(GuildMemberJoinEvent e) {
|
||||||
if (!e.getUser().getId().equals(e.getJDA().getSelfUser().getId())) {
|
if (!e.getUser().getId().equals(e.getJDA().getSelfUser().getId())) {
|
||||||
rethink.insertUser(e.getUser().getId());
|
mongo.insertUser(e.getUser().getId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2019-2020 GregTCLTK and Schlauer-Hax
|
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||||
*
|
*
|
||||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
* 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 not use this file except in compliance with the License.
|
||||||
|
|
@ -14,12 +14,14 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.bbn.hadder.listener;
|
package one.bbn.hadder.listener;
|
||||||
|
|
||||||
import com.bbn.hadder.db.Rethink;
|
import one.bbn.hadder.db.Mongo;
|
||||||
import com.bbn.hadder.db.RethinkServer;
|
import one.bbn.hadder.db.MongoServer;
|
||||||
import net.dv8tion.jda.api.Permission;
|
import net.dv8tion.jda.api.Permission;
|
||||||
import net.dv8tion.jda.api.entities.ChannelType;
|
import net.dv8tion.jda.api.entities.ChannelType;
|
||||||
|
import net.dv8tion.jda.api.entities.Guild;
|
||||||
|
import net.dv8tion.jda.api.entities.Member;
|
||||||
import net.dv8tion.jda.api.entities.Message;
|
import net.dv8tion.jda.api.entities.Message;
|
||||||
import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
|
import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
|
||||||
import net.dv8tion.jda.api.events.message.MessageUpdateEvent;
|
import net.dv8tion.jda.api.events.message.MessageUpdateEvent;
|
||||||
|
|
@ -33,29 +35,22 @@ import javax.annotation.Nonnull;
|
||||||
|
|
||||||
public class InviteLinkListener extends ListenerAdapter {
|
public class InviteLinkListener extends ListenerAdapter {
|
||||||
|
|
||||||
private Rethink rethink;
|
private Mongo mongo;
|
||||||
|
|
||||||
public InviteLinkListener(Rethink rethink) {
|
public InviteLinkListener(Mongo mongo) {
|
||||||
this.rethink = rethink;
|
this.mongo = mongo;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onMessageReceived(@Nonnull MessageReceivedEvent e) {
|
public void onMessageReceived(@Nonnull MessageReceivedEvent e) {
|
||||||
if (e.isFromType(ChannelType.TEXT)) {
|
if (e.isFromType(ChannelType.TEXT)) scanMessage(e.getGuild(), e.getMessage(), e.getMember());
|
||||||
RethinkServer rethinkServer = new RethinkServer(rethink.getObjectByID("server", e.getGuild().getId()), rethink);
|
|
||||||
if (e.getMessage().getContentRaw().contains("discord.gg/") && (!e.getMember().hasPermission(Permission.ADMINISTRATOR) && rethinkServer.hasInviteDetect())) {
|
|
||||||
checkInvite(e.getMessage(), "discord.gg/");
|
|
||||||
} else if (e.getMessage().getContentRaw().contains("discordapp.com/invite") && !e.getMember().hasPermission(Permission.ADMINISTRATOR) && rethinkServer.hasInviteDetect()) {
|
|
||||||
checkInvite(e.getMessage(), "discordapp.com/invite/");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void checkInvite(Message message, String regex) {
|
public void checkInvite(Message message, String regex) {
|
||||||
String split = message.getContentRaw().split(regex, 10)[1];
|
String split = message.getContentRaw().split(regex, 10)[1];
|
||||||
String invite = split.split(" ")[0];
|
String invite = split.split(" ")[0];
|
||||||
OkHttpClient client = new OkHttpClient();
|
OkHttpClient client = new OkHttpClient();
|
||||||
Request request = new Request.Builder().url("https://canary.discordapp.com/api/v6/invites/" + invite).build();
|
Request request = new Request.Builder().url("https://canary.discord.com/api/v8/invites/" + invite).build();
|
||||||
try {
|
try {
|
||||||
Response response = client.newCall(request).execute();
|
Response response = client.newCall(request).execute();
|
||||||
JSONObject json = new JSONObject(response.body().string());
|
JSONObject json = new JSONObject(response.body().string());
|
||||||
|
|
@ -69,13 +64,17 @@ public class InviteLinkListener extends ListenerAdapter {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onMessageUpdate(@Nonnull MessageUpdateEvent e) {
|
public void onMessageUpdate(@Nonnull MessageUpdateEvent e) {
|
||||||
if (e.isFromType(ChannelType.TEXT)) {
|
if (e.isFromType(ChannelType.TEXT)) scanMessage(e.getGuild(), e.getMessage(), e.getMember());
|
||||||
RethinkServer rethinkServer = new RethinkServer(rethink.getObjectByID("server", e.getGuild().getId()), rethink);
|
}
|
||||||
if (e.getMessage().getContentRaw().contains("discord.gg/") && !e.getMember().hasPermission(Permission.ADMINISTRATOR) && rethinkServer.hasInviteDetect()) {
|
|
||||||
checkInvite(e.getMessage(), "discord.gg/");
|
public void scanMessage(Guild guild, Message message, Member member) {
|
||||||
} else if (e.getMessage().getContentRaw().contains("discordapp.com/invite") && !e.getMember().hasPermission(Permission.ADMINISTRATOR) && rethinkServer.hasInviteDetect()) {
|
MongoServer mongoServer = new MongoServer(mongo.getObjectByID("server", guild.getId()), mongo);
|
||||||
checkInvite(e.getMessage(), "discordapp.com/invite/");
|
if (message.getContentRaw().contains("discord.gg/") && !member.hasPermission(Permission.ADMINISTRATOR) && mongoServer.hasInviteDetect()) {
|
||||||
}
|
checkInvite(message, "discord.gg/");
|
||||||
|
} else if (message.getContentRaw().contains("discord.com/invite") && !member.hasPermission(Permission.ADMINISTRATOR) && mongoServer.hasInviteDetect()) {
|
||||||
|
checkInvite(message, "discord.com/invite/");
|
||||||
|
} else if (message.getContentRaw().contains("discordapp.com/invite") && !member.hasPermission(Permission.ADMINISTRATOR) && mongoServer.hasInviteDetect()) {
|
||||||
|
checkInvite(message, "discordapp.com/invite/");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
78
src/main/java/one/bbn/hadder/listener/MentionListener.java
Normal file
78
src/main/java/one/bbn/hadder/listener/MentionListener.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.listener;
|
||||||
|
|
||||||
|
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 net.dv8tion.jda.api.EmbedBuilder;
|
||||||
|
import net.dv8tion.jda.api.entities.ChannelType;
|
||||||
|
import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
|
||||||
|
import net.dv8tion.jda.api.hooks.ListenerAdapter;
|
||||||
|
import org.kohsuke.github.GHRepository;
|
||||||
|
import org.kohsuke.github.GitHub;
|
||||||
|
|
||||||
|
import javax.annotation.Nonnull;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
|
public class MentionListener extends ListenerAdapter {
|
||||||
|
|
||||||
|
private final Mongo mongo;
|
||||||
|
private final Config config;
|
||||||
|
|
||||||
|
public MentionListener(Mongo mongo, Config config) {
|
||||||
|
this.mongo = mongo;
|
||||||
|
this.config = config;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onMessageReceived(@Nonnull MessageReceivedEvent e) {
|
||||||
|
if (!e.getAuthor().isBot() && e.isFromType(ChannelType.TEXT)) {
|
||||||
|
MongoServer mongoServer = new MongoServer(mongo.getObjectByID("server", e.getGuild().getId()), mongo);
|
||||||
|
MongoUser mongoUser = new MongoUser(mongo.getObjectByID("user", e.getAuthor().getId()), mongo);
|
||||||
|
if (e.isFromType(ChannelType.TEXT) && (e.getMessage().getContentRaw().equals(e.getGuild().getSelfMember().getAsMention()) ||
|
||||||
|
e.getMessage().getContentRaw().equals(e.getGuild().getSelfMember().getAsMention().replace("@", "@!")))) {
|
||||||
|
|
||||||
|
String version = null;
|
||||||
|
|
||||||
|
try {
|
||||||
|
GitHub connection = GitHub.connectUsingOAuth(config.getGitHubToken());
|
||||||
|
GHRepository Hadder = connection.getOrganization("BBN-Holding").getRepository("Hadder");
|
||||||
|
version = Hadder.getLatestRelease().getTagName();
|
||||||
|
} catch (IOException ioException) {
|
||||||
|
ioException.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
EmbedBuilder builder = new EmbedBuilder()
|
||||||
|
.setTitle("Hi!")
|
||||||
|
.addField("Version", version, false)
|
||||||
|
.addField("User-Prefix", mongoUser.getPrefix(), true)
|
||||||
|
.addField("Guild-Prefix", mongoServer.getPrefix(), true)
|
||||||
|
.addField("Join our Dev Server!", "[Click here!](https://discord.gg/nPwjaJk)", true)
|
||||||
|
.addField("Github", "[Click here!](https://github.com/BBN-Holding/Hadder)", false);
|
||||||
|
e.getChannel().sendMessage(builder.build()).queue();
|
||||||
|
} else if (e.getMessage().getContentRaw().equalsIgnoreCase("@someone")) {
|
||||||
|
int member = new Random().nextInt(e.getGuild().getMembers().size() - 1);
|
||||||
|
if (member > 0 && member < e.getGuild().getMembers().size()) {
|
||||||
|
e.getChannel().sendMessage(e.getGuild().getMembers().get(member).getAsMention() + " (Executed by: " + e.getAuthor().getAsTag() + ")").queue();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,15 +1,25 @@
|
||||||
/*
|
/*
|
||||||
* @author Hax / Hax6775 / Schlauer_Hax
|
* 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 com.bbn.hadder.listener;
|
package one.bbn.hadder.listener;
|
||||||
|
|
||||||
import com.bbn.hadder.core.Config;
|
import one.bbn.hadder.core.Config;
|
||||||
import com.bbn.hadder.core.Perms;
|
|
||||||
import net.dv8tion.jda.api.entities.Emote;
|
import net.dv8tion.jda.api.entities.Emote;
|
||||||
import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
|
import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
|
||||||
import net.dv8tion.jda.api.hooks.ListenerAdapter;
|
import net.dv8tion.jda.api.hooks.ListenerAdapter;
|
||||||
import org.json.JSONObject;
|
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
|
|
||||||
|
|
@ -24,11 +34,11 @@ public class OwnerMessageListener extends ListenerAdapter {
|
||||||
@Override
|
@Override
|
||||||
public void onMessageReceived(@Nonnull MessageReceivedEvent event) {
|
public void onMessageReceived(@Nonnull MessageReceivedEvent event) {
|
||||||
if (config.getOwners().contains(event.getAuthor().getIdLong()) && event.getMessage().getContentRaw().startsWith(":") && event.getMessage().getContentRaw().endsWith(":")) {
|
if (config.getOwners().contains(event.getAuthor().getIdLong()) && event.getMessage().getContentRaw().startsWith(":") && event.getMessage().getContentRaw().endsWith(":")) {
|
||||||
String emotename = event.getMessage().getContentRaw().split(":")[1];
|
String emoteName = event.getMessage().getContentRaw().split(":")[1];
|
||||||
if (!emotename.contains(" ")) {
|
if (!emoteName.contains(" ")) {
|
||||||
Emote[] emotes = event.getJDA().getEmotesByName(emotename, true).toArray(new Emote[0]);
|
Emote[] emotes = event.getJDA().getEmotesByName(emoteName, true).toArray(new Emote[0]);
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
if (emotes.length!=0) {
|
if (emotes.length != 0) {
|
||||||
for (Emote emote : emotes) {
|
for (Emote emote : emotes) {
|
||||||
sb.append(emote.getAsMention()).append(" ");
|
sb.append(emote.getAsMention()).append(" ");
|
||||||
}
|
}
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2019-2020 GregTCLTK and Schlauer-Hax
|
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||||
*
|
*
|
||||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
* 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 not use this file except in compliance with the License.
|
||||||
|
|
@ -14,11 +14,11 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.bbn.hadder.listener;
|
package one.bbn.hadder.listener;
|
||||||
|
|
||||||
import com.bbn.hadder.db.Rethink;
|
import one.bbn.hadder.db.Mongo;
|
||||||
import com.bbn.hadder.db.RethinkUser;
|
import one.bbn.hadder.db.MongoUser;
|
||||||
import com.bbn.hadder.utils.MessageEditor;
|
import one.bbn.hadder.utils.MessageEditor;
|
||||||
import net.dv8tion.jda.api.EmbedBuilder;
|
import net.dv8tion.jda.api.EmbedBuilder;
|
||||||
import net.dv8tion.jda.api.entities.ChannelType;
|
import net.dv8tion.jda.api.entities.ChannelType;
|
||||||
import net.dv8tion.jda.api.entities.PrivateChannel;
|
import net.dv8tion.jda.api.entities.PrivateChannel;
|
||||||
|
|
@ -30,25 +30,26 @@ import java.time.Instant;
|
||||||
|
|
||||||
public class PrivateMessageListener extends ListenerAdapter {
|
public class PrivateMessageListener extends ListenerAdapter {
|
||||||
|
|
||||||
private Rethink rethink;
|
private final Mongo mongo;
|
||||||
|
|
||||||
public PrivateMessageListener(Rethink rethink) {
|
public PrivateMessageListener(Mongo mongo) {
|
||||||
this.rethink = rethink;
|
this.mongo = mongo;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onMessageReceived(MessageReceivedEvent e) {
|
public void onMessageReceived(MessageReceivedEvent e) {
|
||||||
if (e.isFromType(ChannelType.PRIVATE) && !e.getAuthor().getId().equals(e.getJDA().getSelfUser().getId())) {
|
if (e.isFromType(ChannelType.PRIVATE) && !e.getAuthor().getId().equals(e.getJDA().getSelfUser().getId())) {
|
||||||
PrivateChannel Skidder = e.getJDA().getUserById("477141528981012511").openPrivateChannel().complete();
|
PrivateChannel Skidder = e.getJDA().getUserById("401817301919465482").openPrivateChannel().complete();
|
||||||
PrivateChannel Hax = e.getJDA().getUserById("261083609148948488").openPrivateChannel().complete();
|
PrivateChannel Hax = e.getJDA().getUserById("261083609148948488").openPrivateChannel().complete();
|
||||||
RethinkUser rethinkUser = new RethinkUser(rethink.getObjectByID("user", "261083609148948488"), rethink);
|
MongoUser HaxUser = new MongoUser(mongo.getObjectByID("user", "261083609148948488"), mongo);
|
||||||
|
MongoUser SkidderUser = new MongoUser(mongo.getObjectByID("user", "261083609148948488"), mongo);
|
||||||
|
|
||||||
Skidder.sendMessage(new MessageEditor(rethinkUser, e.getJDA().getUserById("261083609148948488")).getMessage(MessageEditor.MessageType.INFO)
|
Skidder.sendMessage(new MessageEditor(SkidderUser, e.getJDA().getUserById("401817301919465482")).getMessage(MessageEditor.MessageType.INFO)
|
||||||
.setTitle("New DM by " + e.getAuthor().getAsTag())
|
.setTitle("New DM by " + e.getAuthor().getAsTag())
|
||||||
.setAuthor(e.getAuthor().getName(), e.getAuthor().getAvatarUrl(), e.getAuthor().getAvatarUrl())
|
.setAuthor(e.getAuthor().getName(), e.getAuthor().getAvatarUrl(), e.getAuthor().getAvatarUrl())
|
||||||
.setDescription(e.getMessage().getContentRaw())
|
.setDescription(e.getMessage().getContentRaw())
|
||||||
.setTimestamp(Instant.now())
|
.setTimestamp(Instant.now())
|
||||||
.build()).queue();
|
.build()).queue();
|
||||||
Hax.sendMessage(new MessageEditor(rethinkUser, e.getJDA().getUserById("261083609148948488")).getMessage(MessageEditor.MessageType.INFO)
|
Hax.sendMessage(new MessageEditor(HaxUser, e.getJDA().getUserById("261083609148948488")).getMessage(MessageEditor.MessageType.INFO)
|
||||||
.setTitle("New DM by " + e.getAuthor().getAsTag())
|
.setTitle("New DM by " + e.getAuthor().getAsTag())
|
||||||
.setAuthor(e.getAuthor().getName(), e.getAuthor().getAvatarUrl(), e.getAuthor().getAvatarUrl())
|
.setAuthor(e.getAuthor().getName(), e.getAuthor().getAvatarUrl(), e.getAuthor().getAvatarUrl())
|
||||||
.setDescription(e.getMessage().getContentRaw())
|
.setDescription(e.getMessage().getContentRaw())
|
||||||
|
|
@ -57,9 +58,9 @@ public class PrivateMessageListener extends ListenerAdapter {
|
||||||
|
|
||||||
e.getChannel().sendMessage(new EmbedBuilder()
|
e.getChannel().sendMessage(new EmbedBuilder()
|
||||||
.setTitle("No DM support")
|
.setTitle("No DM support")
|
||||||
.setDescription("You have to execute your commands on a guild!")
|
.setDescription("You have to execute your commands on a guild! For further support join our Discord server [here](https://discord.gg/nPwjaJk)")
|
||||||
.setColor(Color.RED)
|
.setColor(Color.RED)
|
||||||
.setFooter("Hadder", "https://bigbotnetwork.com/images/Hadder.png")
|
.setFooter("Hadder", "https://bbn.one/images/Hadder.png")
|
||||||
.setTimestamp(Instant.now())
|
.setTimestamp(Instant.now())
|
||||||
.build()).queue();
|
.build()).queue();
|
||||||
}
|
}
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2019-2020 GregTCLTK and Schlauer-Hax
|
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||||
*
|
*
|
||||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
* 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 not use this file except in compliance with the License.
|
||||||
|
|
@ -14,42 +14,25 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.bbn.hadder.listener;
|
package one.bbn.hadder.listener;
|
||||||
|
|
||||||
import com.bbn.hadder.db.Rethink;
|
import one.bbn.hadder.core.Config;
|
||||||
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.events.ReadyEvent;
|
||||||
import net.dv8tion.jda.api.hooks.ListenerAdapter;
|
import net.dv8tion.jda.api.hooks.ListenerAdapter;
|
||||||
|
import one.bbn.hadder.utils.BotList;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
|
|
||||||
public class ReadyListener extends ListenerAdapter {
|
public class ReadyListener extends ListenerAdapter {
|
||||||
|
|
||||||
private Rethink rethink;
|
private final Config config;
|
||||||
private Config config;
|
|
||||||
|
|
||||||
public ReadyListener(Rethink rethink, Config config) {
|
public ReadyListener(Config config) {
|
||||||
this.rethink = rethink;
|
|
||||||
this.config = config;
|
this.config = config;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onReady(@Nonnull ReadyEvent e) {
|
public void onReady(@Nonnull ReadyEvent e) {
|
||||||
rethink.setup();
|
|
||||||
new Thread(() -> {
|
|
||||||
for (User user : e.getJDA().getUsers()) {
|
|
||||||
if (!user.getId().equals(e.getJDA().getSelfUser().getId())) {
|
|
||||||
rethink.insertUser(user.getId());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for (Guild g : e.getJDA().getGuilds()) {
|
|
||||||
rethink.insertGuild(g.getId());
|
|
||||||
}
|
|
||||||
}).start();
|
|
||||||
|
|
||||||
new BotList(config).post();
|
new BotList(config).post();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2019-2020 GregTCLTK and Schlauer-Hax
|
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||||
*
|
*
|
||||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
* 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 not use this file except in compliance with the License.
|
||||||
|
|
@ -14,39 +14,39 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.bbn.hadder.listener;
|
package one.bbn.hadder.listener;
|
||||||
|
|
||||||
import com.bbn.hadder.db.Rethink;
|
import one.bbn.hadder.db.Mongo;
|
||||||
import com.bbn.hadder.db.RethinkServer;
|
import one.bbn.hadder.db.MongoServer;
|
||||||
import net.dv8tion.jda.api.events.message.react.MessageReactionAddEvent;
|
import net.dv8tion.jda.api.events.message.react.MessageReactionAddEvent;
|
||||||
import net.dv8tion.jda.api.events.message.react.MessageReactionRemoveEvent;
|
import net.dv8tion.jda.api.events.message.react.MessageReactionRemoveEvent;
|
||||||
import net.dv8tion.jda.api.hooks.ListenerAdapter;
|
import net.dv8tion.jda.api.hooks.ListenerAdapter;
|
||||||
|
|
||||||
public class RulesListener extends ListenerAdapter {
|
public class RulesListener extends ListenerAdapter {
|
||||||
|
|
||||||
private Rethink rethink;
|
private final Mongo mongo;
|
||||||
|
|
||||||
public RulesListener(Rethink rethink) {
|
public RulesListener(Mongo mongo) {
|
||||||
this.rethink = rethink;
|
this.mongo = mongo;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onMessageReactionAdd(MessageReactionAddEvent e) {
|
public void onMessageReactionAdd(MessageReactionAddEvent e) {
|
||||||
RethinkServer rethinkServer = new RethinkServer(rethink.getObjectByID("server", e.getGuild().getId()), rethink);
|
MongoServer mongoServer = new MongoServer(mongo.getObjectByID("server", e.getGuild().getId()), mongo);
|
||||||
if (e.getMessageId().equals(rethinkServer.getMessageID()) && !e.getUser().isBot()) {
|
if (e.getMessageId().equals(mongoServer.getMessageID()) && !e.getUser().isBot()) {
|
||||||
if (e.getReactionEmote().isEmote()) {
|
if (e.getReactionEmote().isEmote()) {
|
||||||
if (rethinkServer.getAcceptEmote().equals(e.getReactionEmote().getId())) {
|
if (mongoServer.getAcceptEmote().equals(e.getReactionEmote().getId())) {
|
||||||
addRole(e);
|
addRole(e);
|
||||||
} else if (rethinkServer.getDeclineEmote().equals(e.getReactionEmote().getId())) {
|
} else if (mongoServer.getDeclineEmote().equals(e.getReactionEmote().getId())) {
|
||||||
e.getReaction().removeReaction(e.getUser()).queue();
|
e.getReaction().removeReaction(e.getUser()).queue();
|
||||||
if (e.getGuild().getSelfMember().canInteract(e.getMember())) {
|
if (e.getGuild().getSelfMember().canInteract(e.getMember())) {
|
||||||
e.getMember().kick().reason("Declined the rules");
|
e.getMember().kick().reason("Declined the rules");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (e.getReactionEmote().isEmoji()) {
|
} else if (e.getReactionEmote().isEmoji()) {
|
||||||
if (rethinkServer.getAcceptEmote().equals(e.getReactionEmote().getEmoji())) {
|
if (mongoServer.getAcceptEmote().equals(e.getReactionEmote().getEmoji())) {
|
||||||
addRole(e);
|
addRole(e);
|
||||||
} else if (rethinkServer.getDeclineEmote().equals(e.getReactionEmote().getEmoji())) {
|
} else if (mongoServer.getDeclineEmote().equals(e.getReactionEmote().getEmoji())) {
|
||||||
e.getReaction().removeReaction(e.getUser()).queue();
|
e.getReaction().removeReaction(e.getUser()).queue();
|
||||||
if (e.getGuild().getSelfMember().canInteract(e.getMember())) {
|
if (e.getGuild().getSelfMember().canInteract(e.getMember())) {
|
||||||
e.getMember().kick().reason("Declined the rules");
|
e.getMember().kick().reason("Declined the rules");
|
||||||
|
|
@ -57,17 +57,18 @@ public class RulesListener extends ListenerAdapter {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addRole(MessageReactionAddEvent e) {
|
private void addRole(MessageReactionAddEvent e) {
|
||||||
RethinkServer rethinkServer = new RethinkServer(rethink.getObjectByID("server", e.getGuild().getId()), rethink);
|
MongoServer mongoServer = new MongoServer(mongo.getObjectByID("server", e.getGuild().getId()), mongo);
|
||||||
if (e.getMember().getRoles().contains(e.getGuild().getRoleById(rethinkServer.getRoleID()))) {
|
if (e.getMember().getRoles().contains(e.getGuild().getRoleById(mongoServer.getRoleID()))) {
|
||||||
e.getGuild().removeRoleFromMember(e.getMember(), e.getGuild().getRoleById(rethinkServer.getRoleID())).reason("Accepted rules").queue();
|
e.getGuild().removeRoleFromMember(e.getMember(), e.getGuild().getRoleById(mongoServer.getRoleID())).reason("Accepted rules").queue();
|
||||||
} else e.getGuild().addRoleToMember(e.getMember(), e.getGuild().getRoleById(rethinkServer.getRoleID())).reason("Accepted rules").queue();
|
} else
|
||||||
|
e.getGuild().addRoleToMember(e.getMember(), e.getGuild().getRoleById(mongoServer.getRoleID())).reason("Accepted rules").queue();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onMessageReactionRemove(MessageReactionRemoveEvent e) {
|
public void onMessageReactionRemove(MessageReactionRemoveEvent e) {
|
||||||
RethinkServer rethinkServer = new RethinkServer(rethink.getObjectByID("server", e.getGuild().getId()), rethink);
|
MongoServer mongoServer = new MongoServer(mongo.getObjectByID("server", e.getGuild().getId()), mongo);
|
||||||
if (e.getMessageId().equals(rethinkServer.getMessageID()) && !e.getUser().isBot()) {
|
if (e.getMessageId().equals(mongoServer.getMessageID()) && !e.getUser().isBot()) {
|
||||||
e.getGuild().removeRoleFromMember(e.getMember(), e.getGuild().getRoleById(rethinkServer.getRoleID())).reason("Withdrawal of the acceptance of the rules").queue();
|
e.getGuild().removeRoleFromMember(e.getMember(), e.getGuild().getRoleById(mongoServer.getRoleID())).reason("Withdrawal of the acceptance of the rules").queue();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2019-2020 GregTCLTK and Schlauer-Hax
|
* Copyright 2019-2021 GregTCLTK and Schlauer-Hax
|
||||||
*
|
*
|
||||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
* 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 not use this file except in compliance with the License.
|
||||||
|
|
@ -14,10 +14,10 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.bbn.hadder.listener;
|
package one.bbn.hadder.listener;
|
||||||
|
|
||||||
import com.bbn.hadder.db.Rethink;
|
import one.bbn.hadder.db.Mongo;
|
||||||
import com.bbn.hadder.db.RethinkServer;
|
import one.bbn.hadder.db.MongoServer;
|
||||||
import net.dv8tion.jda.api.EmbedBuilder;
|
import net.dv8tion.jda.api.EmbedBuilder;
|
||||||
import net.dv8tion.jda.api.MessageBuilder;
|
import net.dv8tion.jda.api.MessageBuilder;
|
||||||
import net.dv8tion.jda.api.entities.MessageReaction;
|
import net.dv8tion.jda.api.entities.MessageReaction;
|
||||||
|
|
@ -30,10 +30,10 @@ import javax.annotation.Nonnull;
|
||||||
|
|
||||||
public class StarboardListener extends ListenerAdapter {
|
public class StarboardListener extends ListenerAdapter {
|
||||||
|
|
||||||
private Rethink rethink;
|
private final Mongo mongo;
|
||||||
|
|
||||||
public StarboardListener(Rethink rethink) {
|
public StarboardListener(Mongo mongo) {
|
||||||
this.rethink = rethink;
|
this.mongo = mongo;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -48,9 +48,9 @@ public class StarboardListener extends ListenerAdapter {
|
||||||
|
|
||||||
public void update(GenericMessageReactionEvent e) {
|
public void update(GenericMessageReactionEvent e) {
|
||||||
if (e.getReaction().getReactionEmote().getName().equals("⭐")) {
|
if (e.getReaction().getReactionEmote().getName().equals("⭐")) {
|
||||||
RethinkServer rethinkServer = new RethinkServer(rethink.getObjectByID("server", e.getGuild().getId()), rethink);
|
MongoServer mongoServer = new MongoServer(mongo.getObjectByID("server", e.getGuild().getId()), mongo);
|
||||||
if (!rethink.hasStarboardMessage(e.getMessageId())) {
|
if (!mongo.hasStarboardMessage(e.getMessageId())) {
|
||||||
if (rethinkServer.hasStarboardChannel()) {
|
if (mongoServer.hasStarboardChannel()) {
|
||||||
e.getTextChannel().retrieveMessageById(e.getMessageId()).queue(
|
e.getTextChannel().retrieveMessageById(e.getMessageId()).queue(
|
||||||
msg -> {
|
msg -> {
|
||||||
int stars = 0;
|
int stars = 0;
|
||||||
|
|
@ -60,8 +60,8 @@ public class StarboardListener extends ListenerAdapter {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Integer.parseInt(rethinkServer.getNeededStars()) <= stars) {
|
if (Integer.parseInt(mongoServer.getNeededStars()) <= stars) {
|
||||||
e.getGuild().getTextChannelById(rethinkServer.getStarboard())
|
e.getGuild().getTextChannelById(mongoServer.getStarboard())
|
||||||
.sendMessage(new MessageBuilder()
|
.sendMessage(new MessageBuilder()
|
||||||
.setContent("⭐ 1" + " " + e.getTextChannel().getAsMention())
|
.setContent("⭐ 1" + " " + e.getTextChannel().getAsMention())
|
||||||
.setEmbed(
|
.setEmbed(
|
||||||
|
|
@ -70,7 +70,7 @@ public class StarboardListener extends ListenerAdapter {
|
||||||
.setDescription(msg.getContentRaw())
|
.setDescription(msg.getContentRaw())
|
||||||
.setTimestamp(msg.getTimeCreated()).build()).build()).queue(
|
.setTimestamp(msg.getTimeCreated()).build()).build()).queue(
|
||||||
starboardmsg -> {
|
starboardmsg -> {
|
||||||
rethink.insertStarboardMessage(msg.getId(), e.getGuild().getId(), starboardmsg.getId());
|
mongo.insertStarboardMessage(msg.getId(), e.getGuild().getId(), starboardmsg.getId());
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
@ -90,11 +90,11 @@ public class StarboardListener extends ListenerAdapter {
|
||||||
}
|
}
|
||||||
|
|
||||||
int finalStars = stars;
|
int finalStars = stars;
|
||||||
e.getGuild().getTextChannelById(rethinkServer.getStarboard())
|
e.getGuild().getTextChannelById(mongoServer.getStarboard())
|
||||||
.retrieveMessageById(rethink.getStarboardMessage(e.getMessageId())).queue(
|
.retrieveMessageById(mongo.getStarboardMessage(e.getMessageId())).queue(
|
||||||
msg2 -> {
|
msg2 -> {
|
||||||
|
|
||||||
if (Integer.parseInt(rethinkServer.getNeededStars()) <= finalStars) {
|
if (Integer.parseInt(mongoServer.getNeededStars()) <= finalStars) {
|
||||||
msg2.editMessage(new MessageBuilder()
|
msg2.editMessage(new MessageBuilder()
|
||||||
.setContent("⭐ " + finalStars + " " + e.getTextChannel().getAsMention())
|
.setContent("⭐ " + finalStars + " " + e.getTextChannel().getAsMention())
|
||||||
.setEmbed(
|
.setEmbed(
|
||||||
|
|
@ -104,7 +104,7 @@ public class StarboardListener extends ListenerAdapter {
|
||||||
.setTimestamp(msg.getTimeCreated()).build()).build()).queue();
|
.setTimestamp(msg.getTimeCreated()).build()).build()).queue();
|
||||||
} else {
|
} else {
|
||||||
msg2.delete().queue();
|
msg2.delete().queue();
|
||||||
rethink.removeStarboardMessage(msg.getId());
|
mongo.removeStarboardMessage(msg.getId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue