GithubHelp home page GithubHelp logo

ksbd-bot's Introduction

KSBD bot

What

There's an awesome graphic novel https://killsixbilliondemons.com/. Am really into it and I want to be notified when a new episodes are posted.

This project is a Telegram-bot covering that requirement. Also, it provides a simple navigation across the entire novel.

The bot is deployed to my Raspberry PI.

Why

This is my first attempt to write code in Rust. The idea was to make it work as soon as possible and then improve the code along with a learning process.

And let's be honest, this code is still ugly AF :)

I'm still a bit frustrated with some ideas in language and/or libraries.

Questions and topics to my future self to cover along the way I learn Rust:

  • Traits. Make yourself familiar with them and how they allow you to write polymorphic code.

  • Unit tests. Just write them.

  • Passing callback functions. How? That would be the easiest way to inject dependencies. And will make a code really testable. Haven't found an easy way to do that.

  • For instance, teloxide's way to make so-called "dependency injection" using that dptree lib makes me almost cry! If you'd not provide needed dependencies, those branches will fail in RUN time. How about make'em fail in COMPILE time? Nope. Sounds like a return to a "good-'ol" prehistoric Spring-times. Instead, I'll be more than happy to just pass'em along as a function params... you know, the one and only RIGHT way to inject dependency. Is there a way to do that?

let command_handler = teloxide::filter_command::<Command, _ > ()
.branch(case![Command::Start].endpoint(start))
.branch(case![Command::Help].endpoint(help))
...
  • Cross-compilation to Raspberry... oh boy. Special kind of nightmare. I just used https://github.com/cross-rs/cross to make it happen. However, the topic is still open -- is there a way to leverage ALL the horsepower of my M1 instead of half-assed solution using docker mumbo-jumbo?

ksbd-bot's People

Contributors

brzzbr avatar

Stargazers

Pavel Lavreshin avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.