Skip to content

Commit 75bf747

Browse files
authored
Merge pull request #252 from botblock/feature/fix-discordlist-token
Add check for discordlist.space tokens
2 parents 87bf0c0 + b06a4a0 commit 75bf747

File tree

4 files changed

+11
-6
lines changed

4 files changed

+11
-6
lines changed

build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ plugins{
77
id 'com.github.johnrengelman.shadow' version '5.2.0'
88
}
99

10-
def ver = new Version(major: 6, minor: 7, patch: 0)
10+
def ver = new Version(major: 6, minor: 7, patch: 1)
1111

1212
allprojects {
1313
apply plugin: 'maven-publish'

core/src/main/java/org/botblock/javabotblockapi/core/BotBlockAPI.java

+8
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,10 @@ public Builder addAuthToken(@Nonnull Site site, @Nonnull String token){
8888
CheckUtil.notEmpty(token, "Token");
8989
CheckUtil.condition(!site.supportsPost(), site.getName() + " does not support POST requests!");
9090

91+
// Discordlist.space requires the token to start with "Bot "
92+
if(site.getName().equals("discordlist.space") && !token.startsWith("Bot "))
93+
token = "Bot " + token;
94+
9195
tokens.put(site.getName(), token);
9296
return this;
9397
}
@@ -113,6 +117,10 @@ public Builder addAuthToken(@Nonnull Site site, @Nonnull String token){
113117
public Builder addAuthToken(@Nonnull String site, @Nonnull String token){
114118
CheckUtil.notEmpty(site, "Site");
115119
CheckUtil.notEmpty(token, "Token");
120+
121+
// Discordlist.space requires the token to start with "Bot "
122+
if(site.equals("discordlist.space") && !token.startsWith("Bot "))
123+
token = "Bot " + token;
116124

117125
tokens.put(site, token);
118126
return this;

core/src/main/java/org/botblock/javabotblockapi/core/Info.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ public class Info{
3535
/**
3636
* Minor version of the Wrapper.
3737
*/
38-
public static final int MINOR = 6;
38+
public static final int MINOR = 7;
3939
/**
4040
* Patch version of the Wrapper.
4141
*/
42-
public static final int PATCH = 6;
42+
public static final int PATCH = 1;
4343

4444
/**
4545
* Full version in the format {@code major.minor.patch}.

core/src/main/java/org/botblock/javabotblockapi/core/Site.java

-3
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@
1818

1919
package org.botblock.javabotblockapi.core;
2020

21-
import org.botblock.javabotblockapi.core.annotations.DeprecatedSince;
22-
import org.botblock.javabotblockapi.core.annotations.PlannedRemoval;
23-
2421
import java.util.ArrayList;
2522
import java.util.Arrays;
2623
import java.util.List;

0 commit comments

Comments
 (0)