https://linen.dev logo
Having problem following discord bot tutorial
# help
h
Hi guys, I am trying to learn rust with different projects and wanted to start by creating a discord bot. I follow this guide here https://www.shuttle.rs/blog/2022/09/14/serentity-discord-bot but it seems outdated. When doing:
cargo shuttle init --serenity
The output lib.rs is not the same as the article. I had to modify some of the imports and a variable to make it compile. When trying to run locally I have this error:
Copy code
Starting discord-bot-shuttle on http://127.0.0.1:8000
Error: Custom error:
q
they just did a big update, all the documents and tutes might not be up-to-date
what error are you getting
im currently working on a bot hosted on shuttle rn, so i can perhaps try to help
h
I wrote it in my questin
Here, Starting discord-bot-shuttle on http://127.0.0.1:8000 Error: Custom error:
q
is there anything below "custom error"
h
No 😦
q
can i see your cargo.toml file
copy/paste it here or if you checked it in
h
[package] name = "discord-bot-shuttle" version = "0.1.0" edition = "2021" [lib] [dependencies] shuttle-service = { version = "0.6.0", features = ["bot-serenity"] } anyhow = "1.0.65" serenity = { version = "0.11.5", default-features = false, features = ["client", "gateway", "rustls_backend", "model"] } shuttle-secrets = "0.6.0" tracing = "0.1.37"
q
and you get this error from
cargo shuttle run
?
h
Yes
q
maybe try
cargo clean
then another run
h
Ok that did something, I have a new error now.
q
which is waht
h
Well nevermind... I did cargo clean again anw still having the same custom error
k
Hey @hallowed-vegetable-14929, the blog post is indeed outdated, sorry about the confusion. It should be updated on monday, in the meantime it's updated here: . And the repo is updated here: . We are having some issues deploying certain projects after the
0.6.0
update, including this one. We aim to fix this early next week, in the mean time you should be able to test it out with
cargo shuttle run
.
h
Thanks a lot for the answer. I will try it.
I updated my cargo.toml and the lib.rs from the PR you linked and I am getting the same error:
Copy code
Starting discord-bot-shuttle on http://127.0.0.1:8000
Error: Custom error:
PS C:\Users\beaur\DevProjects\discord-bot-shuttle>
k
Yeah this project doesn't deploy currently, even if the code is updated. Sorry if that was unclear. We aim to fix it early this week.
You should be able to run it locally though with cargo shuttle run
h
No this is my problem I can not deploy locally
k
I see you are on windows, so there are some other issues as well: . There are some workarounds in this thread though
This might fix local run:
h
It did not fix my problem, but I am in no rush, I will wait the future patch.