Fix compilation

This commit is contained in:
Hirrolot 2024-07-21 09:25:27 +05:00
parent a80a1215b2
commit c82c57f0b1
No known key found for this signature in database
GPG key ID: F0C33B48BD883C81
3 changed files with 7 additions and 4 deletions

View file

@ -1383,8 +1383,9 @@ impl Requester for Bot {
type SendGame = JsonRequest<payloads::SendGame>;
fn send_game<G>(&self, chat_id: ChatId, game_short_name: G) -> Self::SendGame
fn send_game<C, G>(&self, chat_id: C, game_short_name: G) -> Self::SendGame
where
C: Into<ChatId>,
G: Into<String>,
{
Self::SendGame::new(self.clone(), payloads::SendGame::new(chat_id, game_short_name))

View file

@ -1406,9 +1406,10 @@ macro_rules! requester_forward {
(@method send_game $body:ident $ty:ident) => {
type SendGame = $ty![SendGame];
fn send_game<G>(&self, chat_id: ChatId, game_short_name: G) -> Self::SendGame where G: Into<String> {
fn send_game<C, G>(&self, chat_id: C, game_short_name: G) -> Self::SendGame where C: Into<ChatId>,
G: Into<String> {
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) => {

View file

@ -1189,8 +1189,9 @@ pub trait Requester {
type SendGame: Request<Payload = SendGame, Err = Self::Err>;
/// For Telegram documentation see [`SendGame`].
fn send_game<G>(&self, chat_id: ChatId, game_short_name: G) -> Self::SendGame
fn send_game<C, G>(&self, chat_id: C, game_short_name: G) -> Self::SendGame
where
C: Into<ChatId>,
G: Into<String>;
type SetGameScore: Request<Payload = SetGameScore, Err = Self::Err>;