re: DEV ❤️ Telegram VIEW POST


Awesome and nice bot as well as an informative article! :)

I've noticed one thing: doesn't
url = sprintf API_URL, "/articles", query
API_URL = "https://dev.to/api/%s?%s"
result in
with a double slash before articles?
This could lead to malfunction/failure as it seems unintentionally to me.


Good catch, like I said the code still needs some cleaning up. It works ok, but is indeed unintentional.


I'd actually recommend against using sprintf and just use string interpolation instead, though in this case since you're dealing with a URL File.join might actually be the better way to go.

This was built in about 4-5h while learning the Telegram bot API on the side. There are a few more things I’ll eventually clean up, especially when adding more commands.

Code of Conduct Report abuse