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