mirror of
https://github.com/teloxide/teloxide.git
synced 2025-03-26 00:17:08 +01:00
Add docs for method_url
and file_url
This commit is contained in:
parent
d72dae122d
commit
3e0e3ae4b4
1 changed files with 2 additions and 0 deletions
|
@ -9,6 +9,7 @@ use super::requests::Request;
|
||||||
|
|
||||||
const TELEGRAM_API_URL: &str = "https://api.telegram.org";
|
const TELEGRAM_API_URL: &str = "https://api.telegram.org";
|
||||||
|
|
||||||
|
/// Create url for macking requests, see [telegram docs](https://core.telegram.org/bots/api#making-requests)
|
||||||
fn method_url(base: &str, token: &str, method_name: &str) -> String {
|
fn method_url(base: &str, token: &str, method_name: &str) -> String {
|
||||||
format!(
|
format!(
|
||||||
"{url}/bot{token}/{method}",
|
"{url}/bot{token}/{method}",
|
||||||
|
@ -18,6 +19,7 @@ fn method_url(base: &str, token: &str, method_name: &str) -> String {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Create url for downloading file, see [telegram docs](https://core.telegram.org/bots/api#file)
|
||||||
fn file_url(base: &str, token: &str, file_path: &str) -> String {
|
fn file_url(base: &str, token: &str, file_path: &str) -> String {
|
||||||
format!(
|
format!(
|
||||||
"{url}/file/bot{token}/{file}",
|
"{url}/file/bot{token}/{file}",
|
||||||
|
|
Loading…
Add table
Reference in a new issue