Environmental variable

Posted by enderknight7op in discord-bots.

I set up an environmental variable from the environment/page tab with key and value, it created an .env file with DISCORD TOKEN=my bot token here, but it still said token not found while my code says public static void main(String[] args) throws InterruptedException { String token = System.getenv("DISCORD TOKEN"); if (token == null token.isBlank()) { throw new IllegalStateException("DISCORD TOKEN environment variable is not set"); } and it worked on my pc

Replies

vynqis

did you save it?

Wispbyte Community Forum