@@ -63,32 +63,30 @@ This class is the center of everything, including on what sites you want to post
63
63
You can use the internal Builder class of BotBlockAPI to create an instance. It would look something like this:
64
64
``` java
65
65
// Creating an instance of BotBlockAPI using BotBlockAPI.Builder
66
- BotBlockAPI api = new BotBlockAPI .Builder (jda) // We can provide either a instance of JDA or ShardManager
66
+ BotBlockAPI api = new BotBlockAPI .Builder ()
67
67
.addAuthToken(" lbots.org" , " MySecretToken123" ) // Adds a site with the corresponding API token.
68
68
.addAuthToken(" botlist.space" , " MySecretToken456" ) // The builder allows chaining of the methods.
69
69
.build();
70
70
```
71
71
72
72
#### Notes
73
- ` new BotBlockAPI.Builder() ` allows you to provide either a JDA instance, a ShardManager instance or none at all.
74
- You can define a JDA or ShardManager instance at a later point with ` .setJDA(JDA) ` or ` .setShardManager(ShardManager) ` respectively.
75
-
76
- Also note that when you don't provide any instance, that you have to use ` disableJDA(true) ` or else you'll receive an NullPointerException.
77
- There are also a lot of other methods that you can use. Head over to the [ Wiki] for more information.
73
+ There are a lot of other methods that you can use. Head over to the [ Wiki] for more information.
78
74
79
75
### Creating a RequestHandler instance
80
- The next step after creating an instance of the BotBlockAPI is to create an instance of the Request Handler.
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.
81
78
82
- This example shows the easiest one to use, but there are much more ways you can set it. Check the [ Wiki] for examples.
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.
83
81
``` java
84
82
// We previously created a BotBlockAPI instance called api which we now use here.
85
- RequestHandler handler = new RequestHandler (api);
83
+ RequestHandler handler = new RequestHandler (jda, api);
86
84
```
87
85
88
86
### Posting the guild counts
89
- This step depends on what You previously set for the BotBlockAPI and the RequestHandler since some methods are only available for certain cases.
87
+ This step depends on what You previously set for the RequestHandler since some methods are only available for certain cases.
90
88
91
- ** All methods require BotBlockAPI to be setup, meaning you have AT LEAST added one site and token!**
89
+ ** All methods require BotBlockAPI to be setup, meaning you have to AT LEAST add one site and token!**
92
90
93
91
#### Auto-posting
94
92
The Wrapper comes with an inbuilt auto-post that allows you to easily post the guild counts without worrying too much.
0 commit comments