SpaceManiac / discord-rs

Rust library for the Discord chat client API
MIT License
385 stars 94 forks source link

there is a token altough it throws 'Expected token: NotPresent' error. #175

Closed imsuckatcsharp closed 1 year ago

imsuckatcsharp commented 1 year ago

I just copied the code from examples and settled up everything but it throws 'Expected token: NotPresent'. I tried ".unwrap()" to locate the issue but its the same issue. What I done wrong?

SpaceManiac commented 1 year ago

The examples contain env::var("DISCORD_TOKEN").expect("Expected token").

In other words, they look for the DISCORD_TOKEN environment variable and use that.

If you want to retrieve the token from some other location, such as a file, modify the example.

itschip commented 1 year ago

You can run export DISCORD_TOKEN=token if you'd like.