Giter Site home page Giter Site logo

telegram_bots_api's Introduction

Telegram

Static Badge codecov crates.io Static Badge docs.rs FOSSA Status

https://github.com/khusnetdinov/telegram_bots_api/actions/workflows/codecov_report/badge.svg https://github.com/khusnetdinov/telegram_bots_api/actions/workflows/lints/badge.svg https://github.com/khusnetdinov/telegram_bots_api/actions/workflows/msrv/badge.svg https://github.com/khusnetdinov/telegram_bots_api/actions/workflows/features/badge.svg https://github.com/khusnetdinov/telegram_bots_api/actions/workflows/tests/badge.svg https://github.com/khusnetdinov/telegram_bots_api/actions/workflows/rolling/badge.svg

Telegram bots api simple rust wrapper, and no more.

Features

  • async: asynchronous execution api calls
  • sync: synchronous execution api calls

Installation

Run cargo add telegram_bots_api, or add lines to Cargo.toml:

[dependencies]
telegram_bots_api = "0.73.2"
rust-version = "1.70.0"

Configuration


USAGE:
    sync-playground [FLAGS] [OPTIONS] --token <token>

FLAGS:
    -d, --debug         Environment: Debug mode
    -h, --help          Prints help information
    -p, --production    Environment: Is production
    -V, --version       Prints version information

OPTIONS:
        --connect-timeout <connect-timeout>    Client: Connect timeout in secs. Set a timeout for only the connect phase
                                               [default: 5]
        --timeout <timeout>                    Client: Timeout in secs. The timeout is applied from when the request
                                               starts connecting until the response body has finished [default: 5]
        --token <token>                        Telegram: Token
        --updates-limit <updates-limit>        Updates: Limits the number of updates to be retrieved [default: 100]
        --updates-offset <updates-offset>      Updates: Identifier of the first update to be returned [default: 0]
        --updates-timeout <updates-timeout>    Updates: Timeout in seconds for long polling [default: 0]
        --url <url>                            Telegram: Api url [default: https://api.telegram.org]

How to use

Only one required flag is token, example run:

$ cargo run -- --token 0000000000:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

File structure:

.
├── Cargo.lock                                        # Lock file
├── Cargo.toml                                        # Toml file
├── LICENSE                                           # LICENSE
├── README.md                                         # README
├── /examples                                         # Examples
│   ├── /async
│   │   ├── get_me.rs
│   │   └── playground.rs
│   └── /sync
│       ├── get_me.rs
│       └── playground.rs
├── postman.json                                      # Postman collection
└── /src                                              # Source code
    ├── /api                                          # Api structs definitions
    │   ├── /enums                                    # Enums
    │   │   ├── bot_command_scope.rs
    │   │   ...
    │   │   └── reply_markup.rs
    │   ├── enums.rs
    │   ├── mod.rs
    │   ├── /params                                   # Params structs for payload
    │   │   ├── add_sticker_to_set.rs
    │   │   ...
    │   │   └── upload_sticker_file.rs
    │   ├── params.rs
    │   ├── /requests                                 # Request traits
    │   │   ├── async.rs
    │   │   └── sync.rs
    │   ├── requests.rs
    │   ├── /responses                                # Telegram responses structs definitions
    │   │   ├── error.rs
    │   │   ├── parameters.rs
    │   │   └── result.rs
    │   ├── responses.rs
    │   ├── /types                                    # Telegram types 
    │   │   ├── animation.rs
    │   │   ...
    │   │   └── write_access_allowed.rs
    │   └── types.rs
    ├── /clients                                      # Clients definitions
    │   ├── async.rs
    │   ├── mod.rs
    │   └── sync.rs
    ├── config.rs                                     # Config definition
    ├── errors.rs                                     # Errors definition
    ├── lib.rs
    └── /tests
        ├── /clients                                  # Cleints
        │   ├── async.rs                              # Async client tests
        │   ├── mod.rs
        │   └── sync.rs                               # Sync client tests
        ├── config.rs                                 # Config tests
        ├── errors.rs                                 # Errors tests
        ├── /helpers                                  # Helpers for tests
        │   ├── mocked_async.rs
        │   ├── mocked_sync.rs
        │   └── mod.rs
        ├── mod.rs
        └── responses                                 # Example of json responses
            ├── add_sticker_to_set_error.json
            ...
            └── upload_sticker_file_success.json

telegram_bots_api's People

Contributors

khusnetdinov avatar jonhoo avatar dependabot[bot] avatar 0x61nas avatar wasabi375 avatar jmchacon avatar joshka avatar mathiaspius avatar chapeupreto avatar simenb avatar tudyx avatar rtkay123 avatar

Watchers

 avatar  avatar

Forkers

fossabot

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.