Implemented a way to check if the discord token is given

Signed-off-by: Louis Vallat <louis@louis-vallat.xyz>
This commit is contained in:
Louis Vallat 2020-10-25 17:11:09 +01:00
parent e2f9ca8b8d
commit 70a075660b

View File

@ -5,8 +5,14 @@ import org.slf4j.LoggerFactory;
public class MovieQuoteBot {
private static final Logger logger = LoggerFactory.getLogger(MovieQuoteBot.class.getCanonicalName());
public static final String DISCORD_TOKEN_ENVIRONMENT = "DISCORD_TOKEN";
public static void main(String[] args) {
Logger logger = LoggerFactory.getLogger(MovieQuoteBot.class.getCanonicalName());
if (System.getenv(DISCORD_TOKEN_ENVIRONMENT) == null && args.length == 0) {
logger.error("Missing token. Exiting.");
System.exit(1);
}
logger.debug("Hello World!");
}