GithubHelp home page GithubHelp logo

ferrisgram / ferrisgram Goto Github PK

View Code? Open in Web Editor NEW
38.0 3.0 8.0 708 KB

Autogenerated wrapper for the Telegram Bot API written in Rust.

Home Page: https://crates.io/crates/ferrisgram

License: MIT License

Batchfile 0.02% Rust 99.96% Shell 0.02%
autogenerated bot-framework latest-version rust telegram telegram-bot-api

ferrisgram's Introduction

ferris


An Elegant Rust Client for Telegram Bot API
crates.io docs.rs

Table of contents

Introduction

FerrisGram is an asynchronous autogenerated wrapper for the Telegram Bot API written in Rust. This library provides all the methods and types that are available on the official Telegram Bot API.

Key Features

  • Latest API support: Provides support for latest version of Telegram Bot API
  • Easy to use: Heavily inspired by the python-telegram-bot, Ferrisgram is designed in such a way that even a beginner can make a bot with it easily.
  • Asynchronous: Ferrisgram is powered by rust's built-in await async syntax.
  • Typo Free Docs: Autogenerated documentations of the native Bot API types and methods make it typo free.
  • Filters: Ferrisgram provides filters to make it easy for you to sort different type of updates in a managed way.

Installation

You can install ferrisgram by adding the following to dependencies section of Cargo.toml:

[dependencies]
ferrisgram = "0.2.0"

Getting Started

You can checkout our sample bots in the examples directory.

Documentation

Documentations can be found at docs.rs.

Index

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update examples as appropriate.

License

MIT
Licensed Under The MIT License

ferrisgram's People

Contributors

celestix avatar 7flash avatar dependabot[bot] avatar

Stargazers

Silent Demon SD ( MysterySD ) avatar Whitehole avatar Sokos Lee avatar ROSHAN G avatar Vitaliy Grusha avatar Lulzx avatar Denis Kadyshev avatar Phosphorus Moscu avatar Anand P S avatar ÁÑÑÍHÌLÅTØR SPÄRK avatar  avatar GrimAnEye avatar  avatar XdZhao avatar Andrey Gulitsky avatar Bhavik Talaviya  avatar ALi.w avatar  avatar 0hn0itsme avatar  avatar jon4hz avatar Akshett Rai Jindal avatar Hank Blaze avatar Jãїиãм avatar Pranav Saraswat avatar Gaurav avatar Nisarga Adhikary avatar wrench avatar UserLazy avatar mangesh avatar Soheyb Samadi avatar  avatar ZERO • アクバル . avatar Pranav Ajay avatar Shivang Kakkar avatar INDRAJEETH avatar Akash Pattnaik avatar Sayan Biswas avatar

Watchers

Sayan Biswas avatar  avatar Jãїиãм avatar

ferrisgram's Issues

[BUG] thread 'main' has overflowed its stack

Steps to Reproduce

  1. Git clone and run the example echobot or run it: https://github.com/annihilatorrrr/RustRoBot

Expected behaviour

It should run

Actual behaviour

C:/Users/WORKER/.cargo/bin/cargo.exe run --package rustrobot --bin rustrobot --color=never
Finished dev [unoptimized + debuginfo] target(s) in 0.98s
Running target\debug\rustrobot.exe

thread 'main' has overflowed its stack
error: process didn't exit successfully: target\debug\rustrobot.exe (exit code: 0xc00000fd, STATUS_STACK_OVERFLOW)

Process finished with exit code -1073741571 (0xC00000FD)

Operating System

Windows 8.1

Version of Rust, Ferrisgram & dependencies

All latest.
Rust: 1.77.1
x86_64-pc-windows-gnu

Relevant log output

No response

Additional Context

Uing rustrover.

[Enhancement]⚙️ Rewrite generator module

What kind of feature are you missing? Where do you notice a shortcoming of Ferrisgram?

Generator's code are too untidy, needs some cleansing

Describe the solution you'd like

Use templates in generator

Describe alternatives you've considered

No response

Additional context

No response

[FEATURE] Make InputFile an enum

What kind of feature are you missing? Where do you notice a shortcoming of Ferrisgram?

Currently, the only supported InputFile type is String.

Describe the solution you'd like

InputFile be an enum of String, File buffer etc.

Describe alternatives you've considered

No response

Additional context

No response

[BUG]🐛 Build error due to invalid type instantiation in generated helper functions.

Steps to Reproduce

  1. cargo generate
  2. cargo build

Expected behaviour

It should compile successfully but it throws an error because sticker field of InputSticker is a String generated helper tries to write a new instance of InputFile to it.

Actual behaviour

Operating System

OS Independent Issue

Version of Rust, Ferrisgram & dependencies

rustc v1.72.0
ferrisgram dev-working (unreleased)

Relevant log output

error[E0308]: mismatched types
  --> src/helpers/input_sticker.rs:11:22
   |
11 |             sticker: InputFile::new(),
   |                      ^^^^^^^^^^^^^^^^ expected `String`, found `InputFile`

Additional Context

No response

[FEATURE]🆕 Add `ConversationHandler`

What kind of feature are you missing? Where do you notice a shortcoming of Ferrisgram?

ConversationHandler

Describe the solution you'd like

Implement a state machine for the conversation flow.

Describe alternatives you've considered

No response

Additional context

No response

[FEATURE]🆕 implement PartialEq for filters

What kind of feature are you missing? Where do you notice a shortcoming of Ferrisgram?

.

Describe the solution you'd like

.

Describe alternatives you've considered

No response

Additional context

No response

[BUG]🐛 send photo by URL throws an error.

Steps to Reproduce

the same as README example, but send_photo

Expected behaviour

sendPhoto API method should support both InputFile and String, as per documentation

Uploading image.png…

Actual behaviour

but it throws an error because auto generated type expects InputFile only

Operating System

Windows

Version of Rust, Ferrisgram & dependencies

latest

Relevant log output

No response

Additional Context

image

[BUG]🐛 expected struct `InputMediaAudio`, found struct `InputMediaPhoto`

Steps to Reproduce

Default example but send_media_group instead of copy_message

Expected behaviour

sendMediaGroup should allow to send pictures as well

Actual behaviour

but compiler throws an error because type expecting audios only

Operating System

send_media_group InputMediaPhoto

Version of Rust, Ferrisgram & dependencies

Compiling elevenone v0.1.0 (C:\Users\igorb\Documents\eleven\elevenone)   
error[E0308]: mismatched types
  --> src\main.rs:78:35
   |
78 |     bot.send_media_group(chat.id, pics);
   |         ----------------          ^^^^ expected struct `ferrisgram::types::InputMediaAudio`, found struct `ferrisgram::types::InputMediaPhoto`     
   |         |
   |         arguments to this function are incorrect
   |
   = note: expected struct `Vec<ferrisgram::types::InputMediaAudio>`        
              found struct `Vec<ferrisgram::types::InputMediaPhoto>`        
note: associated function defined here
  --> C:\Users\igorb\.cargo\registry\src\github.com-1ecc6299db9ec823\ferrisgram-0.1.5\src\methods\send_media_group.rs:15:12
   |
15 |     pub fn send_media_group(
   |            ^^^^^^^^^^^^^^^^

Relevant log output

No response

Additional Context

image

image

image

[FEATURE]🆕 Add support for webhook server

What kind of feature are you missing? Where do you notice a shortcoming of Ferrisgram?

Library is still missing the support for webhook server, long polling being the only option ATM isn't very efficient way.

Describe the solution you'd like

Add support for webhook server

Describe alternatives you've considered

No response

Additional context

No response

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.