Thank you for your interest in contributing! All contributions are welcome: bug fixes, new method wrappers, documentation improvements, tests, and ideas.
Please take a few minutes to read this guide before opening a pull request or issue.
- Code of Conduct
- Ways to Contribute
- Development Setup
- Project Structure
- Coding Guidelines
- Submitting a Pull Request
- Commit Messages
- Reporting Bugs
- Requesting Features
- Security Issues
This project follows the Contributor Covenant Code of Conduct. By participating, you agree to uphold it. Please report unacceptable behaviour to ankitchaubey.dev@gmail.com.
The most impactful contribution is wrapping a method from the Telegram API schema that is currently only reachable via client.invoke::<R>(). Check the Unsupported Features table for ideas.
Each wrapper should:
- Live in the most appropriate module (
ferogram/src/lib.rs,participants.rs,media.rs, etc.) - Accept ergonomic Rust types as input (not raw TL structs where avoidable)
- Include a doc comment with a short example
Unit tests live alongside the source (#[cfg(test)] blocks). Integration tests that require a real Telegram connection are kept in ferogram-app/. If you add a new method, a matching test is appreciated.
- Fix typos, unclear wording, or outdated examples in any
.mdfile - Improve inline doc comments in the Rust source
- Add a new documentation page under
docs/src/
Use the issue templates:
Prerequisites:
- Rust stable (2024 edition or later): install via rustup
- Cargo
# Clone the repository
git clone https://github.com/ankit-chaubey/ferogram.git
cd ferogram
# Build the workspace
cargo build --workspace
# Run all tests
cargo test --workspace
# Build with all optional features
cargo build -p ferogram --all-features
# Check formatting
cargo fmt --all -- --check
# Run Clippy
cargo clippy --workspace --all-features -- -D warningsferogram/
├ ferogram-tl-parser/ .tl schema text -> AST
├ ferogram-tl-gen/ AST -> Rust source at build time
├ ferogram-tl-types/ All generated Telegram types
├ ferogram-crypto/ Low-level crypto primitives
├ ferogram-mtproto/ MTProto session and transport
├ ferogram/ High-level Client API <-- most contributions go here
│ └ src/
│ ├ lib.rs Core Client methods
│ ├ participants.rs Admin, ban, reactions, permissions
│ ├ media.rs Upload, download, albums
│ ├ search.rs SearchBuilder, GlobalSearchBuilder
│ ├ keyboard.rs Inline and reply keyboards
│ ├ typing_guard.rs TypingGuard RAII helpers
│ ├ inline_iter.rs InlineQueryIter, InlineResultIter
│ ├ session_backend.rs Session backends
│ ├ parsers.rs Markdown and HTML parsers
│ └ update.rs Update types and IncomingMessage
├ ferogram-connect/ Minimal DH demo
└ ferogram-app/ Interactive demo binary
- Rust edition 2024. Follow the Rust API guidelines.
- Async-first. Public methods that touch the network must be
async. - Error handling. Return
Result<_, InvocationError>. Do not panic in library code. - No unsafe. Unless absolutely required and well-justified.
- Formatting. Run
cargo fmtbefore committing. - Clippy. Fix all warnings before opening a PR.
- Doc comments. Every public item needs at least one sentence. Include a short
# Examplewhere helpful. - Naming. Follow Rust conventions:
snake_casefor functions,PascalCasefor types.
- Fork the repository and create a branch:
git checkout -b feat/my-feature - Make your changes. Keep each PR focused on one thing.
- Test. Run
cargo test --workspaceand make sure everything passes. - Format and lint. Run
cargo fmt --allandcargo clippy --workspace --all-features. - Open a PR against the
mainbranch using the pull request template. - Respond to review feedback. PRs are usually reviewed within a few days.
- Tests pass (
cargo test --workspace) - Code is formatted (
cargo fmt --all) - Clippy is clean (
cargo clippy --workspace --all-features) - Public items have doc comments
- CHANGELOG entry added under
[Unreleased]if this is a user-facing change
Use short, descriptive commit messages in the imperative mood:
Add iter_participants with filter support
Fix DownloadIter zero-padding on last chunk
Update docs: correct sqlite-session feature name
For larger changes:
feat(client): wrap setMyCommands for bot command registration
Adds `set_my_commands(commands, scope, lang_code)` to Client.
Wraps `bots::SetBotCommands` from Layer 224.
Closes #42
Use the bug report template. Please include:
- Your
ferogramversion - A minimal reproducer if possible
- The error message or unexpected behaviour
- Your OS and Rust version
Use the feature request template. Please describe the Telegram API method you want wrapped and the use case.
Do not open a public issue for security vulnerabilities. Please follow the process described in SECURITY.md.
Thank you for contributing!