Skip to main content

ronami_core/bot/
api.rs

1use url::Url;
2
3use crate::{
4    payloads,
5    prelude::Requester,
6    requests::{JsonRequest, MultipartRequest},
7    types::{
8        AcceptedGiftTypes, BotCommand, BusinessConnectionId, CallbackQueryId, ChatId,
9        ChatPermissions, CustomEmojiId, DraftId, FileId, GiftId, GuestQueryId, InlineQueryId,
10        InlineQueryResult, InputChecklist, InputFile, InputMedia, InputPaidMedia, InputPollOption,
11        InputProfilePhoto, InputSticker, InputStoryContent, KeyboardButton, LabeledPrice,
12        MessageId, OwnedGiftId, PreCheckoutQueryId, Recipient, Seconds, ShippingQueryId,
13        StickerFormat, StoryId, TelegramTransactionId, ThreadId, UserId,
14    },
15    Bot,
16};
17
18impl Requester for Bot {
19    type Err = crate::errors::RequestError;
20
21    type GetUpdates = JsonRequest<payloads::GetUpdates>;
22
23    fn get_updates(&self) -> Self::GetUpdates {
24        Self::GetUpdates::new(self.clone(), payloads::GetUpdates::new())
25    }
26
27    type SetWebhook = MultipartRequest<payloads::SetWebhook>;
28
29    fn set_webhook(&self, url: Url) -> Self::SetWebhook {
30        Self::SetWebhook::new(self.clone(), payloads::SetWebhook::new(url))
31    }
32
33    type DeleteWebhook = JsonRequest<payloads::DeleteWebhook>;
34
35    fn delete_webhook(&self) -> Self::DeleteWebhook {
36        Self::DeleteWebhook::new(self.clone(), payloads::DeleteWebhook::new())
37    }
38
39    type GetWebhookInfo = JsonRequest<payloads::GetWebhookInfo>;
40
41    fn get_webhook_info(&self) -> Self::GetWebhookInfo {
42        Self::GetWebhookInfo::new(self.clone(), payloads::GetWebhookInfo::new())
43    }
44
45    type GetMe = JsonRequest<payloads::GetMe>;
46
47    fn get_me(&self) -> Self::GetMe {
48        Self::GetMe::new(self.clone(), payloads::GetMe::new())
49    }
50
51    type SendMessage = JsonRequest<payloads::SendMessage>;
52
53    fn send_message<C, T>(&self, chat_id: C, text: T) -> Self::SendMessage
54    where
55        C: Into<Recipient>,
56        T: Into<String>,
57    {
58        Self::SendMessage::new(self.clone(), payloads::SendMessage::new(chat_id, text))
59    }
60
61    type SendMessageDraft = JsonRequest<payloads::SendMessageDraft>;
62
63    fn send_message_draft<C, T>(
64        &self,
65        chat_id: C,
66        draft_id: DraftId,
67        text: T,
68    ) -> Self::SendMessageDraft
69    where
70        C: Into<Recipient>,
71        T: Into<String>,
72    {
73        Self::SendMessageDraft::new(
74            self.clone(),
75            payloads::SendMessageDraft::new(chat_id, draft_id, text),
76        )
77    }
78
79    type ForwardMessage = JsonRequest<payloads::ForwardMessage>;
80
81    fn forward_message<C, F>(
82        &self,
83        chat_id: C,
84        from_chat_id: F,
85        message_id: MessageId,
86    ) -> Self::ForwardMessage
87    where
88        C: Into<Recipient>,
89        F: Into<Recipient>,
90    {
91        Self::ForwardMessage::new(
92            self.clone(),
93            payloads::ForwardMessage::new(chat_id, from_chat_id, message_id),
94        )
95    }
96
97    type ForwardMessages = JsonRequest<payloads::ForwardMessages>;
98    fn forward_messages<C, F, M>(
99        &self,
100        chat_id: C,
101        from_chat_id: F,
102        message_ids: M,
103    ) -> Self::ForwardMessages
104    where
105        C: Into<Recipient>,
106        F: Into<Recipient>,
107        M: IntoIterator<Item = MessageId>,
108    {
109        Self::ForwardMessages::new(
110            self.clone(),
111            payloads::ForwardMessages::new(chat_id, from_chat_id, message_ids),
112        )
113    }
114
115    type SendPhoto = MultipartRequest<payloads::SendPhoto>;
116
117    fn send_photo<C>(&self, chat_id: C, photo: InputFile) -> Self::SendPhoto
118    where
119        C: Into<Recipient>,
120    {
121        Self::SendPhoto::new(self.clone(), payloads::SendPhoto::new(chat_id, photo))
122    }
123
124    type SendAudio = MultipartRequest<payloads::SendAudio>;
125
126    fn send_audio<C>(&self, chat_id: C, audio: InputFile) -> Self::SendAudio
127    where
128        C: Into<Recipient>,
129    {
130        Self::SendAudio::new(self.clone(), payloads::SendAudio::new(chat_id, audio))
131    }
132
133    type SendDocument = MultipartRequest<payloads::SendDocument>;
134
135    fn send_document<C>(&self, chat_id: C, document: InputFile) -> Self::SendDocument
136    where
137        C: Into<Recipient>,
138    {
139        Self::SendDocument::new(self.clone(), payloads::SendDocument::new(chat_id, document))
140    }
141
142    type SendVideo = MultipartRequest<payloads::SendVideo>;
143
144    fn send_video<C>(&self, chat_id: C, video: InputFile) -> Self::SendVideo
145    where
146        C: Into<Recipient>,
147    {
148        Self::SendVideo::new(self.clone(), payloads::SendVideo::new(chat_id, video))
149    }
150
151    type SendAnimation = MultipartRequest<payloads::SendAnimation>;
152
153    fn send_animation<C>(&self, chat_id: C, animation: InputFile) -> Self::SendAnimation
154    where
155        C: Into<Recipient>,
156    {
157        Self::SendAnimation::new(self.clone(), payloads::SendAnimation::new(chat_id, animation))
158    }
159
160    type SendVoice = MultipartRequest<payloads::SendVoice>;
161
162    fn send_voice<C>(&self, chat_id: C, voice: InputFile) -> Self::SendVoice
163    where
164        C: Into<Recipient>,
165    {
166        Self::SendVoice::new(self.clone(), payloads::SendVoice::new(chat_id, voice))
167    }
168
169    type SendVideoNote = MultipartRequest<payloads::SendVideoNote>;
170
171    fn send_video_note<C>(&self, chat_id: C, video_note: InputFile) -> Self::SendVideoNote
172    where
173        C: Into<Recipient>,
174    {
175        Self::SendVideoNote::new(self.clone(), payloads::SendVideoNote::new(chat_id, video_note))
176    }
177
178    type SendLivePhoto = MultipartRequest<payloads::SendLivePhoto>;
179
180    fn send_live_photo<C>(
181        &self,
182        chat_id: C,
183        live_photo: InputFile,
184        photo: InputFile,
185    ) -> Self::SendLivePhoto
186    where
187        C: Into<Recipient>,
188    {
189        Self::SendLivePhoto::new(
190            self.clone(),
191            payloads::SendLivePhoto::new(chat_id, live_photo, photo),
192        )
193    }
194
195    type SendPaidMedia = MultipartRequest<payloads::SendPaidMedia>;
196
197    fn send_paid_media<C, M>(&self, chat_id: C, star_count: u32, media: M) -> Self::SendPaidMedia
198    where
199        C: Into<Recipient>,
200        M: IntoIterator<Item = InputPaidMedia>,
201    {
202        Self::SendPaidMedia::new(
203            self.clone(),
204            payloads::SendPaidMedia::new(chat_id, star_count, media),
205        )
206    }
207
208    type SendMediaGroup = MultipartRequest<payloads::SendMediaGroup>;
209
210    fn send_media_group<C, M>(&self, chat_id: C, media: M) -> Self::SendMediaGroup
211    where
212        C: Into<Recipient>,
213        M: IntoIterator<Item = InputMedia>,
214    {
215        Self::SendMediaGroup::new(self.clone(), payloads::SendMediaGroup::new(chat_id, media))
216    }
217
218    type SendLocation = JsonRequest<payloads::SendLocation>;
219
220    fn send_location<C>(&self, chat_id: C, latitude: f64, longitude: f64) -> Self::SendLocation
221    where
222        C: Into<Recipient>,
223    {
224        Self::SendLocation::new(
225            self.clone(),
226            payloads::SendLocation::new(chat_id, latitude, longitude),
227        )
228    }
229
230    type EditMessageLiveLocation = JsonRequest<payloads::EditMessageLiveLocation>;
231
232    fn edit_message_live_location<C>(
233        &self,
234        chat_id: C,
235        message_id: MessageId,
236        latitude: f64,
237        longitude: f64,
238    ) -> Self::EditMessageLiveLocation
239    where
240        C: Into<Recipient>,
241    {
242        Self::EditMessageLiveLocation::new(
243            self.clone(),
244            payloads::EditMessageLiveLocation::new(chat_id, message_id, latitude, longitude),
245        )
246    }
247
248    type EditMessageLiveLocationInline = JsonRequest<payloads::EditMessageLiveLocationInline>;
249
250    fn edit_message_live_location_inline<I>(
251        &self,
252        inline_message_id: I,
253        latitude: f64,
254        longitude: f64,
255    ) -> Self::EditMessageLiveLocationInline
256    where
257        I: Into<String>,
258    {
259        Self::EditMessageLiveLocationInline::new(
260            self.clone(),
261            payloads::EditMessageLiveLocationInline::new(inline_message_id, latitude, longitude),
262        )
263    }
264
265    type StopMessageLiveLocation = JsonRequest<payloads::StopMessageLiveLocation>;
266
267    fn stop_message_live_location<C>(
268        &self,
269        chat_id: C,
270        message_id: MessageId,
271    ) -> Self::StopMessageLiveLocation
272    where
273        C: Into<Recipient>,
274    {
275        Self::StopMessageLiveLocation::new(
276            self.clone(),
277            payloads::StopMessageLiveLocation::new(chat_id, message_id),
278        )
279    }
280
281    type StopMessageLiveLocationInline = JsonRequest<payloads::StopMessageLiveLocationInline>;
282
283    fn stop_message_live_location_inline<I>(
284        &self,
285        inline_message_id: I,
286    ) -> Self::StopMessageLiveLocationInline
287    where
288        I: Into<String>,
289    {
290        Self::StopMessageLiveLocationInline::new(
291            self.clone(),
292            payloads::StopMessageLiveLocationInline::new(inline_message_id),
293        )
294    }
295
296    type EditMessageChecklist = JsonRequest<payloads::EditMessageChecklist>;
297
298    fn edit_message_checklist<C>(
299        &self,
300        business_connection_id: BusinessConnectionId,
301        chat_id: C,
302        message_id: MessageId,
303        checklist: InputChecklist,
304    ) -> Self::EditMessageChecklist
305    where
306        C: Into<ChatId>,
307    {
308        Self::EditMessageChecklist::new(
309            self.clone(),
310            payloads::EditMessageChecklist::new(
311                business_connection_id,
312                chat_id,
313                message_id,
314                checklist,
315            ),
316        )
317    }
318
319    type SendVenue = JsonRequest<payloads::SendVenue>;
320
321    fn send_venue<C, T, A>(
322        &self,
323        chat_id: C,
324        latitude: f64,
325        longitude: f64,
326        title: T,
327        address: A,
328    ) -> Self::SendVenue
329    where
330        C: Into<Recipient>,
331        T: Into<String>,
332        A: Into<String>,
333    {
334        Self::SendVenue::new(
335            self.clone(),
336            payloads::SendVenue::new(chat_id, latitude, longitude, title, address),
337        )
338    }
339
340    type SendContact = JsonRequest<payloads::SendContact>;
341
342    fn send_contact<C, P, F>(&self, chat_id: C, phone_number: P, first_name: F) -> Self::SendContact
343    where
344        C: Into<Recipient>,
345        P: Into<String>,
346        F: Into<String>,
347    {
348        Self::SendContact::new(
349            self.clone(),
350            payloads::SendContact::new(chat_id, phone_number, first_name),
351        )
352    }
353
354    type SendPoll = JsonRequest<payloads::SendPoll>;
355
356    fn send_poll<C, Q, O>(&self, chat_id: C, question: Q, options: O) -> Self::SendPoll
357    where
358        C: Into<Recipient>,
359        Q: Into<String>,
360        O: IntoIterator<Item = InputPollOption>,
361    {
362        Self::SendPoll::new(self.clone(), payloads::SendPoll::new(chat_id, question, options))
363    }
364
365    type SendChecklist = JsonRequest<payloads::SendChecklist>;
366
367    fn send_checklist<C>(
368        &self,
369        business_connection_id: BusinessConnectionId,
370        chat_id: C,
371        checklist: InputChecklist,
372    ) -> Self::SendChecklist
373    where
374        C: Into<ChatId>,
375    {
376        Self::SendChecklist::new(
377            self.clone(),
378            payloads::SendChecklist::new(business_connection_id, chat_id, checklist),
379        )
380    }
381
382    type SendDice = JsonRequest<payloads::SendDice>;
383
384    fn send_dice<C>(&self, chat_id: C) -> Self::SendDice
385    where
386        C: Into<Recipient>,
387    {
388        Self::SendDice::new(self.clone(), payloads::SendDice::new(chat_id))
389    }
390
391    type SendChatAction = JsonRequest<payloads::SendChatAction>;
392
393    fn send_chat_action<C>(
394        &self,
395        chat_id: C,
396        action: crate::types::ChatAction,
397    ) -> Self::SendChatAction
398    where
399        C: Into<Recipient>,
400    {
401        Self::SendChatAction::new(self.clone(), payloads::SendChatAction::new(chat_id, action))
402    }
403
404    type SetMessageReaction = JsonRequest<payloads::SetMessageReaction>;
405
406    fn set_message_reaction<C>(&self, chat_id: C, message_id: MessageId) -> Self::SetMessageReaction
407    where
408        C: Into<Recipient>,
409    {
410        Self::SetMessageReaction::new(
411            self.clone(),
412            payloads::SetMessageReaction::new(chat_id, message_id),
413        )
414    }
415
416    type GetUserProfilePhotos = JsonRequest<payloads::GetUserProfilePhotos>;
417
418    fn get_user_profile_photos(&self, user_id: UserId) -> Self::GetUserProfilePhotos {
419        Self::GetUserProfilePhotos::new(self.clone(), payloads::GetUserProfilePhotos::new(user_id))
420    }
421
422    type GetUserProfileAudios = JsonRequest<payloads::GetUserProfileAudios>;
423
424    fn get_user_profile_audios(&self, user_id: UserId) -> Self::GetUserProfileAudios {
425        Self::GetUserProfileAudios::new(self.clone(), payloads::GetUserProfileAudios::new(user_id))
426    }
427
428    type SetUserEmojiStatus = JsonRequest<payloads::SetUserEmojiStatus>;
429
430    fn set_user_emoji_status(&self, user_id: UserId) -> Self::SetUserEmojiStatus {
431        Self::SetUserEmojiStatus::new(self.clone(), payloads::SetUserEmojiStatus::new(user_id))
432    }
433
434    type GetFile = JsonRequest<payloads::GetFile>;
435
436    fn get_file(&self, file_id: FileId) -> Self::GetFile {
437        Self::GetFile::new(self.clone(), payloads::GetFile::new(file_id))
438    }
439
440    type KickChatMember = JsonRequest<payloads::KickChatMember>;
441
442    fn kick_chat_member<C>(&self, chat_id: C, user_id: UserId) -> Self::KickChatMember
443    where
444        C: Into<Recipient>,
445    {
446        Self::KickChatMember::new(self.clone(), payloads::KickChatMember::new(chat_id, user_id))
447    }
448
449    type BanChatMember = JsonRequest<payloads::BanChatMember>;
450
451    fn ban_chat_member<C>(&self, chat_id: C, user_id: UserId) -> Self::BanChatMember
452    where
453        C: Into<Recipient>,
454    {
455        Self::BanChatMember::new(self.clone(), payloads::BanChatMember::new(chat_id, user_id))
456    }
457
458    type UnbanChatMember = JsonRequest<payloads::UnbanChatMember>;
459
460    fn unban_chat_member<C>(&self, chat_id: C, user_id: UserId) -> Self::UnbanChatMember
461    where
462        C: Into<Recipient>,
463    {
464        Self::UnbanChatMember::new(self.clone(), payloads::UnbanChatMember::new(chat_id, user_id))
465    }
466
467    type RestrictChatMember = JsonRequest<payloads::RestrictChatMember>;
468
469    fn restrict_chat_member<C>(
470        &self,
471        chat_id: C,
472        user_id: UserId,
473        permissions: ChatPermissions,
474    ) -> Self::RestrictChatMember
475    where
476        C: Into<Recipient>,
477    {
478        Self::RestrictChatMember::new(
479            self.clone(),
480            payloads::RestrictChatMember::new(chat_id, user_id, permissions),
481        )
482    }
483
484    type PromoteChatMember = JsonRequest<payloads::PromoteChatMember>;
485
486    fn promote_chat_member<C>(&self, chat_id: C, user_id: UserId) -> Self::PromoteChatMember
487    where
488        C: Into<Recipient>,
489    {
490        Self::PromoteChatMember::new(
491            self.clone(),
492            payloads::PromoteChatMember::new(chat_id, user_id),
493        )
494    }
495
496    type SetChatAdministratorCustomTitle = JsonRequest<payloads::SetChatAdministratorCustomTitle>;
497
498    fn set_chat_administrator_custom_title<Ch, Cu>(
499        &self,
500        chat_id: Ch,
501        user_id: UserId,
502        custom_title: Cu,
503    ) -> Self::SetChatAdministratorCustomTitle
504    where
505        Ch: Into<Recipient>,
506        Cu: Into<String>,
507    {
508        Self::SetChatAdministratorCustomTitle::new(
509            self.clone(),
510            payloads::SetChatAdministratorCustomTitle::new(chat_id, user_id, custom_title),
511        )
512    }
513
514    type SetChatMemberTag = JsonRequest<payloads::SetChatMemberTag>;
515
516    fn set_chat_member_tag<C>(&self, chat_id: C, user_id: UserId) -> Self::SetChatMemberTag
517    where
518        C: Into<Recipient>,
519    {
520        Self::SetChatMemberTag::new(self.clone(), payloads::SetChatMemberTag::new(chat_id, user_id))
521    }
522
523    type BanChatSenderChat = JsonRequest<payloads::BanChatSenderChat>;
524
525    fn ban_chat_sender_chat<C, S>(&self, chat_id: C, sender_chat_id: S) -> Self::BanChatSenderChat
526    where
527        C: Into<Recipient>,
528        S: Into<ChatId>,
529    {
530        Self::BanChatSenderChat::new(
531            self.clone(),
532            payloads::BanChatSenderChat::new(chat_id, sender_chat_id),
533        )
534    }
535
536    type UnbanChatSenderChat = JsonRequest<payloads::UnbanChatSenderChat>;
537
538    fn unban_chat_sender_chat<C, S>(
539        &self,
540        chat_id: C,
541        sender_chat_id: S,
542    ) -> Self::UnbanChatSenderChat
543    where
544        C: Into<Recipient>,
545        S: Into<ChatId>,
546    {
547        Self::UnbanChatSenderChat::new(
548            self.clone(),
549            payloads::UnbanChatSenderChat::new(chat_id, sender_chat_id),
550        )
551    }
552
553    type SetChatPermissions = JsonRequest<payloads::SetChatPermissions>;
554
555    fn set_chat_permissions<C>(
556        &self,
557        chat_id: C,
558        permissions: ChatPermissions,
559    ) -> Self::SetChatPermissions
560    where
561        C: Into<Recipient>,
562    {
563        Self::SetChatPermissions::new(
564            self.clone(),
565            payloads::SetChatPermissions::new(chat_id, permissions),
566        )
567    }
568
569    type ExportChatInviteLink = JsonRequest<payloads::ExportChatInviteLink>;
570
571    fn export_chat_invite_link<C>(&self, chat_id: C) -> Self::ExportChatInviteLink
572    where
573        C: Into<Recipient>,
574    {
575        Self::ExportChatInviteLink::new(self.clone(), payloads::ExportChatInviteLink::new(chat_id))
576    }
577
578    type CreateChatInviteLink = JsonRequest<payloads::CreateChatInviteLink>;
579
580    fn create_chat_invite_link<C>(&self, chat_id: C) -> Self::CreateChatInviteLink
581    where
582        C: Into<Recipient>,
583    {
584        Self::CreateChatInviteLink::new(self.clone(), payloads::CreateChatInviteLink::new(chat_id))
585    }
586
587    type EditChatInviteLink = JsonRequest<payloads::EditChatInviteLink>;
588
589    fn edit_chat_invite_link<C, I>(&self, chat_id: C, invite_link: I) -> Self::EditChatInviteLink
590    where
591        C: Into<Recipient>,
592        I: Into<String>,
593    {
594        Self::EditChatInviteLink::new(
595            self.clone(),
596            payloads::EditChatInviteLink::new(chat_id, invite_link),
597        )
598    }
599
600    type CreateChatSubscriptionInviteLink = JsonRequest<payloads::CreateChatSubscriptionInviteLink>;
601
602    fn create_chat_subscription_invite_link<C>(
603        &self,
604        chat_id: C,
605        subscription_period: Seconds,
606        subscription_price: u32,
607    ) -> Self::CreateChatSubscriptionInviteLink
608    where
609        C: Into<Recipient>,
610    {
611        Self::CreateChatSubscriptionInviteLink::new(
612            self.clone(),
613            payloads::CreateChatSubscriptionInviteLink::new(
614                chat_id,
615                subscription_period,
616                subscription_price,
617            ),
618        )
619    }
620
621    type EditChatSubscriptionInviteLink = JsonRequest<payloads::EditChatSubscriptionInviteLink>;
622
623    fn edit_chat_subscription_invite_link<C, I>(
624        &self,
625        chat_id: C,
626        invite_link: I,
627    ) -> Self::EditChatSubscriptionInviteLink
628    where
629        C: Into<Recipient>,
630        I: Into<String>,
631    {
632        Self::EditChatSubscriptionInviteLink::new(
633            self.clone(),
634            payloads::EditChatSubscriptionInviteLink::new(chat_id, invite_link),
635        )
636    }
637
638    type RevokeChatInviteLink = JsonRequest<payloads::RevokeChatInviteLink>;
639
640    fn revoke_chat_invite_link<C, I>(
641        &self,
642        chat_id: C,
643        invite_link: I,
644    ) -> Self::RevokeChatInviteLink
645    where
646        C: Into<Recipient>,
647        I: Into<String>,
648    {
649        Self::RevokeChatInviteLink::new(
650            self.clone(),
651            payloads::RevokeChatInviteLink::new(chat_id, invite_link),
652        )
653    }
654
655    type ApproveChatJoinRequest = JsonRequest<payloads::ApproveChatJoinRequest>;
656
657    fn approve_chat_join_request<C>(
658        &self,
659        chat_id: C,
660        user_id: UserId,
661    ) -> Self::ApproveChatJoinRequest
662    where
663        C: Into<Recipient>,
664    {
665        Self::ApproveChatJoinRequest::new(
666            self.clone(),
667            payloads::ApproveChatJoinRequest::new(chat_id, user_id),
668        )
669    }
670
671    type DeclineChatJoinRequest = JsonRequest<payloads::DeclineChatJoinRequest>;
672
673    fn decline_chat_join_request<C>(
674        &self,
675        chat_id: C,
676        user_id: UserId,
677    ) -> Self::DeclineChatJoinRequest
678    where
679        C: Into<Recipient>,
680    {
681        Self::DeclineChatJoinRequest::new(
682            self.clone(),
683            payloads::DeclineChatJoinRequest::new(chat_id, user_id),
684        )
685    }
686
687    type SetChatPhoto = MultipartRequest<payloads::SetChatPhoto>;
688
689    fn set_chat_photo<C>(&self, chat_id: C, photo: InputFile) -> Self::SetChatPhoto
690    where
691        C: Into<Recipient>,
692    {
693        Self::SetChatPhoto::new(self.clone(), payloads::SetChatPhoto::new(chat_id, photo))
694    }
695
696    type DeleteChatPhoto = JsonRequest<payloads::DeleteChatPhoto>;
697
698    fn delete_chat_photo<C>(&self, chat_id: C) -> Self::DeleteChatPhoto
699    where
700        C: Into<Recipient>,
701    {
702        Self::DeleteChatPhoto::new(self.clone(), payloads::DeleteChatPhoto::new(chat_id))
703    }
704
705    type SetChatTitle = JsonRequest<payloads::SetChatTitle>;
706
707    fn set_chat_title<C, T>(&self, chat_id: C, title: T) -> Self::SetChatTitle
708    where
709        C: Into<Recipient>,
710        T: Into<String>,
711    {
712        Self::SetChatTitle::new(self.clone(), payloads::SetChatTitle::new(chat_id, title))
713    }
714
715    type SetChatDescription = JsonRequest<payloads::SetChatDescription>;
716
717    fn set_chat_description<C>(&self, chat_id: C) -> Self::SetChatDescription
718    where
719        C: Into<Recipient>,
720    {
721        Self::SetChatDescription::new(self.clone(), payloads::SetChatDescription::new(chat_id))
722    }
723
724    type PinChatMessage = JsonRequest<payloads::PinChatMessage>;
725
726    fn pin_chat_message<C>(&self, chat_id: C, message_id: MessageId) -> Self::PinChatMessage
727    where
728        C: Into<Recipient>,
729    {
730        Self::PinChatMessage::new(self.clone(), payloads::PinChatMessage::new(chat_id, message_id))
731    }
732
733    type UnpinChatMessage = JsonRequest<payloads::UnpinChatMessage>;
734
735    fn unpin_chat_message<C>(&self, chat_id: C) -> Self::UnpinChatMessage
736    where
737        C: Into<Recipient>,
738    {
739        Self::UnpinChatMessage::new(self.clone(), payloads::UnpinChatMessage::new(chat_id))
740    }
741
742    type LeaveChat = JsonRequest<payloads::LeaveChat>;
743
744    fn leave_chat<C>(&self, chat_id: C) -> Self::LeaveChat
745    where
746        C: Into<Recipient>,
747    {
748        Self::LeaveChat::new(self.clone(), payloads::LeaveChat::new(chat_id))
749    }
750
751    type GetChat = JsonRequest<payloads::GetChat>;
752
753    fn get_chat<C>(&self, chat_id: C) -> Self::GetChat
754    where
755        C: Into<Recipient>,
756    {
757        Self::GetChat::new(self.clone(), payloads::GetChat::new(chat_id))
758    }
759
760    type GetChatAdministrators = JsonRequest<payloads::GetChatAdministrators>;
761
762    fn get_chat_administrators<C>(&self, chat_id: C) -> Self::GetChatAdministrators
763    where
764        C: Into<Recipient>,
765    {
766        Self::GetChatAdministrators::new(
767            self.clone(),
768            payloads::GetChatAdministrators::new(chat_id),
769        )
770    }
771
772    type GetChatMembersCount = JsonRequest<payloads::GetChatMembersCount>;
773
774    fn get_chat_members_count<C>(&self, chat_id: C) -> Self::GetChatMembersCount
775    where
776        C: Into<Recipient>,
777    {
778        Self::GetChatMembersCount::new(self.clone(), payloads::GetChatMembersCount::new(chat_id))
779    }
780
781    type GetChatMemberCount = JsonRequest<payloads::GetChatMemberCount>;
782
783    fn get_chat_member_count<C>(&self, chat_id: C) -> Self::GetChatMemberCount
784    where
785        C: Into<Recipient>,
786    {
787        Self::GetChatMemberCount::new(self.clone(), payloads::GetChatMemberCount::new(chat_id))
788    }
789
790    type GetChatMember = JsonRequest<payloads::GetChatMember>;
791
792    fn get_chat_member<C>(&self, chat_id: C, user_id: UserId) -> Self::GetChatMember
793    where
794        C: Into<Recipient>,
795    {
796        Self::GetChatMember::new(self.clone(), payloads::GetChatMember::new(chat_id, user_id))
797    }
798
799    type SetChatStickerSet = JsonRequest<payloads::SetChatStickerSet>;
800
801    fn set_chat_sticker_set<C, S>(&self, chat_id: C, sticker_set_name: S) -> Self::SetChatStickerSet
802    where
803        C: Into<Recipient>,
804        S: Into<String>,
805    {
806        Self::SetChatStickerSet::new(
807            self.clone(),
808            payloads::SetChatStickerSet::new(chat_id, sticker_set_name),
809        )
810    }
811
812    type DeleteChatStickerSet = JsonRequest<payloads::DeleteChatStickerSet>;
813
814    fn delete_chat_sticker_set<C>(&self, chat_id: C) -> Self::DeleteChatStickerSet
815    where
816        C: Into<Recipient>,
817    {
818        Self::DeleteChatStickerSet::new(self.clone(), payloads::DeleteChatStickerSet::new(chat_id))
819    }
820
821    type GetForumTopicIconStickers = JsonRequest<payloads::GetForumTopicIconStickers>;
822
823    fn get_forum_topic_icon_stickers(&self) -> Self::GetForumTopicIconStickers {
824        Self::GetForumTopicIconStickers::new(
825            self.clone(),
826            payloads::GetForumTopicIconStickers::new(),
827        )
828    }
829
830    type CreateForumTopic = JsonRequest<payloads::CreateForumTopic>;
831
832    fn create_forum_topic<C, N>(&self, chat_id: C, name: N) -> Self::CreateForumTopic
833    where
834        C: Into<Recipient>,
835        N: Into<String>,
836    {
837        Self::CreateForumTopic::new(self.clone(), payloads::CreateForumTopic::new(chat_id, name))
838    }
839
840    type EditForumTopic = JsonRequest<payloads::EditForumTopic>;
841
842    fn edit_forum_topic<C>(&self, chat_id: C, message_thread_id: ThreadId) -> Self::EditForumTopic
843    where
844        C: Into<Recipient>,
845    {
846        Self::EditForumTopic::new(
847            self.clone(),
848            payloads::EditForumTopic::new(chat_id, message_thread_id),
849        )
850    }
851
852    type CloseForumTopic = JsonRequest<payloads::CloseForumTopic>;
853
854    fn close_forum_topic<C>(&self, chat_id: C, message_thread_id: ThreadId) -> Self::CloseForumTopic
855    where
856        C: Into<Recipient>,
857    {
858        Self::CloseForumTopic::new(
859            self.clone(),
860            payloads::CloseForumTopic::new(chat_id, message_thread_id),
861        )
862    }
863
864    type ReopenForumTopic = JsonRequest<payloads::ReopenForumTopic>;
865
866    fn reopen_forum_topic<C>(
867        &self,
868        chat_id: C,
869        message_thread_id: ThreadId,
870    ) -> Self::ReopenForumTopic
871    where
872        C: Into<Recipient>,
873    {
874        Self::ReopenForumTopic::new(
875            self.clone(),
876            payloads::ReopenForumTopic::new(chat_id, message_thread_id),
877        )
878    }
879
880    type DeleteForumTopic = JsonRequest<payloads::DeleteForumTopic>;
881
882    fn delete_forum_topic<C>(
883        &self,
884        chat_id: C,
885        message_thread_id: ThreadId,
886    ) -> Self::DeleteForumTopic
887    where
888        C: Into<Recipient>,
889    {
890        Self::DeleteForumTopic::new(
891            self.clone(),
892            payloads::DeleteForumTopic::new(chat_id, message_thread_id),
893        )
894    }
895
896    type UnpinAllForumTopicMessages = JsonRequest<payloads::UnpinAllForumTopicMessages>;
897
898    fn unpin_all_forum_topic_messages<C>(
899        &self,
900        chat_id: C,
901        message_thread_id: ThreadId,
902    ) -> Self::UnpinAllForumTopicMessages
903    where
904        C: Into<Recipient>,
905    {
906        Self::UnpinAllForumTopicMessages::new(
907            self.clone(),
908            payloads::UnpinAllForumTopicMessages::new(chat_id, message_thread_id),
909        )
910    }
911
912    type EditGeneralForumTopic = JsonRequest<payloads::EditGeneralForumTopic>;
913
914    fn edit_general_forum_topic<C, N>(&self, chat_id: C, name: N) -> Self::EditGeneralForumTopic
915    where
916        C: Into<Recipient>,
917        N: Into<String>,
918    {
919        Self::EditGeneralForumTopic::new(
920            self.clone(),
921            payloads::EditGeneralForumTopic::new(chat_id, name),
922        )
923    }
924
925    type CloseGeneralForumTopic = JsonRequest<payloads::CloseGeneralForumTopic>;
926
927    fn close_general_forum_topic<C>(&self, chat_id: C) -> Self::CloseGeneralForumTopic
928    where
929        C: Into<Recipient>,
930    {
931        Self::CloseGeneralForumTopic::new(
932            self.clone(),
933            payloads::CloseGeneralForumTopic::new(chat_id),
934        )
935    }
936
937    type ReopenGeneralForumTopic = JsonRequest<payloads::ReopenGeneralForumTopic>;
938
939    fn reopen_general_forum_topic<C>(&self, chat_id: C) -> Self::ReopenGeneralForumTopic
940    where
941        C: Into<Recipient>,
942    {
943        Self::ReopenGeneralForumTopic::new(
944            self.clone(),
945            payloads::ReopenGeneralForumTopic::new(chat_id),
946        )
947    }
948
949    type HideGeneralForumTopic = JsonRequest<payloads::HideGeneralForumTopic>;
950
951    fn hide_general_forum_topic<C>(&self, chat_id: C) -> Self::HideGeneralForumTopic
952    where
953        C: Into<Recipient>,
954    {
955        Self::HideGeneralForumTopic::new(
956            self.clone(),
957            payloads::HideGeneralForumTopic::new(chat_id),
958        )
959    }
960
961    type UnhideGeneralForumTopic = JsonRequest<payloads::UnhideGeneralForumTopic>;
962
963    fn unhide_general_forum_topic<C>(&self, chat_id: C) -> Self::UnhideGeneralForumTopic
964    where
965        C: Into<Recipient>,
966    {
967        Self::UnhideGeneralForumTopic::new(
968            self.clone(),
969            payloads::UnhideGeneralForumTopic::new(chat_id),
970        )
971    }
972
973    type UnpinAllGeneralForumTopicMessages =
974        JsonRequest<payloads::UnpinAllGeneralForumTopicMessages>;
975
976    fn unpin_all_general_forum_topic_messages<C>(
977        &self,
978        chat_id: C,
979    ) -> Self::UnpinAllGeneralForumTopicMessages
980    where
981        C: Into<Recipient>,
982    {
983        Self::UnpinAllGeneralForumTopicMessages::new(
984            self.clone(),
985            payloads::UnpinAllGeneralForumTopicMessages::new(chat_id),
986        )
987    }
988
989    type AnswerCallbackQuery = JsonRequest<payloads::AnswerCallbackQuery>;
990
991    fn answer_callback_query(
992        &self,
993        callback_query_id: CallbackQueryId,
994    ) -> Self::AnswerCallbackQuery {
995        Self::AnswerCallbackQuery::new(
996            self.clone(),
997            payloads::AnswerCallbackQuery::new(callback_query_id),
998        )
999    }
1000
1001    type GetUserChatBoosts = JsonRequest<payloads::GetUserChatBoosts>;
1002
1003    fn get_user_chat_boosts<C>(&self, chat_id: C, user_id: UserId) -> Self::GetUserChatBoosts
1004    where
1005        C: Into<Recipient>,
1006    {
1007        Self::GetUserChatBoosts::new(
1008            self.clone(),
1009            payloads::GetUserChatBoosts::new(chat_id, user_id),
1010        )
1011    }
1012
1013    type SetMyCommands = JsonRequest<payloads::SetMyCommands>;
1014
1015    fn set_my_commands<C>(&self, commands: C) -> Self::SetMyCommands
1016    where
1017        C: IntoIterator<Item = BotCommand>,
1018    {
1019        Self::SetMyCommands::new(self.clone(), payloads::SetMyCommands::new(commands))
1020    }
1021
1022    type GetBusinessConnection = JsonRequest<payloads::GetBusinessConnection>;
1023
1024    fn get_business_connection(
1025        &self,
1026        business_connection_id: BusinessConnectionId,
1027    ) -> Self::GetBusinessConnection {
1028        Self::GetBusinessConnection::new(
1029            self.clone(),
1030            payloads::GetBusinessConnection::new(business_connection_id),
1031        )
1032    }
1033
1034    type GetMyCommands = JsonRequest<payloads::GetMyCommands>;
1035
1036    fn get_my_commands(&self) -> Self::GetMyCommands {
1037        Self::GetMyCommands::new(self.clone(), payloads::GetMyCommands::new())
1038    }
1039
1040    type SetMyName = JsonRequest<payloads::SetMyName>;
1041
1042    fn set_my_name(&self) -> Self::SetMyName {
1043        Self::SetMyName::new(self.clone(), payloads::SetMyName::new())
1044    }
1045
1046    type GetMyName = JsonRequest<payloads::GetMyName>;
1047
1048    fn get_my_name(&self) -> Self::GetMyName {
1049        Self::GetMyName::new(self.clone(), payloads::GetMyName::new())
1050    }
1051
1052    type SetMyDescription = JsonRequest<payloads::SetMyDescription>;
1053
1054    fn set_my_description(&self) -> Self::SetMyDescription {
1055        Self::SetMyDescription::new(self.clone(), payloads::SetMyDescription::new())
1056    }
1057
1058    type GetMyDescription = JsonRequest<payloads::GetMyDescription>;
1059
1060    fn get_my_description(&self) -> Self::GetMyDescription {
1061        Self::GetMyDescription::new(self.clone(), payloads::GetMyDescription::new())
1062    }
1063
1064    type SetMyShortDescription = JsonRequest<payloads::SetMyShortDescription>;
1065
1066    fn set_my_short_description(&self) -> Self::SetMyShortDescription {
1067        Self::SetMyShortDescription::new(self.clone(), payloads::SetMyShortDescription::new())
1068    }
1069
1070    type GetMyShortDescription = JsonRequest<payloads::GetMyShortDescription>;
1071    fn get_my_short_description(&self) -> Self::GetMyShortDescription {
1072        Self::GetMyShortDescription::new(self.clone(), payloads::GetMyShortDescription::new())
1073    }
1074
1075    type SetMyProfilePhoto = JsonRequest<payloads::SetMyProfilePhoto>;
1076
1077    fn set_my_profile_photo(&self, photo: InputProfilePhoto) -> Self::SetMyProfilePhoto {
1078        Self::SetMyProfilePhoto::new(self.clone(), payloads::SetMyProfilePhoto::new(photo))
1079    }
1080
1081    type RemoveMyProfilePhoto = JsonRequest<payloads::RemoveMyProfilePhoto>;
1082
1083    fn remove_my_profile_photo(&self) -> Self::RemoveMyProfilePhoto {
1084        Self::RemoveMyProfilePhoto::new(self.clone(), payloads::RemoveMyProfilePhoto::new())
1085    }
1086
1087    type GetManagedBotToken = JsonRequest<payloads::GetManagedBotToken>;
1088
1089    fn get_managed_bot_token(&self, user_id: UserId) -> Self::GetManagedBotToken {
1090        Self::GetManagedBotToken::new(self.clone(), payloads::GetManagedBotToken::new(user_id))
1091    }
1092
1093    type ReplaceManagedBotToken = JsonRequest<payloads::ReplaceManagedBotToken>;
1094
1095    fn replace_managed_bot_token(&self, user_id: UserId) -> Self::ReplaceManagedBotToken {
1096        Self::ReplaceManagedBotToken::new(
1097            self.clone(),
1098            payloads::ReplaceManagedBotToken::new(user_id),
1099        )
1100    }
1101
1102    type SavePreparedKeyboardButton = JsonRequest<payloads::SavePreparedKeyboardButton>;
1103
1104    fn save_prepared_keyboard_button(
1105        &self,
1106        user_id: UserId,
1107        button: KeyboardButton,
1108    ) -> Self::SavePreparedKeyboardButton {
1109        Self::SavePreparedKeyboardButton::new(
1110            self.clone(),
1111            payloads::SavePreparedKeyboardButton::new(user_id, button),
1112        )
1113    }
1114
1115    type GetManagedBotAccessSettings = JsonRequest<payloads::GetManagedBotAccessSettings>;
1116
1117    fn get_managed_bot_access_settings(
1118        &self,
1119        user_id: UserId,
1120    ) -> Self::GetManagedBotAccessSettings {
1121        Self::GetManagedBotAccessSettings::new(
1122            self.clone(),
1123            payloads::GetManagedBotAccessSettings::new(user_id),
1124        )
1125    }
1126
1127    type SetManagedBotAccessSettings = JsonRequest<payloads::SetManagedBotAccessSettings>;
1128
1129    fn set_managed_bot_access_settings(
1130        &self,
1131        user_id: UserId,
1132        is_access_restricted: bool,
1133    ) -> Self::SetManagedBotAccessSettings {
1134        Self::SetManagedBotAccessSettings::new(
1135            self.clone(),
1136            payloads::SetManagedBotAccessSettings::new(user_id, is_access_restricted),
1137        )
1138    }
1139
1140    type GetUserPersonalChatMessages = JsonRequest<payloads::GetUserPersonalChatMessages>;
1141
1142    fn get_user_personal_chat_messages(
1143        &self,
1144        user_id: UserId,
1145        limit: u8,
1146    ) -> Self::GetUserPersonalChatMessages {
1147        Self::GetUserPersonalChatMessages::new(
1148            self.clone(),
1149            payloads::GetUserPersonalChatMessages::new(user_id, limit),
1150        )
1151    }
1152
1153    type AnswerGuestQuery = JsonRequest<payloads::AnswerGuestQuery>;
1154
1155    fn answer_guest_query(
1156        &self,
1157        guest_query_id: GuestQueryId,
1158        result: InlineQueryResult,
1159    ) -> Self::AnswerGuestQuery {
1160        Self::AnswerGuestQuery::new(
1161            self.clone(),
1162            payloads::AnswerGuestQuery::new(guest_query_id, result),
1163        )
1164    }
1165
1166    type DeleteMessageReaction = JsonRequest<payloads::DeleteMessageReaction>;
1167
1168    fn delete_message_reaction<C>(&self, chat_id: C, message_id: i32) -> Self::DeleteMessageReaction
1169    where
1170        C: Into<Recipient>,
1171    {
1172        Self::DeleteMessageReaction::new(
1173            self.clone(),
1174            payloads::DeleteMessageReaction::new(chat_id, message_id),
1175        )
1176    }
1177
1178    type DeleteAllMessageReactions = JsonRequest<payloads::DeleteAllMessageReactions>;
1179
1180    fn delete_all_message_reactions<C>(&self, chat_id: C) -> Self::DeleteAllMessageReactions
1181    where
1182        C: Into<Recipient>,
1183    {
1184        Self::DeleteAllMessageReactions::new(
1185            self.clone(),
1186            payloads::DeleteAllMessageReactions::new(chat_id),
1187        )
1188    }
1189
1190    type SetChatMenuButton = JsonRequest<payloads::SetChatMenuButton>;
1191
1192    fn set_chat_menu_button(&self) -> Self::SetChatMenuButton {
1193        Self::SetChatMenuButton::new(self.clone(), payloads::SetChatMenuButton::new())
1194    }
1195
1196    type GetChatMenuButton = JsonRequest<payloads::GetChatMenuButton>;
1197
1198    fn get_chat_menu_button(&self) -> Self::GetChatMenuButton {
1199        Self::GetChatMenuButton::new(self.clone(), payloads::GetChatMenuButton::new())
1200    }
1201
1202    type SetMyDefaultAdministratorRights = JsonRequest<payloads::SetMyDefaultAdministratorRights>;
1203
1204    fn set_my_default_administrator_rights(&self) -> Self::SetMyDefaultAdministratorRights {
1205        Self::SetMyDefaultAdministratorRights::new(
1206            self.clone(),
1207            payloads::SetMyDefaultAdministratorRights::new(),
1208        )
1209    }
1210
1211    type GetMyDefaultAdministratorRights = JsonRequest<payloads::GetMyDefaultAdministratorRights>;
1212
1213    fn get_my_default_administrator_rights(&self) -> Self::GetMyDefaultAdministratorRights {
1214        Self::GetMyDefaultAdministratorRights::new(
1215            self.clone(),
1216            payloads::GetMyDefaultAdministratorRights::new(),
1217        )
1218    }
1219
1220    type DeleteMyCommands = JsonRequest<payloads::DeleteMyCommands>;
1221
1222    fn delete_my_commands(&self) -> Self::DeleteMyCommands {
1223        Self::DeleteMyCommands::new(self.clone(), payloads::DeleteMyCommands::new())
1224    }
1225
1226    type AnswerInlineQuery = JsonRequest<payloads::AnswerInlineQuery>;
1227
1228    fn answer_inline_query<R>(
1229        &self,
1230        inline_query_id: InlineQueryId,
1231        results: R,
1232    ) -> Self::AnswerInlineQuery
1233    where
1234        R: IntoIterator<Item = InlineQueryResult>,
1235    {
1236        Self::AnswerInlineQuery::new(
1237            self.clone(),
1238            payloads::AnswerInlineQuery::new(inline_query_id, results),
1239        )
1240    }
1241
1242    type AnswerWebAppQuery = JsonRequest<payloads::AnswerWebAppQuery>;
1243
1244    fn answer_web_app_query<W>(
1245        &self,
1246        web_app_query_id: W,
1247        result: InlineQueryResult,
1248    ) -> Self::AnswerWebAppQuery
1249    where
1250        W: Into<String>,
1251    {
1252        Self::AnswerWebAppQuery::new(
1253            self.clone(),
1254            payloads::AnswerWebAppQuery::new(web_app_query_id, result),
1255        )
1256    }
1257
1258    type SavePreparedInlineMessage = JsonRequest<payloads::SavePreparedInlineMessage>;
1259
1260    fn save_prepared_inline_message(
1261        &self,
1262        user_id: UserId,
1263        result: InlineQueryResult,
1264    ) -> Self::SavePreparedInlineMessage {
1265        Self::SavePreparedInlineMessage::new(
1266            self.clone(),
1267            payloads::SavePreparedInlineMessage::new(user_id, result),
1268        )
1269    }
1270
1271    type EditMessageText = JsonRequest<payloads::EditMessageText>;
1272
1273    fn edit_message_text<C, T>(
1274        &self,
1275        chat_id: C,
1276        message_id: MessageId,
1277        text: T,
1278    ) -> Self::EditMessageText
1279    where
1280        C: Into<Recipient>,
1281        T: Into<String>,
1282    {
1283        Self::EditMessageText::new(
1284            self.clone(),
1285            payloads::EditMessageText::new(chat_id, message_id, text),
1286        )
1287    }
1288
1289    type EditMessageTextInline = JsonRequest<payloads::EditMessageTextInline>;
1290
1291    fn edit_message_text_inline<I, T>(
1292        &self,
1293        inline_message_id: I,
1294        text: T,
1295    ) -> Self::EditMessageTextInline
1296    where
1297        I: Into<String>,
1298        T: Into<String>,
1299    {
1300        Self::EditMessageTextInline::new(
1301            self.clone(),
1302            payloads::EditMessageTextInline::new(inline_message_id, text),
1303        )
1304    }
1305
1306    type EditMessageCaption = JsonRequest<payloads::EditMessageCaption>;
1307
1308    fn edit_message_caption<C>(&self, chat_id: C, message_id: MessageId) -> Self::EditMessageCaption
1309    where
1310        C: Into<Recipient>,
1311    {
1312        Self::EditMessageCaption::new(
1313            self.clone(),
1314            payloads::EditMessageCaption::new(chat_id, message_id),
1315        )
1316    }
1317
1318    type EditMessageCaptionInline = JsonRequest<payloads::EditMessageCaptionInline>;
1319
1320    fn edit_message_caption_inline<I>(&self, inline_message_id: I) -> Self::EditMessageCaptionInline
1321    where
1322        I: Into<String>,
1323    {
1324        Self::EditMessageCaptionInline::new(
1325            self.clone(),
1326            payloads::EditMessageCaptionInline::new(inline_message_id),
1327        )
1328    }
1329
1330    type EditMessageMedia = MultipartRequest<payloads::EditMessageMedia>;
1331
1332    fn edit_message_media<C>(
1333        &self,
1334        chat_id: C,
1335        message_id: MessageId,
1336        media: InputMedia,
1337    ) -> Self::EditMessageMedia
1338    where
1339        C: Into<Recipient>,
1340    {
1341        Self::EditMessageMedia::new(
1342            self.clone(),
1343            payloads::EditMessageMedia::new(chat_id, message_id, media),
1344        )
1345    }
1346
1347    type EditMessageMediaInline = MultipartRequest<payloads::EditMessageMediaInline>;
1348
1349    fn edit_message_media_inline<I>(
1350        &self,
1351        inline_message_id: I,
1352        media: InputMedia,
1353    ) -> Self::EditMessageMediaInline
1354    where
1355        I: Into<String>,
1356    {
1357        Self::EditMessageMediaInline::new(
1358            self.clone(),
1359            payloads::EditMessageMediaInline::new(inline_message_id, media),
1360        )
1361    }
1362
1363    type EditMessageReplyMarkup = JsonRequest<payloads::EditMessageReplyMarkup>;
1364
1365    fn edit_message_reply_markup<C>(
1366        &self,
1367        chat_id: C,
1368        message_id: MessageId,
1369    ) -> Self::EditMessageReplyMarkup
1370    where
1371        C: Into<Recipient>,
1372    {
1373        Self::EditMessageReplyMarkup::new(
1374            self.clone(),
1375            payloads::EditMessageReplyMarkup::new(chat_id, message_id),
1376        )
1377    }
1378
1379    type EditMessageReplyMarkupInline = JsonRequest<payloads::EditMessageReplyMarkupInline>;
1380
1381    fn edit_message_reply_markup_inline<I>(
1382        &self,
1383        inline_message_id: I,
1384    ) -> Self::EditMessageReplyMarkupInline
1385    where
1386        I: Into<String>,
1387    {
1388        Self::EditMessageReplyMarkupInline::new(
1389            self.clone(),
1390            payloads::EditMessageReplyMarkupInline::new(inline_message_id),
1391        )
1392    }
1393
1394    type StopPoll = JsonRequest<payloads::StopPoll>;
1395
1396    fn stop_poll<C>(&self, chat_id: C, message_id: MessageId) -> Self::StopPoll
1397    where
1398        C: Into<Recipient>,
1399    {
1400        Self::StopPoll::new(self.clone(), payloads::StopPoll::new(chat_id, message_id))
1401    }
1402
1403    type ApproveSuggestedPost = JsonRequest<payloads::ApproveSuggestedPost>;
1404
1405    fn approve_suggested_post<C>(
1406        &self,
1407        chat_id: C,
1408        message_id: MessageId,
1409    ) -> Self::ApproveSuggestedPost
1410    where
1411        C: Into<ChatId>,
1412    {
1413        Self::ApproveSuggestedPost::new(
1414            self.clone(),
1415            payloads::ApproveSuggestedPost::new(chat_id, message_id),
1416        )
1417    }
1418
1419    type DeclineSuggestedPost = JsonRequest<payloads::DeclineSuggestedPost>;
1420
1421    fn decline_suggested_post<C>(
1422        &self,
1423        chat_id: C,
1424        message_id: MessageId,
1425    ) -> Self::DeclineSuggestedPost
1426    where
1427        C: Into<ChatId>,
1428    {
1429        Self::DeclineSuggestedPost::new(
1430            self.clone(),
1431            payloads::DeclineSuggestedPost::new(chat_id, message_id),
1432        )
1433    }
1434
1435    type DeleteMessage = JsonRequest<payloads::DeleteMessage>;
1436
1437    fn delete_message<C>(&self, chat_id: C, message_id: MessageId) -> Self::DeleteMessage
1438    where
1439        C: Into<Recipient>,
1440    {
1441        Self::DeleteMessage::new(self.clone(), payloads::DeleteMessage::new(chat_id, message_id))
1442    }
1443
1444    type DeleteMessages = JsonRequest<payloads::DeleteMessages>;
1445    fn delete_messages<C, M>(&self, chat_id: C, message_ids: M) -> Self::DeleteMessages
1446    where
1447        C: Into<Recipient>,
1448        M: IntoIterator<Item = MessageId>,
1449    {
1450        Self::DeleteMessages::new(self.clone(), payloads::DeleteMessages::new(chat_id, message_ids))
1451    }
1452
1453    type SendSticker = MultipartRequest<payloads::SendSticker>;
1454
1455    fn send_sticker<C>(&self, chat_id: C, sticker: InputFile) -> Self::SendSticker
1456    where
1457        C: Into<Recipient>,
1458    {
1459        Self::SendSticker::new(self.clone(), payloads::SendSticker::new(chat_id, sticker))
1460    }
1461
1462    type GetStickerSet = JsonRequest<payloads::GetStickerSet>;
1463
1464    fn get_sticker_set<N>(&self, name: N) -> Self::GetStickerSet
1465    where
1466        N: Into<String>,
1467    {
1468        Self::GetStickerSet::new(self.clone(), payloads::GetStickerSet::new(name))
1469    }
1470
1471    type GetCustomEmojiStickers = JsonRequest<payloads::GetCustomEmojiStickers>;
1472
1473    fn get_custom_emoji_stickers<C>(&self, custom_emoji_ids: C) -> Self::GetCustomEmojiStickers
1474    where
1475        C: IntoIterator<Item = CustomEmojiId>,
1476    {
1477        Self::GetCustomEmojiStickers::new(
1478            self.clone(),
1479            payloads::GetCustomEmojiStickers::new(custom_emoji_ids),
1480        )
1481    }
1482
1483    type UploadStickerFile = MultipartRequest<payloads::UploadStickerFile>;
1484
1485    fn upload_sticker_file(
1486        &self,
1487        user_id: UserId,
1488        sticker: InputFile,
1489        sticker_format: StickerFormat,
1490    ) -> Self::UploadStickerFile {
1491        Self::UploadStickerFile::new(
1492            self.clone(),
1493            payloads::UploadStickerFile::new(user_id, sticker, sticker_format),
1494        )
1495    }
1496
1497    type CreateNewStickerSet = MultipartRequest<payloads::CreateNewStickerSet>;
1498
1499    fn create_new_sticker_set<N, T, S>(
1500        &self,
1501        user_id: UserId,
1502        name: N,
1503        title: T,
1504        stickers: S,
1505    ) -> Self::CreateNewStickerSet
1506    where
1507        N: Into<String>,
1508        T: Into<String>,
1509        S: IntoIterator<Item = InputSticker>,
1510    {
1511        Self::CreateNewStickerSet::new(
1512            self.clone(),
1513            payloads::CreateNewStickerSet::new(user_id, name, title, stickers),
1514        )
1515    }
1516
1517    type AddStickerToSet = MultipartRequest<payloads::AddStickerToSet>;
1518
1519    fn add_sticker_to_set<N>(
1520        &self,
1521        user_id: UserId,
1522        name: N,
1523        sticker: InputSticker,
1524    ) -> Self::AddStickerToSet
1525    where
1526        N: Into<String>,
1527    {
1528        Self::AddStickerToSet::new(
1529            self.clone(),
1530            payloads::AddStickerToSet::new(user_id, name, sticker),
1531        )
1532    }
1533
1534    type SetStickerPositionInSet = JsonRequest<payloads::SetStickerPositionInSet>;
1535
1536    fn set_sticker_position_in_set<S>(
1537        &self,
1538        sticker: S,
1539        position: u32,
1540    ) -> Self::SetStickerPositionInSet
1541    where
1542        S: Into<String>,
1543    {
1544        Self::SetStickerPositionInSet::new(
1545            self.clone(),
1546            payloads::SetStickerPositionInSet::new(sticker, position),
1547        )
1548    }
1549
1550    type DeleteStickerFromSet = JsonRequest<payloads::DeleteStickerFromSet>;
1551
1552    fn delete_sticker_from_set<S>(&self, sticker: S) -> Self::DeleteStickerFromSet
1553    where
1554        S: Into<String>,
1555    {
1556        Self::DeleteStickerFromSet::new(self.clone(), payloads::DeleteStickerFromSet::new(sticker))
1557    }
1558
1559    type ReplaceStickerInSet = JsonRequest<payloads::ReplaceStickerInSet>;
1560
1561    fn replace_sticker_in_set<N, O>(
1562        &self,
1563        user_id: UserId,
1564        name: N,
1565        old_sticker: O,
1566        sticker: InputSticker,
1567    ) -> Self::ReplaceStickerInSet
1568    where
1569        N: Into<String>,
1570        O: Into<String>,
1571    {
1572        Self::ReplaceStickerInSet::new(
1573            self.clone(),
1574            payloads::ReplaceStickerInSet {
1575                user_id,
1576                name: name.into(),
1577                old_sticker: old_sticker.into(),
1578                sticker,
1579            },
1580        )
1581    }
1582
1583    type SetStickerSetThumbnail = MultipartRequest<payloads::SetStickerSetThumbnail>;
1584
1585    fn set_sticker_set_thumbnail<N>(
1586        &self,
1587        name: N,
1588        user_id: UserId,
1589        format: StickerFormat,
1590    ) -> Self::SetStickerSetThumbnail
1591    where
1592        N: Into<String>,
1593    {
1594        Self::SetStickerSetThumbnail::new(
1595            self.clone(),
1596            payloads::SetStickerSetThumbnail::new(name, user_id, format),
1597        )
1598    }
1599
1600    type SetCustomEmojiStickerSetThumbnail =
1601        JsonRequest<payloads::SetCustomEmojiStickerSetThumbnail>;
1602
1603    fn set_custom_emoji_sticker_set_thumbnail<N>(
1604        &self,
1605        name: N,
1606    ) -> Self::SetCustomEmojiStickerSetThumbnail
1607    where
1608        N: Into<String>,
1609    {
1610        Self::SetCustomEmojiStickerSetThumbnail::new(
1611            self.clone(),
1612            payloads::SetCustomEmojiStickerSetThumbnail::new(name),
1613        )
1614    }
1615
1616    type SetStickerSetTitle = JsonRequest<payloads::SetStickerSetTitle>;
1617
1618    fn set_sticker_set_title<N, T>(&self, name: N, title: T) -> Self::SetStickerSetTitle
1619    where
1620        N: Into<String>,
1621        T: Into<String>,
1622    {
1623        Self::SetStickerSetTitle::new(self.clone(), payloads::SetStickerSetTitle::new(name, title))
1624    }
1625
1626    type DeleteStickerSet = JsonRequest<payloads::DeleteStickerSet>;
1627
1628    fn delete_sticker_set<N>(&self, name: N) -> Self::DeleteStickerSet
1629    where
1630        N: Into<String>,
1631    {
1632        Self::DeleteStickerSet::new(self.clone(), payloads::DeleteStickerSet::new(name))
1633    }
1634
1635    type SetStickerEmojiList = JsonRequest<payloads::SetStickerEmojiList>;
1636
1637    fn set_sticker_emoji_list<S, E>(&self, sticker: S, emoji_list: E) -> Self::SetStickerEmojiList
1638    where
1639        S: Into<String>,
1640        E: IntoIterator<Item = String>,
1641    {
1642        Self::SetStickerEmojiList::new(
1643            self.clone(),
1644            payloads::SetStickerEmojiList::new(sticker, emoji_list),
1645        )
1646    }
1647
1648    type SetStickerKeywords = JsonRequest<payloads::SetStickerKeywords>;
1649
1650    fn set_sticker_keywords<S>(&self, sticker: S) -> Self::SetStickerKeywords
1651    where
1652        S: Into<String>,
1653    {
1654        Self::SetStickerKeywords::new(self.clone(), payloads::SetStickerKeywords::new(sticker))
1655    }
1656
1657    type SetStickerMaskPosition = JsonRequest<payloads::SetStickerMaskPosition>;
1658
1659    fn set_sticker_mask_position<S>(&self, sticker: S) -> Self::SetStickerMaskPosition
1660    where
1661        S: Into<String>,
1662    {
1663        Self::SetStickerMaskPosition::new(
1664            self.clone(),
1665            payloads::SetStickerMaskPosition::new(sticker),
1666        )
1667    }
1668
1669    type GetAvailableGifts = JsonRequest<payloads::GetAvailableGifts>;
1670
1671    fn get_available_gifts(&self) -> Self::GetAvailableGifts {
1672        Self::GetAvailableGifts::new(self.clone(), payloads::GetAvailableGifts::new())
1673    }
1674
1675    type SendGift = JsonRequest<payloads::SendGift>;
1676
1677    fn send_gift(&self, user_id: UserId, gift_id: GiftId) -> Self::SendGift {
1678        Self::SendGift::new(self.clone(), payloads::SendGift::new(user_id, gift_id))
1679    }
1680
1681    type SendGiftChat = JsonRequest<payloads::SendGiftChat>;
1682
1683    fn send_gift_chat<C>(&self, chat_id: C, gift_id: GiftId) -> Self::SendGiftChat
1684    where
1685        C: Into<Recipient>,
1686    {
1687        Self::SendGiftChat::new(self.clone(), payloads::SendGiftChat::new(chat_id, gift_id))
1688    }
1689
1690    type GiftPremiumSubscription = JsonRequest<payloads::GiftPremiumSubscription>;
1691
1692    fn gift_premium_subscription(
1693        &self,
1694        user_id: UserId,
1695        month_count: u8,
1696        star_count: u32,
1697    ) -> Self::GiftPremiumSubscription {
1698        Self::GiftPremiumSubscription::new(
1699            self.clone(),
1700            payloads::GiftPremiumSubscription::new(user_id, month_count, star_count),
1701        )
1702    }
1703
1704    type VerifyUser = JsonRequest<payloads::VerifyUser>;
1705
1706    fn verify_user(&self, user_id: UserId) -> Self::VerifyUser {
1707        Self::VerifyUser::new(self.clone(), payloads::VerifyUser::new(user_id))
1708    }
1709
1710    type VerifyChat = JsonRequest<payloads::VerifyChat>;
1711
1712    fn verify_chat<C>(&self, chat_id: C) -> Self::VerifyChat
1713    where
1714        C: Into<Recipient>,
1715    {
1716        Self::VerifyChat::new(self.clone(), payloads::VerifyChat::new(chat_id))
1717    }
1718
1719    type RemoveUserVerification = JsonRequest<payloads::RemoveUserVerification>;
1720
1721    fn remove_user_verification(&self, user_id: UserId) -> Self::RemoveUserVerification {
1722        Self::RemoveUserVerification::new(
1723            self.clone(),
1724            payloads::RemoveUserVerification::new(user_id),
1725        )
1726    }
1727
1728    type RemoveChatVerification = JsonRequest<payloads::RemoveChatVerification>;
1729
1730    fn remove_chat_verification<C>(&self, chat_id: C) -> Self::RemoveChatVerification
1731    where
1732        C: Into<Recipient>,
1733    {
1734        Self::RemoveChatVerification::new(
1735            self.clone(),
1736            payloads::RemoveChatVerification::new(chat_id),
1737        )
1738    }
1739
1740    type ReadBusinessMessage = JsonRequest<payloads::ReadBusinessMessage>;
1741
1742    fn read_business_message<C>(
1743        &self,
1744        business_connection_id: BusinessConnectionId,
1745        chat_id: C,
1746        message_id: MessageId,
1747    ) -> Self::ReadBusinessMessage
1748    where
1749        C: Into<ChatId>,
1750    {
1751        Self::ReadBusinessMessage::new(
1752            self.clone(),
1753            payloads::ReadBusinessMessage::new(business_connection_id, chat_id, message_id),
1754        )
1755    }
1756
1757    type DeleteBusinessMessages = JsonRequest<payloads::DeleteBusinessMessages>;
1758
1759    fn delete_business_messages<M>(
1760        &self,
1761        business_connection_id: BusinessConnectionId,
1762        message_ids: M,
1763    ) -> Self::DeleteBusinessMessages
1764    where
1765        M: IntoIterator<Item = MessageId>,
1766    {
1767        Self::DeleteBusinessMessages::new(
1768            self.clone(),
1769            payloads::DeleteBusinessMessages::new(business_connection_id, message_ids),
1770        )
1771    }
1772
1773    type SetBusinessAccountName = JsonRequest<payloads::SetBusinessAccountName>;
1774
1775    fn set_business_account_name<F>(
1776        &self,
1777        business_connection_id: BusinessConnectionId,
1778        first_name: F,
1779    ) -> Self::SetBusinessAccountName
1780    where
1781        F: Into<String>,
1782    {
1783        Self::SetBusinessAccountName::new(
1784            self.clone(),
1785            payloads::SetBusinessAccountName::new(business_connection_id, first_name),
1786        )
1787    }
1788
1789    type SetBusinessAccountUsername = JsonRequest<payloads::SetBusinessAccountUsername>;
1790
1791    fn set_business_account_username(
1792        &self,
1793        business_connection_id: BusinessConnectionId,
1794    ) -> Self::SetBusinessAccountUsername {
1795        Self::SetBusinessAccountUsername::new(
1796            self.clone(),
1797            payloads::SetBusinessAccountUsername::new(business_connection_id),
1798        )
1799    }
1800
1801    type SetBusinessAccountBio = JsonRequest<payloads::SetBusinessAccountBio>;
1802
1803    fn set_business_account_bio(
1804        &self,
1805        business_connection_id: BusinessConnectionId,
1806    ) -> Self::SetBusinessAccountBio {
1807        Self::SetBusinessAccountBio::new(
1808            self.clone(),
1809            payloads::SetBusinessAccountBio::new(business_connection_id),
1810        )
1811    }
1812
1813    type SetBusinessAccountProfilePhoto = JsonRequest<payloads::SetBusinessAccountProfilePhoto>;
1814
1815    fn set_business_account_profile_photo(
1816        &self,
1817        business_connection_id: BusinessConnectionId,
1818        photo: InputProfilePhoto,
1819    ) -> Self::SetBusinessAccountProfilePhoto {
1820        Self::SetBusinessAccountProfilePhoto::new(
1821            self.clone(),
1822            payloads::SetBusinessAccountProfilePhoto::new(business_connection_id, photo),
1823        )
1824    }
1825
1826    type RemoveBusinessAccountProfilePhoto =
1827        JsonRequest<payloads::RemoveBusinessAccountProfilePhoto>;
1828
1829    fn remove_business_account_profile_photo(
1830        &self,
1831        business_connection_id: BusinessConnectionId,
1832    ) -> Self::RemoveBusinessAccountProfilePhoto {
1833        Self::RemoveBusinessAccountProfilePhoto::new(
1834            self.clone(),
1835            payloads::RemoveBusinessAccountProfilePhoto::new(business_connection_id),
1836        )
1837    }
1838
1839    type SetBusinessAccountGiftSettings = JsonRequest<payloads::SetBusinessAccountGiftSettings>;
1840
1841    fn set_business_account_gift_settings(
1842        &self,
1843        business_connection_id: BusinessConnectionId,
1844        show_gift_button: bool,
1845        accepted_gift_types: AcceptedGiftTypes,
1846    ) -> Self::SetBusinessAccountGiftSettings {
1847        Self::SetBusinessAccountGiftSettings::new(
1848            self.clone(),
1849            payloads::SetBusinessAccountGiftSettings::new(
1850                business_connection_id,
1851                show_gift_button,
1852                accepted_gift_types,
1853            ),
1854        )
1855    }
1856
1857    type GetBusinessAccountStarBalance = JsonRequest<payloads::GetBusinessAccountStarBalance>;
1858
1859    fn get_business_account_star_balance(
1860        &self,
1861        business_connection_id: BusinessConnectionId,
1862    ) -> Self::GetBusinessAccountStarBalance {
1863        Self::GetBusinessAccountStarBalance::new(
1864            self.clone(),
1865            payloads::GetBusinessAccountStarBalance::new(business_connection_id),
1866        )
1867    }
1868
1869    type TransferBusinessAccountStars = JsonRequest<payloads::TransferBusinessAccountStars>;
1870
1871    fn transfer_business_account_stars(
1872        &self,
1873        business_connection_id: BusinessConnectionId,
1874        star_count: u32,
1875    ) -> Self::TransferBusinessAccountStars {
1876        Self::TransferBusinessAccountStars::new(
1877            self.clone(),
1878            payloads::TransferBusinessAccountStars::new(business_connection_id, star_count),
1879        )
1880    }
1881
1882    type GetBusinessAccountGifts = JsonRequest<payloads::GetBusinessAccountGifts>;
1883
1884    fn get_business_account_gifts(
1885        &self,
1886        business_connection_id: BusinessConnectionId,
1887    ) -> Self::GetBusinessAccountGifts {
1888        Self::GetBusinessAccountGifts::new(
1889            self.clone(),
1890            payloads::GetBusinessAccountGifts::new(business_connection_id),
1891        )
1892    }
1893
1894    type GetUserGifts = JsonRequest<payloads::GetUserGifts>;
1895
1896    fn get_user_gifts(&self, user_id: UserId) -> Self::GetUserGifts {
1897        Self::GetUserGifts::new(self.clone(), payloads::GetUserGifts::new(user_id))
1898    }
1899
1900    type GetChatGifts = JsonRequest<payloads::GetChatGifts>;
1901
1902    fn get_chat_gifts<C>(&self, chat_id: C) -> Self::GetChatGifts
1903    where
1904        C: Into<Recipient>,
1905    {
1906        Self::GetChatGifts::new(self.clone(), payloads::GetChatGifts::new(chat_id))
1907    }
1908
1909    type RepostStory = JsonRequest<payloads::RepostStory>;
1910
1911    fn repost_story<F>(
1912        &self,
1913        business_connection_id: BusinessConnectionId,
1914        from_chat_id: F,
1915        from_story_id: StoryId,
1916        active_period: Seconds,
1917    ) -> Self::RepostStory
1918    where
1919        F: Into<ChatId>,
1920    {
1921        Self::RepostStory::new(
1922            self.clone(),
1923            payloads::RepostStory::new(
1924                business_connection_id,
1925                from_chat_id,
1926                from_story_id,
1927                active_period,
1928            ),
1929        )
1930    }
1931
1932    type ConvertGiftToStars = JsonRequest<payloads::ConvertGiftToStars>;
1933
1934    fn convert_gift_to_stars(
1935        &self,
1936        business_connection_id: BusinessConnectionId,
1937        owned_gift_id: OwnedGiftId,
1938    ) -> Self::ConvertGiftToStars {
1939        Self::ConvertGiftToStars::new(
1940            self.clone(),
1941            payloads::ConvertGiftToStars::new(business_connection_id, owned_gift_id),
1942        )
1943    }
1944
1945    type UpgradeGift = JsonRequest<payloads::UpgradeGift>;
1946
1947    fn upgrade_gift(
1948        &self,
1949        business_connection_id: BusinessConnectionId,
1950        owned_gift_id: OwnedGiftId,
1951    ) -> Self::UpgradeGift {
1952        Self::UpgradeGift::new(
1953            self.clone(),
1954            payloads::UpgradeGift::new(business_connection_id, owned_gift_id),
1955        )
1956    }
1957
1958    type TransferGift = JsonRequest<payloads::TransferGift>;
1959
1960    fn transfer_gift<C>(
1961        &self,
1962        business_connection_id: BusinessConnectionId,
1963        owned_gift_id: OwnedGiftId,
1964        new_owner_chat_id: C,
1965    ) -> Self::TransferGift
1966    where
1967        C: Into<ChatId>,
1968    {
1969        Self::TransferGift::new(
1970            self.clone(),
1971            payloads::TransferGift::new(business_connection_id, owned_gift_id, new_owner_chat_id),
1972        )
1973    }
1974
1975    type PostStory = JsonRequest<payloads::PostStory>;
1976
1977    fn post_story(
1978        &self,
1979        business_connection_id: BusinessConnectionId,
1980        content: InputStoryContent,
1981        active_period: Seconds,
1982    ) -> Self::PostStory {
1983        Self::PostStory::new(
1984            self.clone(),
1985            payloads::PostStory::new(business_connection_id, content, active_period),
1986        )
1987    }
1988
1989    type EditStory = JsonRequest<payloads::EditStory>;
1990
1991    fn edit_story(
1992        &self,
1993        business_connection_id: BusinessConnectionId,
1994        story_id: StoryId,
1995        content: InputStoryContent,
1996    ) -> Self::EditStory {
1997        Self::EditStory::new(
1998            self.clone(),
1999            payloads::EditStory::new(business_connection_id, story_id, content),
2000        )
2001    }
2002
2003    type DeleteStory = JsonRequest<payloads::DeleteStory>;
2004
2005    fn delete_story(
2006        &self,
2007        business_connection_id: BusinessConnectionId,
2008        story_id: StoryId,
2009    ) -> Self::DeleteStory {
2010        Self::DeleteStory::new(
2011            self.clone(),
2012            payloads::DeleteStory::new(business_connection_id, story_id),
2013        )
2014    }
2015
2016    type SendInvoice = JsonRequest<payloads::SendInvoice>;
2017
2018    fn send_invoice<Ch, T, D, Pa, C, Pri>(
2019        &self,
2020        chat_id: Ch,
2021        title: T,
2022        description: D,
2023        payload: Pa,
2024        currency: C,
2025        prices: Pri,
2026    ) -> Self::SendInvoice
2027    where
2028        Ch: Into<Recipient>,
2029        T: Into<String>,
2030        D: Into<String>,
2031        Pa: Into<String>,
2032        C: Into<String>,
2033        Pri: IntoIterator<Item = LabeledPrice>,
2034    {
2035        Self::SendInvoice::new(
2036            self.clone(),
2037            payloads::SendInvoice::new(chat_id, title, description, payload, currency, prices),
2038        )
2039    }
2040
2041    type CreateInvoiceLink = JsonRequest<payloads::CreateInvoiceLink>;
2042
2043    fn create_invoice_link<T, D, Pa, C, Pri>(
2044        &self,
2045        title: T,
2046        description: D,
2047        payload: Pa,
2048        currency: C,
2049        prices: Pri,
2050    ) -> Self::CreateInvoiceLink
2051    where
2052        T: Into<String>,
2053        D: Into<String>,
2054        Pa: Into<String>,
2055        C: Into<String>,
2056        Pri: IntoIterator<Item = LabeledPrice>,
2057    {
2058        Self::CreateInvoiceLink::new(
2059            self.clone(),
2060            payloads::CreateInvoiceLink::new(title, description, payload, currency, prices),
2061        )
2062    }
2063
2064    type AnswerShippingQuery = JsonRequest<payloads::AnswerShippingQuery>;
2065
2066    fn answer_shipping_query(
2067        &self,
2068        shipping_query_id: ShippingQueryId,
2069        ok: bool,
2070    ) -> Self::AnswerShippingQuery {
2071        Self::AnswerShippingQuery::new(
2072            self.clone(),
2073            payloads::AnswerShippingQuery::new(shipping_query_id, ok),
2074        )
2075    }
2076
2077    type AnswerPreCheckoutQuery = JsonRequest<payloads::AnswerPreCheckoutQuery>;
2078
2079    fn answer_pre_checkout_query(
2080        &self,
2081        pre_checkout_query_id: PreCheckoutQueryId,
2082        ok: bool,
2083    ) -> Self::AnswerPreCheckoutQuery {
2084        Self::AnswerPreCheckoutQuery::new(
2085            self.clone(),
2086            payloads::AnswerPreCheckoutQuery::new(pre_checkout_query_id, ok),
2087        )
2088    }
2089
2090    type GetMyStarBalance = JsonRequest<payloads::GetMyStarBalance>;
2091
2092    fn get_my_star_balance(&self) -> Self::GetMyStarBalance {
2093        Self::GetMyStarBalance::new(self.clone(), payloads::GetMyStarBalance::new())
2094    }
2095
2096    type GetStarTransactions = JsonRequest<payloads::GetStarTransactions>;
2097
2098    fn get_star_transactions(&self) -> Self::GetStarTransactions {
2099        Self::GetStarTransactions::new(self.clone(), payloads::GetStarTransactions::new())
2100    }
2101
2102    type RefundStarPayment = JsonRequest<payloads::RefundStarPayment>;
2103
2104    fn refund_star_payment(
2105        &self,
2106        user_id: UserId,
2107        telegram_payment_charge_id: TelegramTransactionId,
2108    ) -> Self::RefundStarPayment {
2109        Self::RefundStarPayment::new(
2110            self.clone(),
2111            payloads::RefundStarPayment::new(user_id, telegram_payment_charge_id),
2112        )
2113    }
2114
2115    type EditUserStarSubscription = JsonRequest<payloads::EditUserStarSubscription>;
2116
2117    fn edit_user_star_subscription(
2118        &self,
2119        user_id: UserId,
2120        telegram_payment_charge_id: TelegramTransactionId,
2121        is_canceled: bool,
2122    ) -> Self::EditUserStarSubscription {
2123        Self::EditUserStarSubscription::new(
2124            self.clone(),
2125            payloads::EditUserStarSubscription::new(
2126                user_id,
2127                telegram_payment_charge_id,
2128                is_canceled,
2129            ),
2130        )
2131    }
2132
2133    type SetPassportDataErrors = JsonRequest<payloads::SetPassportDataErrors>;
2134
2135    fn set_passport_data_errors<E>(&self, user_id: UserId, errors: E) -> Self::SetPassportDataErrors
2136    where
2137        E: IntoIterator<Item = crate::types::PassportElementError>,
2138    {
2139        Self::SetPassportDataErrors::new(
2140            self.clone(),
2141            payloads::SetPassportDataErrors::new(user_id, errors),
2142        )
2143    }
2144
2145    type SendGame = JsonRequest<payloads::SendGame>;
2146
2147    fn send_game<C, G>(&self, chat_id: C, game_short_name: G) -> Self::SendGame
2148    where
2149        C: Into<ChatId>,
2150        G: Into<String>,
2151    {
2152        Self::SendGame::new(self.clone(), payloads::SendGame::new(chat_id, game_short_name))
2153    }
2154
2155    type SetGameScore = JsonRequest<payloads::SetGameScore>;
2156
2157    fn set_game_score(
2158        &self,
2159        user_id: UserId,
2160        score: u64,
2161        chat_id: u32,
2162        message_id: MessageId,
2163    ) -> Self::SetGameScore {
2164        Self::SetGameScore::new(
2165            self.clone(),
2166            payloads::SetGameScore::new(user_id, score, chat_id, message_id),
2167        )
2168    }
2169
2170    type SetGameScoreInline = JsonRequest<payloads::SetGameScoreInline>;
2171
2172    fn set_game_score_inline<I>(
2173        &self,
2174        user_id: UserId,
2175        score: u64,
2176        inline_message_id: I,
2177    ) -> Self::SetGameScoreInline
2178    where
2179        I: Into<String>,
2180    {
2181        Self::SetGameScoreInline::new(
2182            self.clone(),
2183            payloads::SetGameScoreInline::new(user_id, score, inline_message_id),
2184        )
2185    }
2186
2187    type GetGameHighScores = JsonRequest<payloads::GetGameHighScores>;
2188
2189    fn get_game_high_scores<T>(&self, user_id: UserId, target: T) -> Self::GetGameHighScores
2190    where
2191        T: Into<crate::types::TargetMessage>,
2192    {
2193        Self::GetGameHighScores::new(
2194            self.clone(),
2195            payloads::GetGameHighScores::new(user_id, target),
2196        )
2197    }
2198
2199    type LogOut = JsonRequest<payloads::LogOut>;
2200
2201    fn log_out(&self) -> Self::LogOut {
2202        Self::LogOut::new(self.clone(), payloads::LogOut::new())
2203    }
2204
2205    type Close = JsonRequest<payloads::Close>;
2206
2207    fn close(&self) -> Self::Close {
2208        Self::Close::new(self.clone(), payloads::Close::new())
2209    }
2210
2211    type CopyMessage = JsonRequest<payloads::CopyMessage>;
2212
2213    fn copy_message<C, F>(
2214        &self,
2215        chat_id: C,
2216        from_chat_id: F,
2217        message_id: MessageId,
2218    ) -> Self::CopyMessage
2219    where
2220        C: Into<Recipient>,
2221        F: Into<Recipient>,
2222    {
2223        Self::CopyMessage::new(
2224            self.clone(),
2225            payloads::CopyMessage::new(chat_id, from_chat_id, message_id),
2226        )
2227    }
2228
2229    type CopyMessages = JsonRequest<payloads::CopyMessages>;
2230    fn copy_messages<C, F, M>(
2231        &self,
2232        chat_id: C,
2233        from_chat_id: F,
2234        message_ids: M,
2235    ) -> Self::CopyMessages
2236    where
2237        C: Into<Recipient>,
2238        F: Into<Recipient>,
2239        M: IntoIterator<Item = MessageId>,
2240    {
2241        Self::CopyMessages::new(
2242            self.clone(),
2243            payloads::CopyMessages::new(chat_id, from_chat_id, message_ids),
2244        )
2245    }
2246
2247    type UnpinAllChatMessages = JsonRequest<payloads::UnpinAllChatMessages>;
2248
2249    fn unpin_all_chat_messages<C>(&self, chat_id: C) -> Self::UnpinAllChatMessages
2250    where
2251        C: Into<Recipient>,
2252    {
2253        Self::UnpinAllChatMessages::new(self.clone(), payloads::UnpinAllChatMessages::new(chat_id))
2254    }
2255}