Skip to content

Commit

Permalink
Merge pull request #252 from botblock/feature/fix-discordlist-token
Browse files Browse the repository at this point in the history
Add check for discordlist.space tokens
  • Loading branch information
Andre601 authored Jul 16, 2021
2 parents 87bf0c0 + b06a4a0 commit 75bf747
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 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: 7, patch: 0)
def ver = new Version(major: 6, minor: 7, patch: 1)

allprojects {
apply plugin: 'maven-publish'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ public Builder addAuthToken(@Nonnull Site site, @Nonnull String token){
CheckUtil.notEmpty(token, "Token");
CheckUtil.condition(!site.supportsPost(), site.getName() + " does not support POST requests!");

// Discordlist.space requires the token to start with "Bot "
if(site.getName().equals("discordlist.space") && !token.startsWith("Bot "))
token = "Bot " + token;

tokens.put(site.getName(), token);
return this;
}
Expand All @@ -113,6 +117,10 @@ public Builder addAuthToken(@Nonnull Site site, @Nonnull String token){
public Builder addAuthToken(@Nonnull String site, @Nonnull String token){
CheckUtil.notEmpty(site, "Site");
CheckUtil.notEmpty(token, "Token");

// Discordlist.space requires the token to start with "Bot "
if(site.equals("discordlist.space") && !token.startsWith("Bot "))
token = "Bot " + token;

tokens.put(site, token);
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ public class Info{
/**
* Minor version of the Wrapper.
*/
public static final int MINOR = 6;
public static final int MINOR = 7;
/**
* Patch version of the Wrapper.
*/
public static final int PATCH = 6;
public static final int PATCH = 1;

/**
* Full version in the format {@code major.minor.patch}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@

package org.botblock.javabotblockapi.core;

import org.botblock.javabotblockapi.core.annotations.DeprecatedSince;
import org.botblock.javabotblockapi.core.annotations.PlannedRemoval;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
Expand Down

0 comments on commit 75bf747

Please sign in to comment.