Skip to content
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

Got Err Decode("Expected string", Null) when trying to call connect() #169

Open
JavaDerg opened this issue Mar 30, 2021 · 0 comments
Open

Comments

@JavaDerg
Copy link

When I try to run this code I get this error:
thread 'main' panicked at 'called Result::unwrap()on anErr value: Decode("Expected string", Null)', src/main.rs:3:34

fn main() {
    let dc = discord::Discord::from_user_token(&std::env::var("DC_TOKEN").expect("Set env var DC_TOKEN to discord user token")).unwrap();
    let (con, re) = dc.connect().unwrap();
    for rel in &re.relationships {
        println!("{} > {}", rel.user.name, rel.id.0);
    }
}

(I'm using the git version)
Not sure what's wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant