#new to using this library and having issues initializing the project
1 messages · Page 1 of 1 (latest)
What happens when you run the exe directly? (without cargo run)
The exe might not inherit all variables
Also make sure that your IDE is not messing things up (your screenshot uses two different fonts, from the looks of it IntelliJ)
It should not matter if invoked normally, i.e. PS> $Env:DISCORD_TOKEN=<TOKEN>; cargo run
Running main through the IDE likely spawns a fresh PWSH instance without non-persistent variables
Yes, thats correct
There is, but your discord token is sensitive and should not be exposed. Setting the variable in the IDE is probably the best, as it's persistent but scoped https://www.jetbrains.com/help/rust/cargo-run-debug-configuration.html
There's a field "Environment variables" where you can enter your token
I don't use RustRover, however. I just run cargo run from the terminal (and setup envvars manually)
I think so
Nice
wooo
I’m using CLion. There’s a menu to set env vars directly in the IDE. I’ll send a vid in a few