1#![allow(clippy::too_many_arguments)]
9
10use crate::bot::{Bot, ChatId, MessageOrBool};
11use crate::error::Result;
12use crate::types::{
13 chat_boost, games, input_checklist, message, message_entity, poll, reply, sent_web_app_message,
14 story, suggested_post, update, user, user_profile_audios, user_profile_photos, webhook_info,
15};
16use serde::Serialize;
17
18macro_rules! impl_into_future {
23 ($builder:ident, $output:ty) => {
24 impl<'a> std::future::IntoFuture for $builder<'a> {
25 type Output = Result<$output>;
26 type IntoFuture =
27 std::pin::Pin<Box<dyn std::future::Future<Output = Self::Output> + Send + 'a>>;
28 fn into_future(self) -> Self::IntoFuture {
29 Box::pin(self.send())
30 }
31 }
32 };
33}
34
35pub struct EditMessageLiveLocationBuilder<'a> {
45 bot: &'a Bot,
46 latitude: f64,
47 longitude: f64,
48 chat_id: Option<ChatId>,
49 message_id: Option<i64>,
50 inline_message_id: Option<String>,
51 horizontal_accuracy: Option<f64>,
52 heading: Option<i64>,
53 proximity_alert_radius: Option<i64>,
54 reply_markup: Option<serde_json::Value>,
55 live_period: Option<i64>,
56 business_connection_id: Option<String>,
57}
58
59impl<'a> EditMessageLiveLocationBuilder<'a> {
60 pub fn chat_id(mut self, val: impl Into<ChatId>) -> Self {
62 self.chat_id = Some(val.into());
63 self
64 }
65 pub fn message_id(mut self, val: i64) -> Self {
67 self.message_id = Some(val);
68 self
69 }
70 pub fn inline_message_id(mut self, val: impl Into<String>) -> Self {
72 self.inline_message_id = Some(val.into());
73 self
74 }
75 pub fn horizontal_accuracy(mut self, val: f64) -> Self {
77 self.horizontal_accuracy = Some(val);
78 self
79 }
80 pub fn heading(mut self, val: i64) -> Self {
82 self.heading = Some(val);
83 self
84 }
85 pub fn proximity_alert_radius(mut self, val: i64) -> Self {
87 self.proximity_alert_radius = Some(val);
88 self
89 }
90 pub fn reply_markup(mut self, val: serde_json::Value) -> Self {
92 self.reply_markup = Some(val);
93 self
94 }
95 pub fn live_period(mut self, val: i64) -> Self {
97 self.live_period = Some(val);
98 self
99 }
100 pub fn business_connection_id(mut self, val: impl Into<String>) -> Self {
102 self.business_connection_id = Some(val.into());
103 self
104 }
105
106 pub async fn send(self) -> Result<MessageOrBool> {
108 self.bot
109 .edit_message_live_location_raw(
110 self.latitude,
111 self.longitude,
112 self.chat_id,
113 self.message_id,
114 self.inline_message_id.as_deref(),
115 self.horizontal_accuracy,
116 self.heading,
117 self.proximity_alert_radius,
118 self.reply_markup,
119 self.live_period,
120 self.business_connection_id.as_deref(),
121 )
122 .await
123 }
124}
125
126impl_into_future!(EditMessageLiveLocationBuilder, MessageOrBool);
127
128pub struct StopMessageLiveLocationBuilder<'a> {
134 bot: &'a Bot,
135 chat_id: Option<ChatId>,
136 message_id: Option<i64>,
137 inline_message_id: Option<String>,
138 reply_markup: Option<serde_json::Value>,
139 business_connection_id: Option<String>,
140}
141
142impl<'a> StopMessageLiveLocationBuilder<'a> {
143 pub fn chat_id(mut self, val: impl Into<ChatId>) -> Self {
145 self.chat_id = Some(val.into());
146 self
147 }
148 pub fn message_id(mut self, val: i64) -> Self {
150 self.message_id = Some(val);
151 self
152 }
153 pub fn inline_message_id(mut self, val: impl Into<String>) -> Self {
155 self.inline_message_id = Some(val.into());
156 self
157 }
158 pub fn reply_markup(mut self, val: serde_json::Value) -> Self {
160 self.reply_markup = Some(val);
161 self
162 }
163 pub fn business_connection_id(mut self, val: impl Into<String>) -> Self {
165 self.business_connection_id = Some(val.into());
166 self
167 }
168
169 pub async fn send(self) -> Result<MessageOrBool> {
171 self.bot
172 .stop_message_live_location_raw(
173 self.chat_id,
174 self.message_id,
175 self.inline_message_id.as_deref(),
176 self.reply_markup,
177 self.business_connection_id.as_deref(),
178 )
179 .await
180 }
181}
182
183impl_into_future!(StopMessageLiveLocationBuilder, MessageOrBool);
184
185pub struct EditMessageChecklistBuilder<'a> {
191 bot: &'a Bot,
192 business_connection_id: String,
193 chat_id: i64,
194 message_id: i64,
195 checklist: input_checklist::InputChecklist,
196 reply_markup: Option<serde_json::Value>,
197}
198
199impl<'a> EditMessageChecklistBuilder<'a> {
200 pub fn reply_markup(mut self, val: serde_json::Value) -> Self {
202 self.reply_markup = Some(val);
203 self
204 }
205
206 pub async fn send(self) -> Result<message::Message> {
208 self.bot
209 .edit_message_checklist_raw(
210 &self.business_connection_id,
211 self.chat_id,
212 self.message_id,
213 self.checklist,
214 self.reply_markup,
215 )
216 .await
217 }
218}
219
220impl_into_future!(EditMessageChecklistBuilder, message::Message);
221
222pub struct StopPollBuilder<'a> {
228 bot: &'a Bot,
229 chat_id: ChatId,
230 message_id: i64,
231 reply_markup: Option<serde_json::Value>,
232 business_connection_id: Option<String>,
233}
234
235impl<'a> StopPollBuilder<'a> {
236 pub fn reply_markup(mut self, val: serde_json::Value) -> Self {
238 self.reply_markup = Some(val);
239 self
240 }
241 pub fn business_connection_id(mut self, val: impl Into<String>) -> Self {
243 self.business_connection_id = Some(val.into());
244 self
245 }
246
247 pub async fn send(self) -> Result<poll::Poll> {
249 self.bot
250 .stop_poll_raw(
251 self.chat_id,
252 self.message_id,
253 self.reply_markup,
254 self.business_connection_id.as_deref(),
255 )
256 .await
257 }
258}
259
260impl_into_future!(StopPollBuilder, poll::Poll);
261
262pub struct SendGameBuilder<'a> {
272 bot: &'a Bot,
273 chat_id: i64,
274 game_short_name: String,
275 disable_notification: Option<bool>,
276 protect_content: Option<bool>,
277 reply_parameters: Option<reply::ReplyParameters>,
278 reply_markup: Option<serde_json::Value>,
279 message_thread_id: Option<i64>,
280 business_connection_id: Option<String>,
281 message_effect_id: Option<String>,
282 allow_paid_broadcast: Option<bool>,
283}
284
285impl<'a> SendGameBuilder<'a> {
286 pub fn disable_notification(mut self, val: bool) -> Self {
288 self.disable_notification = Some(val);
289 self
290 }
291 pub fn protect_content(mut self, val: bool) -> Self {
293 self.protect_content = Some(val);
294 self
295 }
296 pub fn reply_parameters(mut self, val: reply::ReplyParameters) -> Self {
298 self.reply_parameters = Some(val);
299 self
300 }
301 pub fn reply_markup(mut self, val: serde_json::Value) -> Self {
303 self.reply_markup = Some(val);
304 self
305 }
306 pub fn message_thread_id(mut self, val: i64) -> Self {
308 self.message_thread_id = Some(val);
309 self
310 }
311 pub fn business_connection_id(mut self, val: impl Into<String>) -> Self {
313 self.business_connection_id = Some(val.into());
314 self
315 }
316 pub fn message_effect_id(mut self, val: impl Into<String>) -> Self {
318 self.message_effect_id = Some(val.into());
319 self
320 }
321 pub fn allow_paid_broadcast(mut self, val: bool) -> Self {
323 self.allow_paid_broadcast = Some(val);
324 self
325 }
326
327 pub async fn send(self) -> Result<message::Message> {
329 self.bot
330 .send_game_raw(
331 self.chat_id,
332 &self.game_short_name,
333 self.disable_notification,
334 self.protect_content,
335 self.reply_parameters,
336 self.reply_markup,
337 self.message_thread_id,
338 self.business_connection_id.as_deref(),
339 self.message_effect_id.as_deref(),
340 self.allow_paid_broadcast,
341 )
342 .await
343 }
344}
345
346impl_into_future!(SendGameBuilder, message::Message);
347
348pub struct SetGameScoreBuilder<'a> {
354 bot: &'a Bot,
355 user_id: i64,
356 score: i64,
357 force: Option<bool>,
358 disable_edit_message: Option<bool>,
359 chat_id: Option<i64>,
360 message_id: Option<i64>,
361 inline_message_id: Option<String>,
362}
363
364impl<'a> SetGameScoreBuilder<'a> {
365 pub fn force(mut self, val: bool) -> Self {
367 self.force = Some(val);
368 self
369 }
370 pub fn disable_edit_message(mut self, val: bool) -> Self {
372 self.disable_edit_message = Some(val);
373 self
374 }
375 pub fn chat_id(mut self, val: i64) -> Self {
377 self.chat_id = Some(val);
378 self
379 }
380 pub fn message_id(mut self, val: i64) -> Self {
382 self.message_id = Some(val);
383 self
384 }
385 pub fn inline_message_id(mut self, val: impl Into<String>) -> Self {
387 self.inline_message_id = Some(val.into());
388 self
389 }
390
391 pub async fn send(self) -> Result<MessageOrBool> {
393 self.bot
394 .set_game_score_raw(
395 self.user_id,
396 self.score,
397 self.force,
398 self.disable_edit_message,
399 self.chat_id,
400 self.message_id,
401 self.inline_message_id.as_deref(),
402 )
403 .await
404 }
405}
406
407impl_into_future!(SetGameScoreBuilder, MessageOrBool);
408
409pub struct GetGameHighScoresBuilder<'a> {
415 bot: &'a Bot,
416 user_id: i64,
417 chat_id: Option<i64>,
418 message_id: Option<i64>,
419 inline_message_id: Option<String>,
420}
421
422impl<'a> GetGameHighScoresBuilder<'a> {
423 pub fn chat_id(mut self, val: i64) -> Self {
425 self.chat_id = Some(val);
426 self
427 }
428 pub fn message_id(mut self, val: i64) -> Self {
430 self.message_id = Some(val);
431 self
432 }
433 pub fn inline_message_id(mut self, val: impl Into<String>) -> Self {
435 self.inline_message_id = Some(val.into());
436 self
437 }
438
439 pub async fn send(self) -> Result<Vec<games::game_high_score::GameHighScore>> {
441 self.bot
442 .get_game_high_scores_raw(
443 self.user_id,
444 self.chat_id,
445 self.message_id,
446 self.inline_message_id.as_deref(),
447 )
448 .await
449 }
450}
451
452impl_into_future!(
453 GetGameHighScoresBuilder,
454 Vec<games::game_high_score::GameHighScore>
455);
456
457pub struct SavePreparedInlineMessageBuilder<'a> {
467 bot: &'a Bot,
468 user_id: i64,
469 result: serde_json::Value,
470 allow_user_chats: Option<bool>,
471 allow_bot_chats: Option<bool>,
472 allow_group_chats: Option<bool>,
473 allow_channel_chats: Option<bool>,
474}
475
476impl<'a> SavePreparedInlineMessageBuilder<'a> {
477 pub fn allow_user_chats(mut self, val: bool) -> Self {
479 self.allow_user_chats = Some(val);
480 self
481 }
482 pub fn allow_bot_chats(mut self, val: bool) -> Self {
484 self.allow_bot_chats = Some(val);
485 self
486 }
487 pub fn allow_group_chats(mut self, val: bool) -> Self {
489 self.allow_group_chats = Some(val);
490 self
491 }
492 pub fn allow_channel_chats(mut self, val: bool) -> Self {
494 self.allow_channel_chats = Some(val);
495 self
496 }
497
498 pub async fn send(self) -> Result<serde_json::Value> {
500 self.bot
501 .save_prepared_inline_message_raw(
502 self.user_id,
503 self.result,
504 self.allow_user_chats,
505 self.allow_bot_chats,
506 self.allow_group_chats,
507 self.allow_channel_chats,
508 )
509 .await
510 }
511}
512
513impl_into_future!(SavePreparedInlineMessageBuilder, serde_json::Value);
514
515pub struct AnswerWebAppQueryBuilder<'a> {
521 bot: &'a Bot,
522 web_app_query_id: String,
523 result: serde_json::Value,
524}
525
526impl<'a> AnswerWebAppQueryBuilder<'a> {
527 pub async fn send(self) -> Result<sent_web_app_message::SentWebAppMessage> {
529 self.bot
530 .answer_web_app_query_raw(&self.web_app_query_id, self.result)
531 .await
532 }
533}
534
535impl_into_future!(
536 AnswerWebAppQueryBuilder,
537 sent_web_app_message::SentWebAppMessage
538);
539
540pub struct SendMediaGroupBuilder<'a> {
550 bot: &'a Bot,
551 chat_id: ChatId,
552 media: Vec<serde_json::Value>,
553 disable_notification: Option<bool>,
554 protect_content: Option<bool>,
555 message_thread_id: Option<i64>,
556 reply_parameters: Option<reply::ReplyParameters>,
557 business_connection_id: Option<String>,
558 message_effect_id: Option<String>,
559 allow_paid_broadcast: Option<bool>,
560 direct_messages_topic_id: Option<i64>,
561 suggested_post_parameters: Option<suggested_post::SuggestedPostParameters>,
562}
563
564impl<'a> SendMediaGroupBuilder<'a> {
565 pub fn disable_notification(mut self, val: bool) -> Self {
567 self.disable_notification = Some(val);
568 self
569 }
570 pub fn protect_content(mut self, val: bool) -> Self {
572 self.protect_content = Some(val);
573 self
574 }
575 pub fn message_thread_id(mut self, val: i64) -> Self {
577 self.message_thread_id = Some(val);
578 self
579 }
580 pub fn reply_parameters(mut self, val: reply::ReplyParameters) -> Self {
582 self.reply_parameters = Some(val);
583 self
584 }
585 pub fn business_connection_id(mut self, val: impl Into<String>) -> Self {
587 self.business_connection_id = Some(val.into());
588 self
589 }
590 pub fn message_effect_id(mut self, val: impl Into<String>) -> Self {
592 self.message_effect_id = Some(val.into());
593 self
594 }
595 pub fn allow_paid_broadcast(mut self, val: bool) -> Self {
597 self.allow_paid_broadcast = Some(val);
598 self
599 }
600 pub fn direct_messages_topic_id(mut self, val: i64) -> Self {
602 self.direct_messages_topic_id = Some(val);
603 self
604 }
605 pub fn suggested_post_parameters(
607 mut self,
608 val: suggested_post::SuggestedPostParameters,
609 ) -> Self {
610 self.suggested_post_parameters = Some(val);
611 self
612 }
613
614 pub async fn send(self) -> Result<Vec<message::Message>> {
616 self.bot
617 .send_media_group_raw(
618 self.chat_id,
619 self.media,
620 self.disable_notification,
621 self.protect_content,
622 self.message_thread_id,
623 self.reply_parameters,
624 self.business_connection_id.as_deref(),
625 self.message_effect_id.as_deref(),
626 self.allow_paid_broadcast,
627 self.direct_messages_topic_id,
628 self.suggested_post_parameters,
629 )
630 .await
631 }
632}
633
634impl_into_future!(SendMediaGroupBuilder, Vec<message::Message>);
635
636pub struct SendPaidMediaBuilder<'a> {
642 bot: &'a Bot,
643 chat_id: ChatId,
644 star_count: i64,
645 media: Vec<serde_json::Value>,
646 caption: Option<String>,
647 parse_mode: Option<String>,
648 caption_entities: Option<Vec<message_entity::MessageEntity>>,
649 show_caption_above_media: Option<bool>,
650 disable_notification: Option<bool>,
651 protect_content: Option<bool>,
652 reply_parameters: Option<reply::ReplyParameters>,
653 reply_markup: Option<serde_json::Value>,
654 business_connection_id: Option<String>,
655 payload: Option<String>,
656 allow_paid_broadcast: Option<bool>,
657 direct_messages_topic_id: Option<i64>,
658 suggested_post_parameters: Option<suggested_post::SuggestedPostParameters>,
659 message_thread_id: Option<i64>,
660}
661
662impl<'a> SendPaidMediaBuilder<'a> {
663 pub fn caption(mut self, val: impl Into<String>) -> Self {
665 self.caption = Some(val.into());
666 self
667 }
668 pub fn parse_mode(mut self, val: impl Into<String>) -> Self {
670 self.parse_mode = Some(val.into());
671 self
672 }
673 pub fn caption_entities(mut self, val: Vec<message_entity::MessageEntity>) -> Self {
675 self.caption_entities = Some(val);
676 self
677 }
678 pub fn show_caption_above_media(mut self, val: bool) -> Self {
680 self.show_caption_above_media = Some(val);
681 self
682 }
683 pub fn disable_notification(mut self, val: bool) -> Self {
685 self.disable_notification = Some(val);
686 self
687 }
688 pub fn protect_content(mut self, val: bool) -> Self {
690 self.protect_content = Some(val);
691 self
692 }
693 pub fn reply_parameters(mut self, val: reply::ReplyParameters) -> Self {
695 self.reply_parameters = Some(val);
696 self
697 }
698 pub fn reply_markup(mut self, val: serde_json::Value) -> Self {
700 self.reply_markup = Some(val);
701 self
702 }
703 pub fn business_connection_id(mut self, val: impl Into<String>) -> Self {
705 self.business_connection_id = Some(val.into());
706 self
707 }
708 pub fn payload(mut self, val: impl Into<String>) -> Self {
710 self.payload = Some(val.into());
711 self
712 }
713 pub fn allow_paid_broadcast(mut self, val: bool) -> Self {
715 self.allow_paid_broadcast = Some(val);
716 self
717 }
718 pub fn direct_messages_topic_id(mut self, val: i64) -> Self {
720 self.direct_messages_topic_id = Some(val);
721 self
722 }
723 pub fn suggested_post_parameters(
725 mut self,
726 val: suggested_post::SuggestedPostParameters,
727 ) -> Self {
728 self.suggested_post_parameters = Some(val);
729 self
730 }
731 pub fn message_thread_id(mut self, val: i64) -> Self {
733 self.message_thread_id = Some(val);
734 self
735 }
736
737 pub async fn send(self) -> Result<message::Message> {
739 self.bot
740 .send_paid_media_raw(
741 self.chat_id,
742 self.star_count,
743 self.media,
744 self.caption.as_deref(),
745 self.parse_mode.as_deref(),
746 self.caption_entities,
747 self.show_caption_above_media,
748 self.disable_notification,
749 self.protect_content,
750 self.reply_parameters,
751 self.reply_markup,
752 self.business_connection_id.as_deref(),
753 self.payload.as_deref(),
754 self.allow_paid_broadcast,
755 self.direct_messages_topic_id,
756 self.suggested_post_parameters,
757 self.message_thread_id,
758 )
759 .await
760 }
761}
762
763impl_into_future!(SendPaidMediaBuilder, message::Message);
764
765#[derive(Serialize)]
775pub struct GetMeBuilder<'a> {
776 #[serde(skip)]
777 bot: &'a Bot,
778}
779
780impl<'a> GetMeBuilder<'a> {
781 pub async fn send(self) -> Result<user::User> {
783 self.bot.get_me_raw().await
784 }
785}
786
787impl_into_future!(GetMeBuilder, user::User);
788
789#[derive(Serialize)]
795pub struct LogOutBuilder<'a> {
796 #[serde(skip)]
797 bot: &'a Bot,
798}
799
800impl<'a> LogOutBuilder<'a> {
801 pub async fn send(self) -> Result<bool> {
803 self.bot.log_out_raw().await
804 }
805}
806
807impl_into_future!(LogOutBuilder, bool);
808
809#[derive(Serialize)]
815pub struct CloseBuilder<'a> {
816 #[serde(skip)]
817 bot: &'a Bot,
818}
819
820impl<'a> CloseBuilder<'a> {
821 pub async fn send(self) -> Result<bool> {
823 self.bot.close_raw().await
824 }
825}
826
827impl_into_future!(CloseBuilder, bool);
828
829pub struct GetUpdatesBuilder<'a> {
835 bot: &'a Bot,
836 offset: Option<i64>,
837 limit: Option<i32>,
838 timeout: Option<i32>,
839 allowed_updates: Option<Vec<String>>,
840}
841
842impl<'a> GetUpdatesBuilder<'a> {
843 pub fn offset(mut self, val: i64) -> Self {
845 self.offset = Some(val);
846 self
847 }
848 pub fn limit(mut self, val: i32) -> Self {
850 self.limit = Some(val);
851 self
852 }
853 pub fn timeout(mut self, val: i32) -> Self {
855 self.timeout = Some(val);
856 self
857 }
858 pub fn allowed_updates(mut self, val: Vec<String>) -> Self {
860 self.allowed_updates = Some(val);
861 self
862 }
863
864 pub async fn send(self) -> Result<Vec<update::Update>> {
866 self.bot
867 .get_updates_raw(self.offset, self.limit, self.timeout, self.allowed_updates)
868 .await
869 }
870}
871
872impl_into_future!(GetUpdatesBuilder, Vec<update::Update>);
873
874#[derive(Serialize)]
880pub struct GetWebhookInfoBuilder<'a> {
881 #[serde(skip)]
882 bot: &'a Bot,
883}
884
885impl<'a> GetWebhookInfoBuilder<'a> {
886 pub async fn send(self) -> Result<webhook_info::WebhookInfo> {
888 self.bot.get_webhook_info_raw().await
889 }
890}
891
892impl_into_future!(GetWebhookInfoBuilder, webhook_info::WebhookInfo);
893
894pub struct DownloadFileBuilder<'a> {
900 bot: &'a Bot,
901 file_path: String,
902}
903
904impl<'a> DownloadFileBuilder<'a> {
905 pub async fn send(self) -> Result<Vec<u8>> {
907 self.bot.download_file_raw(&self.file_path).await
908 }
909}
910
911impl_into_future!(DownloadFileBuilder, Vec<u8>);
912
913pub struct SendChecklistBuilder<'a> {
923 bot: &'a Bot,
924 business_connection_id: String,
925 chat_id: i64,
926 checklist: input_checklist::InputChecklist,
927 disable_notification: Option<bool>,
928 protect_content: Option<bool>,
929 message_effect_id: Option<String>,
930 reply_parameters: Option<reply::ReplyParameters>,
931 reply_markup: Option<serde_json::Value>,
932}
933
934impl<'a> SendChecklistBuilder<'a> {
935 pub fn disable_notification(mut self, val: bool) -> Self {
937 self.disable_notification = Some(val);
938 self
939 }
940 pub fn protect_content(mut self, val: bool) -> Self {
942 self.protect_content = Some(val);
943 self
944 }
945 pub fn message_effect_id(mut self, val: impl Into<String>) -> Self {
947 self.message_effect_id = Some(val.into());
948 self
949 }
950 pub fn reply_parameters(mut self, val: reply::ReplyParameters) -> Self {
952 self.reply_parameters = Some(val);
953 self
954 }
955 pub fn reply_markup(mut self, val: serde_json::Value) -> Self {
957 self.reply_markup = Some(val);
958 self
959 }
960
961 pub async fn send(self) -> Result<message::Message> {
963 self.bot
964 .send_checklist_raw(
965 &self.business_connection_id,
966 self.chat_id,
967 self.checklist,
968 self.disable_notification,
969 self.protect_content,
970 self.message_effect_id.as_deref(),
971 self.reply_parameters,
972 self.reply_markup,
973 )
974 .await
975 }
976}
977
978impl_into_future!(SendChecklistBuilder, message::Message);
979
980pub struct SetPassportDataErrorsBuilder<'a> {
990 bot: &'a Bot,
991 user_id: i64,
992 errors: Vec<serde_json::Value>,
993}
994
995impl<'a> SetPassportDataErrorsBuilder<'a> {
996 pub async fn send(self) -> Result<bool> {
998 self.bot
999 .set_passport_data_errors_raw(self.user_id, self.errors)
1000 .await
1001 }
1002}
1003
1004impl_into_future!(SetPassportDataErrorsBuilder, bool);
1005
1006pub struct SetMessageReactionBuilder<'a> {
1016 bot: &'a Bot,
1017 chat_id: ChatId,
1018 message_id: i64,
1019 reaction: Option<Vec<serde_json::Value>>,
1020 is_big: Option<bool>,
1021}
1022
1023impl<'a> SetMessageReactionBuilder<'a> {
1024 pub fn reaction(mut self, val: Vec<serde_json::Value>) -> Self {
1026 self.reaction = Some(val);
1027 self
1028 }
1029 pub fn is_big(mut self, val: bool) -> Self {
1031 self.is_big = Some(val);
1032 self
1033 }
1034
1035 pub async fn send(self) -> Result<bool> {
1037 self.bot
1038 .set_message_reaction_raw(self.chat_id, self.message_id, self.reaction, self.is_big)
1039 .await
1040 }
1041}
1042
1043impl_into_future!(SetMessageReactionBuilder, bool);
1044
1045pub struct GetUserChatBoostsBuilder<'a> {
1051 bot: &'a Bot,
1052 chat_id: ChatId,
1053 user_id: i64,
1054}
1055
1056impl<'a> GetUserChatBoostsBuilder<'a> {
1057 pub async fn send(self) -> Result<chat_boost::UserChatBoosts> {
1059 self.bot
1060 .get_user_chat_boosts_raw(self.chat_id, self.user_id)
1061 .await
1062 }
1063}
1064
1065impl_into_future!(GetUserChatBoostsBuilder, chat_boost::UserChatBoosts);
1066
1067pub struct PostStoryBuilder<'a> {
1077 bot: &'a Bot,
1078 business_connection_id: String,
1079 content: serde_json::Value,
1080 active_period: i64,
1081 caption: Option<String>,
1082 parse_mode: Option<String>,
1083 caption_entities: Option<Vec<message_entity::MessageEntity>>,
1084 areas: Option<Vec<serde_json::Value>>,
1085 post_to_chat_page: Option<bool>,
1086 protect_content: Option<bool>,
1087}
1088
1089impl<'a> PostStoryBuilder<'a> {
1090 pub fn caption(mut self, val: impl Into<String>) -> Self {
1092 self.caption = Some(val.into());
1093 self
1094 }
1095 pub fn parse_mode(mut self, val: impl Into<String>) -> Self {
1097 self.parse_mode = Some(val.into());
1098 self
1099 }
1100 pub fn caption_entities(mut self, val: Vec<message_entity::MessageEntity>) -> Self {
1102 self.caption_entities = Some(val);
1103 self
1104 }
1105 pub fn areas(mut self, val: Vec<serde_json::Value>) -> Self {
1107 self.areas = Some(val);
1108 self
1109 }
1110 pub fn post_to_chat_page(mut self, val: bool) -> Self {
1112 self.post_to_chat_page = Some(val);
1113 self
1114 }
1115 pub fn protect_content(mut self, val: bool) -> Self {
1117 self.protect_content = Some(val);
1118 self
1119 }
1120
1121 pub async fn send(self) -> Result<story::Story> {
1123 self.bot
1124 .post_story_raw(
1125 &self.business_connection_id,
1126 self.content,
1127 self.active_period,
1128 self.caption.as_deref(),
1129 self.parse_mode.as_deref(),
1130 self.caption_entities,
1131 self.areas,
1132 self.post_to_chat_page,
1133 self.protect_content,
1134 )
1135 .await
1136 }
1137}
1138
1139impl_into_future!(PostStoryBuilder, story::Story);
1140
1141pub struct EditStoryBuilder<'a> {
1147 bot: &'a Bot,
1148 business_connection_id: String,
1149 story_id: i64,
1150 content: serde_json::Value,
1151 caption: Option<String>,
1152 parse_mode: Option<String>,
1153 caption_entities: Option<Vec<message_entity::MessageEntity>>,
1154 areas: Option<Vec<serde_json::Value>>,
1155}
1156
1157impl<'a> EditStoryBuilder<'a> {
1158 pub fn caption(mut self, val: impl Into<String>) -> Self {
1160 self.caption = Some(val.into());
1161 self
1162 }
1163 pub fn parse_mode(mut self, val: impl Into<String>) -> Self {
1165 self.parse_mode = Some(val.into());
1166 self
1167 }
1168 pub fn caption_entities(mut self, val: Vec<message_entity::MessageEntity>) -> Self {
1170 self.caption_entities = Some(val);
1171 self
1172 }
1173 pub fn areas(mut self, val: Vec<serde_json::Value>) -> Self {
1175 self.areas = Some(val);
1176 self
1177 }
1178
1179 pub async fn send(self) -> Result<story::Story> {
1181 self.bot
1182 .edit_story_raw(
1183 &self.business_connection_id,
1184 self.story_id,
1185 self.content,
1186 self.caption.as_deref(),
1187 self.parse_mode.as_deref(),
1188 self.caption_entities,
1189 self.areas,
1190 )
1191 .await
1192 }
1193}
1194
1195impl_into_future!(EditStoryBuilder, story::Story);
1196
1197pub struct DeleteStoryBuilder<'a> {
1203 bot: &'a Bot,
1204 business_connection_id: String,
1205 story_id: i64,
1206}
1207
1208impl<'a> DeleteStoryBuilder<'a> {
1209 pub async fn send(self) -> Result<bool> {
1211 self.bot
1212 .delete_story_raw(&self.business_connection_id, self.story_id)
1213 .await
1214 }
1215}
1216
1217impl_into_future!(DeleteStoryBuilder, bool);
1218
1219pub struct RepostStoryBuilder<'a> {
1225 bot: &'a Bot,
1226 business_connection_id: String,
1227 from_chat_id: i64,
1228 from_story_id: i64,
1229 active_period: i64,
1230 post_to_chat_page: Option<bool>,
1231 protect_content: Option<bool>,
1232}
1233
1234impl<'a> RepostStoryBuilder<'a> {
1235 pub fn post_to_chat_page(mut self, val: bool) -> Self {
1237 self.post_to_chat_page = Some(val);
1238 self
1239 }
1240 pub fn protect_content(mut self, val: bool) -> Self {
1242 self.protect_content = Some(val);
1243 self
1244 }
1245
1246 pub async fn send(self) -> Result<story::Story> {
1248 self.bot
1249 .repost_story_raw(
1250 &self.business_connection_id,
1251 self.from_chat_id,
1252 self.from_story_id,
1253 self.active_period,
1254 self.post_to_chat_page,
1255 self.protect_content,
1256 )
1257 .await
1258 }
1259}
1260
1261impl_into_future!(RepostStoryBuilder, story::Story);
1262
1263pub struct ApproveSuggestedPostBuilder<'a> {
1273 bot: &'a Bot,
1274 chat_id: i64,
1275 message_id: i64,
1276 send_date: Option<i64>,
1277}
1278
1279impl<'a> ApproveSuggestedPostBuilder<'a> {
1280 pub fn send_date(mut self, val: i64) -> Self {
1282 self.send_date = Some(val);
1283 self
1284 }
1285
1286 pub async fn send(self) -> Result<bool> {
1288 self.bot
1289 .approve_suggested_post_raw(self.chat_id, self.message_id, self.send_date)
1290 .await
1291 }
1292}
1293
1294impl_into_future!(ApproveSuggestedPostBuilder, bool);
1295
1296pub struct DeclineSuggestedPostBuilder<'a> {
1302 bot: &'a Bot,
1303 chat_id: i64,
1304 message_id: i64,
1305 comment: Option<String>,
1306}
1307
1308impl<'a> DeclineSuggestedPostBuilder<'a> {
1309 pub fn comment(mut self, val: impl Into<String>) -> Self {
1311 self.comment = Some(val.into());
1312 self
1313 }
1314
1315 pub async fn send(self) -> Result<bool> {
1317 self.bot
1318 .decline_suggested_post_raw(self.chat_id, self.message_id, self.comment.as_deref())
1319 .await
1320 }
1321}
1322
1323impl_into_future!(DeclineSuggestedPostBuilder, bool);
1324
1325pub struct GetUserProfilePhotosBuilder<'a> {
1335 bot: &'a Bot,
1336 user_id: i64,
1337 offset: Option<i64>,
1338 limit: Option<i64>,
1339}
1340
1341impl<'a> GetUserProfilePhotosBuilder<'a> {
1342 pub fn offset(mut self, val: i64) -> Self {
1344 self.offset = Some(val);
1345 self
1346 }
1347 pub fn limit(mut self, val: i64) -> Self {
1349 self.limit = Some(val);
1350 self
1351 }
1352
1353 pub async fn send(self) -> Result<user_profile_photos::UserProfilePhotos> {
1355 self.bot
1356 .get_user_profile_photos_raw(self.user_id, self.offset, self.limit)
1357 .await
1358 }
1359}
1360
1361impl_into_future!(
1362 GetUserProfilePhotosBuilder,
1363 user_profile_photos::UserProfilePhotos
1364);
1365
1366pub struct GetUserProfileAudiosBuilder<'a> {
1372 bot: &'a Bot,
1373 user_id: i64,
1374 offset: Option<i64>,
1375 limit: Option<i64>,
1376}
1377
1378impl<'a> GetUserProfileAudiosBuilder<'a> {
1379 pub fn offset(mut self, val: i64) -> Self {
1381 self.offset = Some(val);
1382 self
1383 }
1384 pub fn limit(mut self, val: i64) -> Self {
1386 self.limit = Some(val);
1387 self
1388 }
1389
1390 pub async fn send(self) -> Result<user_profile_audios::UserProfileAudios> {
1392 self.bot
1393 .get_user_profile_audios_raw(self.user_id, self.offset, self.limit)
1394 .await
1395 }
1396}
1397
1398impl_into_future!(
1399 GetUserProfileAudiosBuilder,
1400 user_profile_audios::UserProfileAudios
1401);
1402
1403pub struct SetUserEmojiStatusBuilder<'a> {
1409 bot: &'a Bot,
1410 user_id: i64,
1411 emoji_status_custom_emoji_id: Option<String>,
1412 emoji_status_expiration_date: Option<i64>,
1413}
1414
1415impl<'a> SetUserEmojiStatusBuilder<'a> {
1416 pub fn emoji_status_custom_emoji_id(mut self, val: impl Into<String>) -> Self {
1418 self.emoji_status_custom_emoji_id = Some(val.into());
1419 self
1420 }
1421 pub fn emoji_status_expiration_date(mut self, val: i64) -> Self {
1423 self.emoji_status_expiration_date = Some(val);
1424 self
1425 }
1426
1427 pub async fn send(self) -> Result<bool> {
1429 self.bot
1430 .set_user_emoji_status_raw(
1431 self.user_id,
1432 self.emoji_status_custom_emoji_id.as_deref(),
1433 self.emoji_status_expiration_date,
1434 )
1435 .await
1436 }
1437}
1438
1439impl_into_future!(SetUserEmojiStatusBuilder, bool);
1440
1441pub struct SetMyProfilePhotoBuilder<'a> {
1447 bot: &'a Bot,
1448 photo: serde_json::Value,
1449}
1450
1451impl<'a> SetMyProfilePhotoBuilder<'a> {
1452 pub async fn send(self) -> Result<bool> {
1454 self.bot.set_my_profile_photo_raw(self.photo).await
1455 }
1456}
1457
1458impl_into_future!(SetMyProfilePhotoBuilder, bool);
1459
1460#[derive(Serialize)]
1466pub struct RemoveMyProfilePhotoBuilder<'a> {
1467 #[serde(skip)]
1468 bot: &'a Bot,
1469}
1470
1471impl<'a> RemoveMyProfilePhotoBuilder<'a> {
1472 pub async fn send(self) -> Result<bool> {
1474 self.bot.remove_my_profile_photo_raw().await
1475 }
1476}
1477
1478impl_into_future!(RemoveMyProfilePhotoBuilder, bool);
1479
1480pub struct VerifyChatBuilder<'a> {
1490 bot: &'a Bot,
1491 chat_id: ChatId,
1492 custom_description: Option<String>,
1493}
1494
1495impl<'a> VerifyChatBuilder<'a> {
1496 pub fn custom_description(mut self, val: impl Into<String>) -> Self {
1498 self.custom_description = Some(val.into());
1499 self
1500 }
1501
1502 pub async fn send(self) -> Result<bool> {
1504 self.bot
1505 .verify_chat_raw(self.chat_id, self.custom_description.as_deref())
1506 .await
1507 }
1508}
1509
1510impl_into_future!(VerifyChatBuilder, bool);
1511
1512pub struct VerifyUserBuilder<'a> {
1518 bot: &'a Bot,
1519 user_id: i64,
1520 custom_description: Option<String>,
1521}
1522
1523impl<'a> VerifyUserBuilder<'a> {
1524 pub fn custom_description(mut self, val: impl Into<String>) -> Self {
1526 self.custom_description = Some(val.into());
1527 self
1528 }
1529
1530 pub async fn send(self) -> Result<bool> {
1532 self.bot
1533 .verify_user_raw(self.user_id, self.custom_description.as_deref())
1534 .await
1535 }
1536}
1537
1538impl_into_future!(VerifyUserBuilder, bool);
1539
1540pub struct RemoveChatVerificationBuilder<'a> {
1546 bot: &'a Bot,
1547 chat_id: ChatId,
1548}
1549
1550impl<'a> RemoveChatVerificationBuilder<'a> {
1551 pub async fn send(self) -> Result<bool> {
1553 self.bot.remove_chat_verification_raw(self.chat_id).await
1554 }
1555}
1556
1557impl_into_future!(RemoveChatVerificationBuilder, bool);
1558
1559pub struct RemoveUserVerificationBuilder<'a> {
1565 bot: &'a Bot,
1566 user_id: i64,
1567}
1568
1569impl<'a> RemoveUserVerificationBuilder<'a> {
1570 pub async fn send(self) -> Result<bool> {
1572 self.bot.remove_user_verification_raw(self.user_id).await
1573 }
1574}
1575
1576impl_into_future!(RemoveUserVerificationBuilder, bool);
1577
1578impl Bot {
1583 pub fn edit_message_live_location(
1587 &self,
1588 latitude: f64,
1589 longitude: f64,
1590 ) -> EditMessageLiveLocationBuilder<'_> {
1591 EditMessageLiveLocationBuilder {
1592 bot: self,
1593 latitude,
1594 longitude,
1595 chat_id: None,
1596 message_id: None,
1597 inline_message_id: None,
1598 horizontal_accuracy: None,
1599 heading: None,
1600 proximity_alert_radius: None,
1601 reply_markup: None,
1602 live_period: None,
1603 business_connection_id: None,
1604 }
1605 }
1606
1607 pub fn stop_message_live_location(&self) -> StopMessageLiveLocationBuilder<'_> {
1609 StopMessageLiveLocationBuilder {
1610 bot: self,
1611 chat_id: None,
1612 message_id: None,
1613 inline_message_id: None,
1614 reply_markup: None,
1615 business_connection_id: None,
1616 }
1617 }
1618
1619 pub fn edit_message_checklist(
1621 &self,
1622 business_connection_id: impl Into<String>,
1623 chat_id: i64,
1624 message_id: i64,
1625 checklist: input_checklist::InputChecklist,
1626 ) -> EditMessageChecklistBuilder<'_> {
1627 EditMessageChecklistBuilder {
1628 bot: self,
1629 business_connection_id: business_connection_id.into(),
1630 chat_id,
1631 message_id,
1632 checklist,
1633 reply_markup: None,
1634 }
1635 }
1636
1637 pub fn stop_poll(&self, chat_id: impl Into<ChatId>, message_id: i64) -> StopPollBuilder<'_> {
1639 StopPollBuilder {
1640 bot: self,
1641 chat_id: chat_id.into(),
1642 message_id,
1643 reply_markup: None,
1644 business_connection_id: None,
1645 }
1646 }
1647
1648 pub fn send_game(
1652 &self,
1653 chat_id: i64,
1654 game_short_name: impl Into<String>,
1655 ) -> SendGameBuilder<'_> {
1656 SendGameBuilder {
1657 bot: self,
1658 chat_id,
1659 game_short_name: game_short_name.into(),
1660 disable_notification: None,
1661 protect_content: None,
1662 reply_parameters: None,
1663 reply_markup: None,
1664 message_thread_id: None,
1665 business_connection_id: None,
1666 message_effect_id: None,
1667 allow_paid_broadcast: None,
1668 }
1669 }
1670
1671 pub fn set_game_score(&self, user_id: i64, score: i64) -> SetGameScoreBuilder<'_> {
1673 SetGameScoreBuilder {
1674 bot: self,
1675 user_id,
1676 score,
1677 force: None,
1678 disable_edit_message: None,
1679 chat_id: None,
1680 message_id: None,
1681 inline_message_id: None,
1682 }
1683 }
1684
1685 pub fn get_game_high_scores(&self, user_id: i64) -> GetGameHighScoresBuilder<'_> {
1687 GetGameHighScoresBuilder {
1688 bot: self,
1689 user_id,
1690 chat_id: None,
1691 message_id: None,
1692 inline_message_id: None,
1693 }
1694 }
1695
1696 pub fn save_prepared_inline_message(
1700 &self,
1701 user_id: i64,
1702 result: serde_json::Value,
1703 ) -> SavePreparedInlineMessageBuilder<'_> {
1704 SavePreparedInlineMessageBuilder {
1705 bot: self,
1706 user_id,
1707 result,
1708 allow_user_chats: None,
1709 allow_bot_chats: None,
1710 allow_group_chats: None,
1711 allow_channel_chats: None,
1712 }
1713 }
1714
1715 pub fn answer_web_app_query(
1717 &self,
1718 web_app_query_id: impl Into<String>,
1719 result: serde_json::Value,
1720 ) -> AnswerWebAppQueryBuilder<'_> {
1721 AnswerWebAppQueryBuilder {
1722 bot: self,
1723 web_app_query_id: web_app_query_id.into(),
1724 result,
1725 }
1726 }
1727
1728 pub fn send_media_group(
1732 &self,
1733 chat_id: impl Into<ChatId>,
1734 media: Vec<serde_json::Value>,
1735 ) -> SendMediaGroupBuilder<'_> {
1736 SendMediaGroupBuilder {
1737 bot: self,
1738 chat_id: chat_id.into(),
1739 media,
1740 disable_notification: None,
1741 protect_content: None,
1742 message_thread_id: None,
1743 reply_parameters: None,
1744 business_connection_id: None,
1745 message_effect_id: None,
1746 allow_paid_broadcast: None,
1747 direct_messages_topic_id: None,
1748 suggested_post_parameters: None,
1749 }
1750 }
1751
1752 pub fn send_paid_media(
1754 &self,
1755 chat_id: impl Into<ChatId>,
1756 star_count: i64,
1757 media: Vec<serde_json::Value>,
1758 ) -> SendPaidMediaBuilder<'_> {
1759 SendPaidMediaBuilder {
1760 bot: self,
1761 chat_id: chat_id.into(),
1762 star_count,
1763 media,
1764 caption: None,
1765 parse_mode: None,
1766 caption_entities: None,
1767 show_caption_above_media: None,
1768 disable_notification: None,
1769 protect_content: None,
1770 reply_parameters: None,
1771 reply_markup: None,
1772 business_connection_id: None,
1773 payload: None,
1774 allow_paid_broadcast: None,
1775 direct_messages_topic_id: None,
1776 suggested_post_parameters: None,
1777 message_thread_id: None,
1778 }
1779 }
1780
1781 pub fn get_me(&self) -> GetMeBuilder<'_> {
1785 GetMeBuilder { bot: self }
1786 }
1787
1788 pub fn log_out(&self) -> LogOutBuilder<'_> {
1790 LogOutBuilder { bot: self }
1791 }
1792
1793 pub fn close(&self) -> CloseBuilder<'_> {
1795 CloseBuilder { bot: self }
1796 }
1797
1798 pub fn get_updates(&self) -> GetUpdatesBuilder<'_> {
1800 GetUpdatesBuilder {
1801 bot: self,
1802 offset: None,
1803 limit: None,
1804 timeout: None,
1805 allowed_updates: None,
1806 }
1807 }
1808
1809 pub fn get_webhook_info(&self) -> GetWebhookInfoBuilder<'_> {
1811 GetWebhookInfoBuilder { bot: self }
1812 }
1813
1814 pub fn download_file(&self, file_path: impl Into<String>) -> DownloadFileBuilder<'_> {
1816 DownloadFileBuilder {
1817 bot: self,
1818 file_path: file_path.into(),
1819 }
1820 }
1821
1822 pub fn send_checklist(
1826 &self,
1827 business_connection_id: impl Into<String>,
1828 chat_id: i64,
1829 checklist: input_checklist::InputChecklist,
1830 ) -> SendChecklistBuilder<'_> {
1831 SendChecklistBuilder {
1832 bot: self,
1833 business_connection_id: business_connection_id.into(),
1834 chat_id,
1835 checklist,
1836 disable_notification: None,
1837 protect_content: None,
1838 message_effect_id: None,
1839 reply_parameters: None,
1840 reply_markup: None,
1841 }
1842 }
1843
1844 pub fn set_passport_data_errors(
1848 &self,
1849 user_id: i64,
1850 errors: Vec<serde_json::Value>,
1851 ) -> SetPassportDataErrorsBuilder<'_> {
1852 SetPassportDataErrorsBuilder {
1853 bot: self,
1854 user_id,
1855 errors,
1856 }
1857 }
1858
1859 pub fn set_message_reaction(
1863 &self,
1864 chat_id: impl Into<ChatId>,
1865 message_id: i64,
1866 ) -> SetMessageReactionBuilder<'_> {
1867 SetMessageReactionBuilder {
1868 bot: self,
1869 chat_id: chat_id.into(),
1870 message_id,
1871 reaction: None,
1872 is_big: None,
1873 }
1874 }
1875
1876 pub fn get_user_chat_boosts(
1878 &self,
1879 chat_id: impl Into<ChatId>,
1880 user_id: i64,
1881 ) -> GetUserChatBoostsBuilder<'_> {
1882 GetUserChatBoostsBuilder {
1883 bot: self,
1884 chat_id: chat_id.into(),
1885 user_id,
1886 }
1887 }
1888
1889 pub fn post_story(
1893 &self,
1894 business_connection_id: impl Into<String>,
1895 content: serde_json::Value,
1896 active_period: i64,
1897 ) -> PostStoryBuilder<'_> {
1898 PostStoryBuilder {
1899 bot: self,
1900 business_connection_id: business_connection_id.into(),
1901 content,
1902 active_period,
1903 caption: None,
1904 parse_mode: None,
1905 caption_entities: None,
1906 areas: None,
1907 post_to_chat_page: None,
1908 protect_content: None,
1909 }
1910 }
1911
1912 pub fn edit_story(
1914 &self,
1915 business_connection_id: impl Into<String>,
1916 story_id: i64,
1917 content: serde_json::Value,
1918 ) -> EditStoryBuilder<'_> {
1919 EditStoryBuilder {
1920 bot: self,
1921 business_connection_id: business_connection_id.into(),
1922 story_id,
1923 content,
1924 caption: None,
1925 parse_mode: None,
1926 caption_entities: None,
1927 areas: None,
1928 }
1929 }
1930
1931 pub fn delete_story(
1933 &self,
1934 business_connection_id: impl Into<String>,
1935 story_id: i64,
1936 ) -> DeleteStoryBuilder<'_> {
1937 DeleteStoryBuilder {
1938 bot: self,
1939 business_connection_id: business_connection_id.into(),
1940 story_id,
1941 }
1942 }
1943
1944 pub fn repost_story(
1946 &self,
1947 business_connection_id: impl Into<String>,
1948 from_chat_id: i64,
1949 from_story_id: i64,
1950 active_period: i64,
1951 ) -> RepostStoryBuilder<'_> {
1952 RepostStoryBuilder {
1953 bot: self,
1954 business_connection_id: business_connection_id.into(),
1955 from_chat_id,
1956 from_story_id,
1957 active_period,
1958 post_to_chat_page: None,
1959 protect_content: None,
1960 }
1961 }
1962
1963 pub fn approve_suggested_post(
1967 &self,
1968 chat_id: i64,
1969 message_id: i64,
1970 ) -> ApproveSuggestedPostBuilder<'_> {
1971 ApproveSuggestedPostBuilder {
1972 bot: self,
1973 chat_id,
1974 message_id,
1975 send_date: None,
1976 }
1977 }
1978
1979 pub fn decline_suggested_post(
1981 &self,
1982 chat_id: i64,
1983 message_id: i64,
1984 ) -> DeclineSuggestedPostBuilder<'_> {
1985 DeclineSuggestedPostBuilder {
1986 bot: self,
1987 chat_id,
1988 message_id,
1989 comment: None,
1990 }
1991 }
1992
1993 pub fn get_user_profile_photos(&self, user_id: i64) -> GetUserProfilePhotosBuilder<'_> {
1997 GetUserProfilePhotosBuilder {
1998 bot: self,
1999 user_id,
2000 offset: None,
2001 limit: None,
2002 }
2003 }
2004
2005 pub fn get_user_profile_audios(&self, user_id: i64) -> GetUserProfileAudiosBuilder<'_> {
2007 GetUserProfileAudiosBuilder {
2008 bot: self,
2009 user_id,
2010 offset: None,
2011 limit: None,
2012 }
2013 }
2014
2015 pub fn set_user_emoji_status(&self, user_id: i64) -> SetUserEmojiStatusBuilder<'_> {
2017 SetUserEmojiStatusBuilder {
2018 bot: self,
2019 user_id,
2020 emoji_status_custom_emoji_id: None,
2021 emoji_status_expiration_date: None,
2022 }
2023 }
2024
2025 pub fn set_my_profile_photo(&self, photo: serde_json::Value) -> SetMyProfilePhotoBuilder<'_> {
2027 SetMyProfilePhotoBuilder { bot: self, photo }
2028 }
2029
2030 pub fn remove_my_profile_photo(&self) -> RemoveMyProfilePhotoBuilder<'_> {
2032 RemoveMyProfilePhotoBuilder { bot: self }
2033 }
2034
2035 pub fn verify_chat(&self, chat_id: impl Into<ChatId>) -> VerifyChatBuilder<'_> {
2039 VerifyChatBuilder {
2040 bot: self,
2041 chat_id: chat_id.into(),
2042 custom_description: None,
2043 }
2044 }
2045
2046 pub fn verify_user(&self, user_id: i64) -> VerifyUserBuilder<'_> {
2048 VerifyUserBuilder {
2049 bot: self,
2050 user_id,
2051 custom_description: None,
2052 }
2053 }
2054
2055 pub fn remove_chat_verification(
2057 &self,
2058 chat_id: impl Into<ChatId>,
2059 ) -> RemoveChatVerificationBuilder<'_> {
2060 RemoveChatVerificationBuilder {
2061 bot: self,
2062 chat_id: chat_id.into(),
2063 }
2064 }
2065
2066 pub fn remove_user_verification(&self, user_id: i64) -> RemoveUserVerificationBuilder<'_> {
2068 RemoveUserVerificationBuilder { bot: self, user_id }
2069 }
2070}