This repository has been archived by the owner on Nov 8, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #41 from teloxide/improve_docs
Improve docs
- Loading branch information
Showing
29 changed files
with
2,853 additions
and
116 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(()) | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.