From 1f1a3abd6bd3fc6cee4562e6a9e61c63da158f8f Mon Sep 17 00:00:00 2001 From: dracarys18 Date: Sat, 3 Jul 2021 17:31:57 +0530 Subject: [PATCH] utils: Change the user_id type to i64 user_id is of type i64 in User struct (https://github.com/teloxide/teloxide-core/blob/bd104a0a08568810b5850978419dd9c8f6a4b9b5/src/types/user.rs#L10) Signed-off-by: dracarys18 --- CHANGELOG.md | 1 + src/utils/html.rs | 2 +- src/utils/markdown.rs | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d4f575c6..2303557b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -40,6 +40,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `Noop` and `AsyncStopToken`stop tokens. - `StatefulListener`. - Emit not only errors but also warnings and general information from teloxide, when set up by `enable_logging!`. + - `user_id` should be passed as i64 in `html::user_mention` and `markdown::user_mention`. ### Fixed diff --git a/src/utils/html.rs b/src/utils/html.rs index cf22acc4..dc26a299 100644 --- a/src/utils/html.rs +++ b/src/utils/html.rs @@ -44,7 +44,7 @@ pub fn link(url: &str, text: &str) -> String { } /// Builds an inline user mention link with an anchor. -pub fn user_mention(user_id: i32, text: &str) -> String { +pub fn user_mention(user_id: i64, text: &str) -> String { link(format!("tg://user?id={}", user_id).as_str(), text) } diff --git a/src/utils/markdown.rs b/src/utils/markdown.rs index f96fafaa..d778aee2 100644 --- a/src/utils/markdown.rs +++ b/src/utils/markdown.rs @@ -59,7 +59,7 @@ pub fn link(url: &str, text: &str) -> String { } /// Builds an inline user mention link with an anchor. -pub fn user_mention(user_id: i32, text: &str) -> String { +pub fn user_mention(user_id: i64, text: &str) -> String { link(format!("tg://user?id={}", user_id).as_str(), text) }