Skip to content

Commit 7850106

Browse files
Initial commit
0 parents  commit 7850106

24 files changed

+3313
-0
lines changed

README.md

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# This was the github wiki for [discord-jda/JDA](https://github.com/discord-jda/JDA)
2+
# It has been migrated to [jda.wiki](https://jda.wiki/) in JDA 5
3+
4+
This repository is for archival purposes.
5+
6+
----
7+
8+
## Introduction
9+
10+
- [[Home]]
11+
- [[Using Events|1)-Events]]
12+
- [[List of Events|8)-List-of-Events]]
13+
- [[FAQ|10)-FAQ]]
14+
- [[Migration V3 -> V4|0)-Migrating-to-V4]]
15+
16+
### [[Setup|2)-Setup]]
17+
18+
- [[Eclipse Setup|2)-Eclipse-Setup]]
19+
- [[Intellij IDEA Setup|2)-Intellij-IDEA-Setup]]
20+
- [[Netbeans Setup|2)-Netbeans-Setup]]
21+
- [[Logging (SLF4J)|Logging-Setup]]
22+
23+
### Using JDA
24+
25+
- [[Getting Started|3)-Getting-Started]]
26+
- [[Making a Music Bot|4)-Making-a-Music-Bot]]
27+
- [[Using RestAction|7)-Using-RestAction]]
28+
- [[Asynchronous|7)-Using-RestAction#using-queue]]
29+
- [[Blocking|7)-Using-RestAction#using-complete]]
30+
- [[Cancellable|7)-Using-RestAction#using-submit]]
31+
- [[Planning|7)-Using-RestAction#using-completeafter-submitafter-and-queueafter]]
32+
- [[Interactions|Interactions]]
33+
- [[Slash Commands|Interactions#slash-commands]]
34+
- [[Buttons|Interactions#buttons]]
35+
- [[Paginating Entities|7)-Paginating-Entities]]
36+
- [[Gateway Intents and Member Cache Policy|Gateway-Intents-and-Member-Cache-Policy]]
37+
- [Webhooks](https://github.com/MinnDevelopment/discord-webhooks)
38+
- [[Managers and Moderation|12)-Separation-of-Concerns]]
39+
- [[Troubleshooting|19)-Troubleshooting]]
40+
41+
## Contributing
42+
43+
- [[Contributing|5)-Contributing]]
44+
- [[Structure Guide|6)-JDA-Structure-Guide]]
45+
- [[Repository Structure|11)-Repository-Structure]]

wiki/contributing/Contributing.md

+146
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
# This wiki page is migrating to [jda.wiki/contributing/contributing](https://jda.wiki/contributing/contributing/)
2+
3+
***
4+
5+
## Setting up your Environment
6+
7+
8+
1. Create a Fork (If you already have a local repository skip to step 3)
9+
10+
![Create Fork](https://i.imgur.com/DqDWls4.png)
11+
12+
2. Clone Repository
13+
14+
```sh
15+
$ git clone https://github.com/ExampleName/JDA.git
16+
Cloning into 'JDA'...
17+
remote: Counting objects: 15377, done.
18+
remote: Total 15377 (delta 0), reused 0 (delta 0), pack-reused 15377
19+
Receiving objects: 100% (15377/15377), 21.64 MiB | 2.36 MiB/s, done.
20+
Resolving deltas: 100% (8584/8584), done.
21+
Checking connectivity... done.
22+
```
23+
> Replace `ExampleName` with your GitHub username, mine for example is `MinnDevelopment`
24+
25+
3. Move to your local repository (here `JDA`)
26+
27+
```sh
28+
cd JDA
29+
```
30+
31+
4. Configure upstream remote to keep your fork updated
32+
33+
```sh
34+
$ git remote add upstream https://github.com/DV8FromTheWorld/JDA.git
35+
```
36+
37+
5. Create branch based on `upstream/master`
38+
39+
```sh
40+
$ git fetch upstream master
41+
From https://github.com/DV8FromTheWorld/JDA
42+
* branch master -> FETCH_HEAD
43+
* [new branch] master -> upstream/master
44+
45+
$ git checkout -b patch-1 upstream/master
46+
Switched to a new branch 'patch-1'
47+
```
48+
49+
## Making Changes
50+
51+
Depending on your changes, there are certain rules you have to follow if you expect
52+
your Pull Request to be merged.
53+
54+
**Note**: It is recommended to create a new remote branch for each Pull Request.
55+
Based on the current `upstream/master`!
56+
57+
1. Adding a new Method or Class
58+
- If your addition is not internal (e.g. an impl class or private method) you have to write documentation.
59+
- For that please follow the [[JavaDoc template|6)-JDA-Structure-Guide#javadoc]]
60+
- Keep your code consistent! [[example|5)-contributing#examples]]
61+
- Follow the guides provided at [[6) JDA Structure Guide|6)-JDA-Structure-Guide]]
62+
- Compare your code style to the one used all over JDA and ensure you
63+
do not break the consistency (if you find issues in the JDA style you can include and update it)
64+
65+
2. Making a Commit
66+
- While having multiple commits can help the reader understand your changes, it might sometimes be
67+
better to include more changes in a single commit.
68+
- When you commit your changes write a proper commit caption which explains what you have done
69+
70+
3. Updating your Fork
71+
- Before you start committing make sure your fork is updated.
72+
(See [Syncing a Fork](https://help.github.com/articles/syncing-a-fork/)
73+
or [Keeping a Fork Updated](https://robots.thoughtbot.com/keeping-a-github-fork-updated))
74+
75+
## Creating a Pull Request
76+
77+
1. Commit your changes
78+
79+
```sh
80+
$ git commit -am "Updated Copyright in build.gradle"
81+
[patch-1 340383d] Updated Copyright in build.gradle
82+
1 file changed, 1 insertion(+), 1 deletion(-)
83+
```
84+
85+
2. Push your commits
86+
87+
```sh
88+
$ git push origin patch-1
89+
Counting objects: 3, done.
90+
Delta compression using up to 8 threads.
91+
Compressing objects: 100% (3/3), done.
92+
Writing objects: 100% (3/3), 313 bytes | 0 bytes/s, done.
93+
Total 3 (delta 2), reused 0 (delta 0)
94+
remote: Resolving deltas: 100% (2/2), completed with 2 local objects.
95+
To https://github.com/ExampleName/JDA.git
96+
* [new branch] patch-1 -> patch-1
97+
```
98+
99+
3. Open Pull-Request
100+
101+
![open pull request](https://i.imgur.com/YpRISyh.png)
102+
103+
4. Set base branch to
104+
`base fork: DV8FromTheWorld/JDA` `base: master`
105+
106+
5. Allow edits from Maintainers
107+
108+
6. Done! Just click **Create pull request** and await a review by one of the maintainers!
109+
110+
![Example Pull-Request](https://i.imgur.com/ELZJSn2.png)
111+
112+
### Examples
113+
114+
***
115+
**Bad Addition**
116+
```diff
117+
+ public void reset() {
118+
+ name.reset();
119+
+ avatar.reset();
120+
+
121+
+ if (isType(AccountType.CLIENT)) {
122+
+ email.reset();
123+
+ password.reset();
124+
+ }
125+
+ }
126+
```
127+
128+
**Good Addition**
129+
```diff
130+
+ /*
131+
+ * Resets all {@link net.dv8tion.jda.core.managers.fields.AccountField Fields}
132+
+ * for this manager instance by calling
133+
+ * {@link net.dv8tion.jda.core.managers.fields.Field#reset() Field.reset()} sequentially
134+
+ */
135+
+ public void reset()
136+
+ {
137+
+ name.reset();
138+
+ avatar.reset();
139+
+
140+
+ if (isType(AccountType.CLIENT))
141+
+ {
142+
+ email.reset();
143+
+ password.reset();
144+
+ }
145+
+ }
146+
```

0 commit comments

Comments
 (0)