Skip to content

Add check for discordlist.space tokens #252

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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