Giter Club home page Giter Club logo

tdlib-rs's People

Contributors

aleks-demin avatar alissonlauffer avatar melix99 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

tdlib-rs's Issues

How to load/save session?

Hi @melix99,

After successful authorization, I need to save the current session for the next login without entering a phone number.
Could you please show an example?

Thanks!

Remove "Ok" enum and replace its usage with "()"

In tdlib-rs we currently have something like Result<enums::Ok, types::Error> as the return value of some functions. The "Ok" enum is just a state indicating a non-error by tdlib, but this is useless in Rust because we already have a Result, so we already know if we have an error or not. We should remove that enum and swap it's use with just a "()", like it's usually done in Rust in this cases.

Document enums

Currently this is the missing piece for having a 100% documented library. To do that we need to parse the "@Class" tag in the .tl file first.

The error "missing field `reply_in_chat_id`"

Hi!

I was trying to use tdlib to do some simple tasks. For example, get latest 20 messages from each group.

I added the following code to example/get_me.rs just after line println!("Hi, I'm {}", me.first_name); :

let chats = functions::get_chats(None, 100, client_id).await.unwrap();
if let tdlib::enums::Chats::Chats(chats) = chats {
    for chat_id in chats.chat_ids {
        dbg!(chat_id);
        if let Ok(info) = functions::get_chat_history(chat_id, 0, 0, 20, false, client_id).await
        {
            dbg!(info);
        }
    }
}

Then I got an error "missing field reply_in_chat_id", wonder if the code above is the correct way to use tdlib-rs API?

Thanks!

Remove 1-variant enums

We currently have quite a lot of 1-variant only enums. This is because of the tdlib's tl scheme, so it's not a parser bug. We have to workaround that by checking when there are this kind of enums and remove/replace them somehow.

Getting an error when trying to include this lib in my project

Γ¥» cargo build
   Compiling native-tls v0.2.11
   Compiling sqlx-mysql v0.7.2
   Compiling crypto-hash v0.3.4
   Compiling tdlib v0.10.0
   Compiling chromiumoxide v0.5.4
error: failed to run custom build command for `tdlib v0.10.0`

Caused by:
  process didn't exit successfully: `/home/mxaddict/projects/deep/rusty-data/target/debug/build/tdlib-70396f3ece8ac5da/build-script-build` (exit status: 101)
  --- stdout
  cargo:rerun-if-env-changed=TDJSON_NO_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR

  --- stderr
  thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: PkgConfig(`PKG_CONFIG_ALLOW_SYSTEM_CFLAGS="1" "pkg-config" "--libs" "--cflags" "tdjson" "tdjson >= 1.8.19"` did not exit successfully: exit status: 1
  error: could not find system library 'tdjson' required by the 'tdlib' crate

  --- stderr
  Package tdjson was not found in the pkg-config search path.
  Perhaps you should add the directory containing `tdjson.pc'
  to the PKG_CONFIG_PATH environment variable
  No package 'tdjson' found
  Package tdjson was not found in the pkg-config search path.
  Perhaps you should add the directory containing `tdjson.pc'
  to the PKG_CONFIG_PATH environment variable
  No package 'tdjson' found
  )', /home/mxaddict/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tdlib-0.10.0/build.rs:39:40
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...

Is there a package that I need to install to be able to compile the tdlib dependency?

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.