Skip to content

Commit

Permalink
Merge pull request #236 from botblock/feature/version-6-6-6
Browse files Browse the repository at this point in the history
Version 6.6.6
  • Loading branch information
Andre601 authored May 3, 2021
2 parents d4ed020 + 9463d5c commit 1316be5
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 87 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ plugins{
id 'com.github.johnrengelman.shadow' version '5.2.0'
}

def ver = new Version(major: 6, minor: 6, patch: 5)
def ver = new Version(major: 6, minor: 6, patch: 6)

allprojects {
apply plugin: 'maven-publish'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class Info{
/**
* Patch version of the Wrapper.
*/
public static final int PATCH = 5;
public static final int PATCH = 6;

/**
* Full version in the format {@code major.minor.patch}.
Expand Down
52 changes: 33 additions & 19 deletions core/src/main/java/org/botblock/javabotblockapi/core/Site.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,13 @@ public class Site{
* <ul>
* <li>POST</li>
* </ul>
*
* @deprecated Website not responding.
*/
public static final Site ARCANE_CENTER_XYZ = new Site("arcane-center.xyz", HttpMethod.POST);
@Deprecated
@DeprecatedSince(major = 6, minor = 6, patch = 6)
@PlannedRemoval(major = 6, minor = 6, patch = 8)
public static final Site ARCANE_CENTER_XYZ = new Site("arcane-center.xyz");

/**
* <a href="https://bladebotlist.xyz" target="_blank">bladebotlist.xyz</a>
Expand All @@ -82,6 +87,17 @@ public class Site{
*/
public static final Site BLIST_XYZ = new Site("blist.xyz", HttpMethod.GET, HttpMethod.POST);

/**
* <a href="https://boatspace.xyz" target="_blank">boatspace.xyz</a>
*
* <p>Supported methods:
* <ul>
* <li>GET</li>
* <li>POST</li>
* </ul>
*/
public static final Site BOATSPACE_XYZ = new Site("boatspace.xyz", HttpMethod.GET, HttpMethod.POST);

/**
* <a href="https://botsdatabase.com" target="_blank">botsdatabase.com</a>
*
Expand All @@ -90,8 +106,13 @@ public class Site{
* <li>GET</li>
* <li>POST</li>
* </ul>
*
* @deprecated Website not responding.
*/
public static final Site BOTSDATABASE_COM = new Site("botsdatabase.com", HttpMethod.GET, HttpMethod.POST);
@Deprecated
@DeprecatedSince(major = 6, minor = 6, patch = 6)
@PlannedRemoval(major = 6, minor = 6, patch = 8)
public static final Site BOTSDATABASE_COM = new Site("botsdatabase.com");

/**
* <a href="https://bots.discordlabs.org" target="_blank">bots.discordlabs.org</a>
Expand Down Expand Up @@ -146,23 +167,6 @@ public class Site{
*/
public static final Site DISCORD_BOATS = new Site("discord.boats", HttpMethod.GET, HttpMethod.POST);

/**
* <a href="https://discordbotdirectory.net" target="_blank">discordbotdirectory.net</a>
*
* <p>Supported methods:
* <ul>
* <li>GET</li>
* </ul>
*
* @deprecated Site no longer exists.
*
* @since 6.3.0
*/
@Deprecated
@DeprecatedSince(major = 6, minor = 6, patch = 4)
@PlannedRemoval(major = 6, minor = 6, patch = 6)
public static final Site DISCORDBOTDIRECTORY_NET = new Site("discordbotdirectory.net");

/**
* <a href="https://discordbotlist.com" target="_blank">discordbotlist.com</a>
*
Expand Down Expand Up @@ -231,6 +235,16 @@ public class Site{
*/
public static final Site DISCORDLIST_SPACE = new Site("discordlist.space", HttpMethod.GET, HttpMethod.POST);

/**
* <a href="https://discordservices.net" target="_blank">discordservices.net</a>
*
* <p>Supported methods:
* <ul>
* <li>POST</li>
* </ul>
*/
public static final Site DISCORDSERVICES_NET = new Site("discordservices.net", HttpMethod.POST);

/**
* <a href="https://disforge.com" target="_blank">disforge.com</a>
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,36 +124,8 @@ public GetBotAction(boolean disableCache, @Nonnull String userAgent, @Nonnull St
/**
* Gets the full information of a bot.
*
* <p>The JSONObject may look like this:
* <br><pre><code>
* {
* "id": "123456789012345678",
* "username": "MyBot",
* "discriminator": "1234",
* "owners": [
* "234567890123456789"
* ],
* "server_count": 100,
* "invite":{@literal "https://discordapp.com/oauth2/authorize?client_id=123456789012345678&scope=bot"},
* "prefix": "?",
* "website": "",
* "github": "",
* "support": "",
* "library": "JDA",
* "list_data": {
* "somebotlist.com": [
* {"data": "Unique bot list data"},
* 200
* ],
* "otherlist.org": [
* {"data": "Unique bot list data"},
* 404
* ]
* }
* }
* </code></pre>
* <br>With exception of id and list_data are all returned values based on how often one appears.
* <br>Each entry in list data is unique to what the respective bot list returns.
* An example of how the returned JSON may look like can be found here:<br>
* <a href="https://gist.github.com/Andre601/b18b1c4e88e9a405806ce7b6c29a0136" target="_blank">https://gist.github.com/Andre601/b18b1c4e88e9a405806ce7b6c29a0136</a>
*
* <p>Following Exceptions can be thrown from the HTTP request:
* <ul>
Expand All @@ -167,43 +139,15 @@ public GetBotAction(boolean disableCache, @Nonnull String userAgent, @Nonnull St
* @return Possibly-null {@link org.json.JSONObject JSONObject} containing the full information of the bot.
*/
@Nullable
public JSONObject getBotInfo(@Nonnull Long id){
public JSONObject getBotInfo(long id){
return getBotInfo(String.valueOf(id));
}

/**
* Gets the full information of a bot.
*
* <p>The JSONObject may look like this:
* <br><pre><code>
* {
* "id": "123456789012345678",
* "username": "MyBot",
* "discriminator": "1234",
* "owners": [
* "234567890123456789"
* ],
* "server_count": 100,
* "invite":{@literal "https://discordapp.com/oauth2/authorize?client_id=123456789012345678&scope=bot"},
* "prefix": "?",
* "website": "",
* "github": "",
* "support": "",
* "library": "JDA",
* "list_data": {
* "somebotlist.com": [
* {"data": "Unique bot list data"},
* 200
* ],
* "otherlist.org": [
* {"data": "Unique bot list data"},
* 404
* ]
* }
* }
* </code></pre>
* <br>With exception of id and list_data are all returned values based on how often one appears.
* <br>Each entry in list data is unique to what the respective bot list returns.
* An example of how the returned JSON may look like can be found here:<br>
* <a href="https://gist.github.com/Andre601/b18b1c4e88e9a405806ce7b6c29a0136" target="_blank">https://gist.github.com/Andre601/b18b1c4e88e9a405806ce7b6c29a0136</a>
*
* <p>Following Exceptions can be thrown from the CheckUtil:
* <ul>
Expand Down Expand Up @@ -248,7 +192,7 @@ public JSONObject getBotInfo(@Nonnull String id){
* @return Possibly-null {@link org.json.JSONObject JSONObject} containing information from the different bot list.
*/
@Nullable
public JSONObject getBotListInfo(@Nonnull Long id){
public JSONObject getBotListInfo(long id){
return getBotListInfo(String.valueOf(id));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ public void performPOST(@Nonnull JSONObject json, int sites) throws IOException{
response.protocol(),
response.code(),
response.message(),
response.headers().toString()
response.headers()
);
return;
}
Expand All @@ -155,7 +155,7 @@ public void performPOST(@Nonnull JSONObject json, int sites) throws IOException{
response.protocol(),
response.code(),
response.message(),
response.headers().toString()
response.headers()
);
return;
}
Expand Down Expand Up @@ -213,7 +213,7 @@ private JSONObject performGET(@Nonnull String url, String header) throws IOExcep
response.protocol(),
response.code(),
response.message(),
response.headers().toString()
response.headers()
);
return null;
}
Expand All @@ -227,7 +227,7 @@ private JSONObject performGET(@Nonnull String url, String header) throws IOExcep
response.protocol(),
response.code(),
response.message(),
response.headers().toString()
response.headers()
);
return null;
}
Expand Down

0 comments on commit 1316be5

Please sign in to comment.