mirror of
https://github.com/teloxide/teloxide.git
synced 2025-03-22 06:45:37 +01:00
let send_message use ChatId
This commit is contained in:
parent
c6c0378077
commit
703c65c0c2
5 changed files with 7 additions and 7 deletions
|
@ -4031,7 +4031,7 @@ Schema(
|
||||||
params: [
|
params: [
|
||||||
Param(
|
Param(
|
||||||
name: "chat_id",
|
name: "chat_id",
|
||||||
ty: i64,
|
ty: RawTy("ChatId"),
|
||||||
descr: Doc(md: "Unique identifier for the target chat"),
|
descr: Doc(md: "Unique identifier for the target chat"),
|
||||||
),
|
),
|
||||||
Param(
|
Param(
|
||||||
|
|
|
@ -1264,7 +1264,7 @@ impl Requester for Bot {
|
||||||
|
|
||||||
type SendGame = JsonRequest<payloads::SendGame>;
|
type SendGame = JsonRequest<payloads::SendGame>;
|
||||||
|
|
||||||
fn send_game<G>(&self, chat_id: i64, game_short_name: G) -> Self::SendGame
|
fn send_game<G>(&self, chat_id: ChatId, game_short_name: G) -> Self::SendGame
|
||||||
where
|
where
|
||||||
G: Into<String>,
|
G: Into<String>,
|
||||||
{
|
{
|
||||||
|
|
|
@ -1301,9 +1301,9 @@ macro_rules! requester_forward {
|
||||||
(@method send_game $body:ident $ty:ident) => {
|
(@method send_game $body:ident $ty:ident) => {
|
||||||
type SendGame = $ty![SendGame];
|
type SendGame = $ty![SendGame];
|
||||||
|
|
||||||
fn send_game<G>(&self, chat_id: i64, game_short_name: G) -> Self::SendGame where G: Into<String> {
|
fn send_game<G>(&self, chat_id: ChatId, game_short_name: G) -> Self::SendGame where G: Into<String> {
|
||||||
let this = self;
|
let this = self;
|
||||||
$body!(send_game this (chat_id: i64, game_short_name: G))
|
$body!(send_game this (chat_id: ChatId, game_short_name: G))
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
(@method set_game_score $body:ident $ty:ident) => {
|
(@method set_game_score $body:ident $ty:ident) => {
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
|
|
||||||
use crate::types::{Message, MessageId, ReplyMarkup, ThreadId};
|
use crate::types::{ChatId, Message, MessageId, ReplyMarkup, ThreadId};
|
||||||
|
|
||||||
impl_payload! {
|
impl_payload! {
|
||||||
/// Use this method to send a game. On success, the sent [`Message`] is returned.
|
/// Use this method to send a game. On success, the sent [`Message`] is returned.
|
||||||
|
@ -12,7 +12,7 @@ impl_payload! {
|
||||||
pub SendGame (SendGameSetters) => Message {
|
pub SendGame (SendGameSetters) => Message {
|
||||||
required {
|
required {
|
||||||
/// Unique identifier for the target chat
|
/// Unique identifier for the target chat
|
||||||
pub chat_id: i64,
|
pub chat_id: ChatId [into],
|
||||||
/// Short name of the game, serves as the unique identifier for the game. Set up your games via Botfather.
|
/// Short name of the game, serves as the unique identifier for the game. Set up your games via Botfather.
|
||||||
pub game_short_name: String [into],
|
pub game_short_name: String [into],
|
||||||
}
|
}
|
||||||
|
|
|
@ -1093,7 +1093,7 @@ pub trait Requester {
|
||||||
type SendGame: Request<Payload = SendGame, Err = Self::Err>;
|
type SendGame: Request<Payload = SendGame, Err = Self::Err>;
|
||||||
|
|
||||||
/// For Telegram documentation see [`SendGame`].
|
/// For Telegram documentation see [`SendGame`].
|
||||||
fn send_game<G>(&self, chat_id: i64, game_short_name: G) -> Self::SendGame
|
fn send_game<G>(&self, chat_id: ChatId, game_short_name: G) -> Self::SendGame
|
||||||
where
|
where
|
||||||
G: Into<String>;
|
G: Into<String>;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue