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