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