@@ -72,48 +72,36 @@ BotBlockAPI api = new BotBlockAPI.Builder()
72
72
#### Notes
73
73
There are a lot of other methods that you can use. Head over to the [ Wiki] for more information.
74
74
75
- ### Creating a RequestHandler instance
76
- The next step after creating an instance of the BotBlockAPI is to create an instance of the Request Handler.
77
- The RequestHandler is the main class for performing the post action. It allows you to post guild counts either automatically or manual.
78
-
79
- You need to provide either JDA, ShardManager or the bots id and guild count.
80
- The example here shows the option with JDA, but like I said can you also use ShardManager or manually add ID and guilds.
81
- ``` java
82
- // We previously created a BotBlockAPI instance called api which we now use here.
83
- RequestHandler handler = new RequestHandler (jda, api);
84
- ```
85
-
86
- ### Posting the guild counts
87
- This step depends on what You previously set for the RequestHandler since some methods are only available for certain cases.
88
-
89
- ** All methods require BotBlockAPI to be setup, meaning you have to AT LEAST add one site and token!**
75
+ ### Posting
76
+ You can post the guilds eithe automatically or manually depending on your own preferences.
90
77
91
78
#### Auto-posting
92
- The Wrapper comes with an inbuilt auto-post that allows you to easily post the guild counts without worrying too much.
93
- However, this method is limited to JDA and ShardManager only so you have to define them for using this .
79
+ JavaBotBlockAPI comes with an inbuild scheduler to post yout guilds automatically.
80
+ To use it simply use the ` startAutoPosting ` method and provide either a JDA instance, ShardManager instance or the bot id and guild count .
94
81
95
- To auto-post guild counts you just need to call ` RequestHandler#startAutoPosting(); ` .
96
- This would look like this:
82
+ ** Example** :
97
83
``` java
98
- // We previously defined a RequestHandler called handler
99
- handler. startAutoPosting();
84
+ // We need to get an instance of RequestHandler to use the methods.
85
+ RequestHandler handler = new RequestHandler ();
86
+
87
+ // jda is a JDA instance and api a BotBlockAPI instance.
88
+ handler. startAutoPosting(jda, api);
100
89
```
101
90
102
- Easy right? But what if you want to stop the auto-posting?
103
- For that simply use ` Request#stopAutoPosting(); ` . Here is another example:
104
- ``` java
105
- // We previously defined a RequestHandler called handler
91
+ But what if you want to stop it?
92
+ For that just call the ` stopAutoPosting ` method:
93
+ ```
106
94
handler.stopAutoPosting();
107
95
```
108
96
109
- Note that the delay in which you post to the API is defined through the BotBlockAPI.
110
- Use ` BotBlockAPI.Builder#setUpdateInterval(Integer) ` to define a delay. It is counted in minutes and default is 30.
111
-
112
97
#### Manual posting
113
- If you want to post the guild counts manually you can use the following method:
98
+ If you want to post the guild counts manually you can use the ` postGuilds ` method.
114
99
``` java
115
- // We previously defined a RequestHandler called handler
116
- handler. postGuilds();
100
+ // We need to get an instance of RequestHandler to use the methods.
101
+ RequestHandler handler = new RequestHandler ();
102
+
103
+ // jda is a JDA instance and api a BotBlockAPI instance.
104
+ handler. postGuilds(jda, api);
117
105
```
118
106
119
107
### Exceptions
0 commit comments