From c82c57f0b177fcf22d4d16a4b3bccf8b12952c50 Mon Sep 17 00:00:00 2001 From: Hirrolot Date: Sun, 21 Jul 2024 09:25:27 +0500 Subject: [PATCH] Fix compilation --- crates/teloxide-core/src/bot/api.rs | 3 ++- crates/teloxide-core/src/local_macros.rs | 5 +++-- crates/teloxide-core/src/requests/requester.rs | 3 ++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/crates/teloxide-core/src/bot/api.rs b/crates/teloxide-core/src/bot/api.rs index 1eea1f74..380d41a4 100644 --- a/crates/teloxide-core/src/bot/api.rs +++ b/crates/teloxide-core/src/bot/api.rs @@ -1383,8 +1383,9 @@ impl Requester for Bot { type SendGame = JsonRequest; - fn send_game(&self, chat_id: ChatId, game_short_name: G) -> Self::SendGame + fn send_game(&self, chat_id: C, game_short_name: G) -> Self::SendGame where + C: Into, G: Into, { Self::SendGame::new(self.clone(), payloads::SendGame::new(chat_id, game_short_name)) diff --git a/crates/teloxide-core/src/local_macros.rs b/crates/teloxide-core/src/local_macros.rs index aa285426..a17441dc 100644 --- a/crates/teloxide-core/src/local_macros.rs +++ b/crates/teloxide-core/src/local_macros.rs @@ -1406,9 +1406,10 @@ macro_rules! requester_forward { (@method send_game $body:ident $ty:ident) => { type SendGame = $ty![SendGame]; - fn send_game(&self, chat_id: ChatId, game_short_name: G) -> Self::SendGame where G: Into { + fn send_game(&self, chat_id: C, game_short_name: G) -> Self::SendGame where C: Into, + G: Into { let this = self; - $body!(send_game this (chat_id: ChatId, game_short_name: G)) + $body!(send_game this (chat_id: C, game_short_name: G)) } }; (@method set_game_score $body:ident $ty:ident) => { diff --git a/crates/teloxide-core/src/requests/requester.rs b/crates/teloxide-core/src/requests/requester.rs index 0428d50b..06548ef3 100644 --- a/crates/teloxide-core/src/requests/requester.rs +++ b/crates/teloxide-core/src/requests/requester.rs @@ -1189,8 +1189,9 @@ pub trait Requester { type SendGame: Request; /// For Telegram documentation see [`SendGame`]. - fn send_game(&self, chat_id: ChatId, game_short_name: G) -> Self::SendGame + fn send_game(&self, chat_id: C, game_short_name: G) -> Self::SendGame where + C: Into, G: Into; type SetGameScore: Request;