Skip to content
This repository has been archived by the owner on Nov 8, 2022. It is now read-only.

Commit

Permalink
Merge pull request #41 from teloxide/improve_docs
Browse files Browse the repository at this point in the history
Improve docs
  • Loading branch information
hirrolot authored Jan 21, 2021
2 parents 9bb3d36 + 3aec4e5 commit 8e011b7
Show file tree
Hide file tree
Showing 29 changed files with 2,853 additions and 116 deletions.
4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,7 @@ full = ["throttle", "cache_me", "auto_send"]
[package.metadata."docs.rs"]
all-features = true
rustdoc-args = ["--cfg", "docsrs", "-Znormalize-docs"]

[[example]]
name = "self_info"
required-features = ["tokio/macros", "tokio/rt-multi-thread", "auto_send"]
25 changes: 24 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,30 @@
<div align="center">
<img src="media/logo.svg" width="250"/>
</div>

# teloxide-core

[![CI status](https://github.com/teloxide/teloxide-core/workflows/Continuous%20integration/badge.svg)](https://github.com/teloxide/teloxide-core/actions)
[![documentation](https://docs.rs/teloxide_core/badge.svg)](https://docs.rs/teloxide_core/)
[![documentation (master)](https://img.shields.io/badge/docs-master-blue)](https://teloxide-core.netlify.com)
[![LICENSE](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
[![Api Cov](https://img.shields.io/badge/API%20coverage-Up%20to%200.4.9%20(inclusively)-green.svg)](https://core.telegram.org/bots/api)
[![crates.io](https://img.shields.io/crates/v/teloxide_core.svg)](https://crates.io/crates/teloxide_core)
[![Official Chat](https://img.shields.io/badge/official%20chat-t.me%2Fteloxide-blueviolet)](https://t.me/teloxide)



Core part of the [`teloxide`] library.

This library provides tools for making requests to the [Telegram Bot API]
(Currently, version `4.9` is supported) with ease. The library is fully
asynchronouns and built using [`tokio`].

```toml
teloxide_core = "0.1"
```
_Compiler support: requires rustc 1.49+_

Core part of `teloxide` library.
[`teloxide`]: https://docs.rs/teloxide
[Telegram Bot API]: https://core.telegram.org/bots/api
[`tokio`]: https://tokio.rs
23 changes: 23 additions & 0 deletions examples/self_info.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
use teloxide_core::{
prelude::*,
types::{DiceEmoji, ParseMode},
};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let chat_id = std::env::var("CHAT_ID")
.expect("Expected CHAT_ID env var")
.parse::<i64>()?;

let bot = Bot::from_env()
.parse_mode(ParseMode::MarkdownV2)
.auto_send();

let me = bot.get_me().await?;

bot.send_dice(chat_id, DiceEmoji::Dice).await?;
bot.send_message(chat_id, format!("Hi, my name is **{}** 👋", me.first_name))
.await?;

Ok(())
}
Binary file added media/example.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 8e011b7

Please sign in to comment.