https://linen.dev logo
cargo shuttle run issue
# help
b
Hello, i am going through building discord bot in rust(https://www.shuttle.rs/blog/2022/09/14/serentity-discord-bot) After creating Secrets.toml file and using cargo shuttle run i am receiving this error: error: could not compile
thiserror
due to 2 previous errors warning: build failed, waiting for other jobs to finish... error: aborting due to 2 previous errors For more information about this error, try
rustc --explain E0554
. error: could not compile
anyhow
due to 3 previous errors Error: 2 jobs failed
After googling have a guess that i need to use nightly but cant find any info in guide from shuttle about this
k
Hey! You shouldn't need to use nightly, but the blog post may be a bit out of date. Do you mind sharing your
Cargo.toml
?
b
[package] name = "crypto_bot" version = "0.1.0" edition = "2021" publish = false [lib] [dependencies] shuttle-service = { version = "0.7.2", features = ["bot-serenity"] } anyhow = "1.0.66" serenity = { version = "0.11.5", default-features = false, features = ["client", "gateway", "rustls_backend", "model"] } shuttle-secrets = "0.7.2" tracing = "0.1.37"
k
That looks correct, would you mind sharing the full error log? From
cargo shuttle run
to the end.
Also, what operating system are you on, and which version of rust (you can see this with
rustup show
or
rustc --version
)?
b
mac os, 1.65.0
k
Hmm, that's a strange one. Does
cargo clean
help?
I just cloned the source repo for the blog post, and that runs (ubuntu x86, 1.65 rust).
Also, does
cargo build
succeed?
b
Yes but now i have some other problems
yes
do i need to create Secrets.toml file as in the guide? cas i dont see it in repo
k
Yeah, it will hold your discord token, api key and guild id. These are secrets and shouldn't be commited to git, so they are .gitignored in the repo. We should add a note about that and maybe a
Secrets.toml.example
It should look like this:
Copy code
toml
DISCORD_TOKEN = "your token here"
WEATHER_API_KEY = "your api key"
GUILD_ID = "guild id"
What
GatewayIntents
did you pass to your client?
b
i am on a step with hello command
let intents = GatewayIntents::GUILD_MESSAGES | GatewayIntents::MESSAGE_CONTENT;
k
Did you follow these steps:
b
i havent ticked message content intent 💀 ...... Thank you very much for your help
no idea what was it?
k
No problem! I'm not quite sure what caused that first error, luckily it worked out 😄