22
22
import static core .Main .jda ;
23
23
24
24
public class BotList extends ListenerAdapter {
25
+
26
+ String botlistspace_url = "https://botlist.space/api/bots/407189087649398795" ;
27
+ String botsfordiscord_url = "https://botsfordiscord.com/api/v1/bots/407189087649398795" ;
28
+
29
+
30
+ JSONObject data = new JSONObject ();
31
+
25
32
@ Override
26
33
public void onGuildJoin (GuildJoinEvent event ) {
27
34
28
- String botlistspace_url = "https://botlist.space/api/bots/407189087649398795" ;
29
- JSONObject data = new JSONObject ();
30
35
data .put ("shard_id" , event .getJDA ().getShardInfo ().getShardId ());
31
36
data .put ("shard_count" , Main .shardManager .getShardsTotal ());
32
37
data .put ("server_count" , Main .shardManager .getGuilds ().size ());
@@ -45,92 +50,11 @@ public void onGuildJoin(GuildJoinEvent event) {
45
50
e .printStackTrace ();
46
51
}
47
52
48
-
49
- String botsfordiscord_url = "https://botsfordiscord.com/api/v1/bots/407189087649398795" ;
50
-
51
- data .put ("server_count" , Main .shardManager .getGuilds ().size ());
52
-
53
-
54
- Request botsfordiscord = new Request .Builder ()
55
- .url (botsfordiscord_url )
56
- .post (body )
57
- .addHeader ("Authorization" , SECRETS .botsfordiscord )
58
- .build ();
59
-
60
- try {
61
- new OkHttpClient ().newCall (botsfordiscord ).execute ().close ();
62
- System .out .println ("Successfully posted count for Bots for Discord!" );
63
- } catch (IOException e ) {
64
- e .printStackTrace ();
65
- }
66
-
67
- String discordpw_url = "https://bots.discord.pw/api/bots/407189087649398795/stats" ;
68
-
69
- data .put ("shard_id" , event .getJDA ().getShardInfo ().getShardId ());
70
- data .put ("shard_count" , Main .shardManager .getShardsTotal ());
71
- data .put ("server_count" , Main .shardManager .getGuilds ().size ());
72
-
73
-
74
- Request discordpw = new Request .Builder ()
75
- .url (discordpw_url )
76
- .post (body )
77
- .addHeader ("Authorization" , SECRETS .discordpw )
78
- .build ();
79
-
80
- try {
81
- new OkHttpClient ().newCall (discordpw ).execute ().close ();
82
- System .out .println ("Successfully posted count for discord.pw!" );
83
- } catch (IOException e ) {
84
- e .printStackTrace ();
85
- }
86
-
87
-
88
- String discordbots_url = "https://bots.discord.pw/api/bots/407189087649398795/stats" ;
89
-
90
- data .put ("shard_id" , event .getJDA ().getShardInfo ().getShardId ());
91
- data .put ("shard_count" , Main .shardManager .getShardsTotal ());
92
- data .put ("server_count" , Main .shardManager .getGuilds ().size ());
93
-
94
-
95
- Request discordbots = new Request .Builder ()
96
- .url (discordbots_url )
97
- .post (body )
98
- .addHeader ("Authorization" , SECRETS .discordbots )
99
- .build ();
100
-
101
- try {
102
- new OkHttpClient ().newCall (discordbots ).execute ().close ();
103
- System .out .println ("Successfully posted count for discord.pw!" );
104
- } catch (IOException e ) {
105
- e .printStackTrace ();
106
- }
107
-
108
-
109
- String discordbotworld_url = "https://discordbot.world/api/bot/407189087649398795/stats" ;
110
-
111
- data .put ("shard_count" , Main .shardManager .getShardsTotal ());
112
- data .put ("server_count" , Main .shardManager .getGuilds ().size ());
113
-
114
-
115
- Request discordbotworld = new Request .Builder ()
116
- .url (discordbotworld_url )
117
- .post (body )
118
- .addHeader ("Authorization" , SECRETS .botworld )
119
- .build ();
120
-
121
- try {
122
- new OkHttpClient ().newCall (discordbotworld ).execute ().close ();
123
- System .out .println ("Successfully posted count for discordbot.world!" );
124
- } catch (IOException e ) {
125
- e .printStackTrace ();
126
- }
127
53
}
128
54
129
55
130
56
public void onGuildLeave (GuildLeaveEvent event ) {
131
57
132
- String botlistspace_url = "https://botlist.space/api/bots/407189087649398795" ;
133
- JSONObject data = new JSONObject ();
134
58
data .put ("shard_id" , event .getJDA ().getShardInfo ().getShardId ());
135
59
data .put ("shard_count" , Main .shardManager .getShardsTotal ());
136
60
data .put ("server_count" , Main .shardManager .getGuilds ().size ());
@@ -148,63 +72,5 @@ public void onGuildLeave(GuildLeaveEvent event) {
148
72
} catch (IOException e ) {
149
73
e .printStackTrace ();
150
74
}
151
-
152
-
153
- String botsfordiscord_url = "https://botsfordiscord.com/api/v1/bots/407189087649398795" ;
154
-
155
- data .put ("server_count" , "91" );
156
-
157
-
158
- Request botsfordiscord = new Request .Builder ()
159
- .url (botsfordiscord_url )
160
- .post (body )
161
- .addHeader ("Authorization" , SECRETS .botsfordiscord )
162
- .build ();
163
-
164
- try {
165
- new OkHttpClient ().newCall (botsfordiscord ).execute ().close ();
166
- System .out .println ("Successfully posted count for Bots for Discord!" );
167
- } catch (IOException e ) {
168
- e .printStackTrace ();
169
- }
170
-
171
- String discordpw_url = "https://bots.discord.pw/api/bots/407189087649398795/stats" ;
172
-
173
- data .put ("shard_id" , event .getJDA ().getShardInfo ().getShardId ());
174
- data .put ("shard_count" , Main .shardManager .getShardsTotal ());
175
- data .put ("server_count" , Main .shardManager .getGuilds ().size ());
176
-
177
-
178
- Request discordpw = new Request .Builder ()
179
- .url (discordpw_url )
180
- .post (body )
181
- .addHeader ("Authorization" , SECRETS .discordpw )
182
- .build ();
183
-
184
- try {
185
- new OkHttpClient ().newCall (discordpw ).execute ().close ();
186
- System .out .println ("Successfully posted count for discord.pw!" );
187
- } catch (IOException e ) {
188
- e .printStackTrace ();
189
- }
190
-
191
- String discordbotworld_url = "https://discordbot.world/api/bot/407189087649398795/stats" ;
192
-
193
- data .put ("shard_count" , Main .shardManager .getShardsTotal ());
194
- data .put ("server_count" , Main .shardManager .getGuilds ().size ());
195
-
196
-
197
- Request discordbotworld = new Request .Builder ()
198
- .url (discordbotworld_url )
199
- .post (body )
200
- .addHeader ("Authorization" , SECRETS .botworld )
201
- .build ();
202
-
203
- try {
204
- new OkHttpClient ().newCall (discordbotworld ).execute ().close ();
205
- System .out .println ("Successfully posted count for discordbot.world!" );
206
- } catch (IOException e ) {
207
- e .printStackTrace ();
208
- }
209
75
}
210
76
}
0 commit comments