pub struct WrapperSendDocument { /* private fields */ }Implementations§
Source§impl WrapperSendDocument
impl WrapperSendDocument
Sourcepub fn send<'a>(
self,
) -> impl Future<Item = (RequestHandle, Message), Error = Error> + 'a
pub fn send<'a>( self, ) -> impl Future<Item = (RequestHandle, Message), Error = Error> + 'a
Examples found in repository?
examples/send_self.rs (line 16)
8fn main() {
9 // Create the bot
10 let mut bot = Bot::new(&env::var("TELEGRAM_BOT_KEY").unwrap()).update_interval(200);
11
12 let handle = bot.new_cmd("/send_self")
13 .and_then(|(bot, msg)| {
14 bot.document(msg.chat.id)
15 .file("examples/send_self.rs")
16 .send()
17 })
18 .for_each(|_| Ok(()));
19
20 // enter the main loop
21 bot.run_with(handle);
22}More examples
examples/send_memory.rs (line 51)
8fn main() {
9 // Create the bot
10 let mut bot = Bot::new(&env::var("TELEGRAM_BOT_KEY").unwrap()).update_interval(200);
11
12 let text = r"
13Dearest creature in creation,
14Study English pronunciation.
15I will teach you in my verse
16Sounds like corpse, corps, horse, and worse.
17I will keep you, Suzy, busy,
18Make your head with heat grow dizzy.
19Tear in eye, your dress will tear.
20So shall I! Oh hear my prayer.
21
22Just compare heart, beard, and heard,
23Dies and diet, lord and word,
24Sword and sward, retain and Britain.
25(Mind the latter, how it's written.)
26Now I surely will not plague you
27With such words as plaque and ague.
28But be careful how you speak:
29Say break and steak, but bleak and streak;
30Cloven, oven, how and low,
31Script, receipt, show, poem, and toe.
32
33Hear me say, devoid of trickery,
34Daughter, laughter, and Terpsichore,
35Typhoid, measles, topsails, aisles,
36Exiles, similes, and reviles;
37Scholar, vicar, and cigar,
38Solar, mica, war and far;
39One, anemone, Balmoral,
40Kitchen, lichen, laundry, laurel;
41Gertrude, German, wind and mind,
42Scene, Melpomene, mankind.
43
44...";
45
46 let handle = bot.new_cmd("/send")
47 .and_then(move |(bot, msg)| {
48 bot.document(msg.chat.id)
49 .file(("poem.txt", text.as_bytes()))
50 .caption("The Chaos")
51 .send()
52 })
53 .for_each(|_| Ok(()));
54
55 // enter the main loop
56 bot.run_with(handle);
57}pub fn document<S>(self, val: S) -> Self
Sourcepub fn caption<S>(self, val: S) -> Self
pub fn caption<S>(self, val: S) -> Self
Examples found in repository?
examples/send_memory.rs (line 50)
8fn main() {
9 // Create the bot
10 let mut bot = Bot::new(&env::var("TELEGRAM_BOT_KEY").unwrap()).update_interval(200);
11
12 let text = r"
13Dearest creature in creation,
14Study English pronunciation.
15I will teach you in my verse
16Sounds like corpse, corps, horse, and worse.
17I will keep you, Suzy, busy,
18Make your head with heat grow dizzy.
19Tear in eye, your dress will tear.
20So shall I! Oh hear my prayer.
21
22Just compare heart, beard, and heard,
23Dies and diet, lord and word,
24Sword and sward, retain and Britain.
25(Mind the latter, how it's written.)
26Now I surely will not plague you
27With such words as plaque and ague.
28But be careful how you speak:
29Say break and steak, but bleak and streak;
30Cloven, oven, how and low,
31Script, receipt, show, poem, and toe.
32
33Hear me say, devoid of trickery,
34Daughter, laughter, and Terpsichore,
35Typhoid, measles, topsails, aisles,
36Exiles, similes, and reviles;
37Scholar, vicar, and cigar,
38Solar, mica, war and far;
39One, anemone, Balmoral,
40Kitchen, lichen, laundry, laurel;
41Gertrude, German, wind and mind,
42Scene, Melpomene, mankind.
43
44...";
45
46 let handle = bot.new_cmd("/send")
47 .and_then(move |(bot, msg)| {
48 bot.document(msg.chat.id)
49 .file(("poem.txt", text.as_bytes()))
50 .caption("The Chaos")
51 .send()
52 })
53 .for_each(|_| Ok(()));
54
55 // enter the main loop
56 bot.run_with(handle);
57}pub fn parse_mode<S>(self, val: S) -> Self
pub fn disable_notification<S>(self, val: S) -> Self
pub fn reply_to_message_id<S>(self, val: S) -> Self
pub fn reply_markup<S>(self, val: S) -> Selfwhere
S: Into<ReplyMarkup>,
Sourcepub fn file<S, E>(self, val: S) -> Selfwhere
S: TryIntoFile<Error = E>,
pub fn file<S, E>(self, val: S) -> Selfwhere
S: TryIntoFile<Error = E>,
Examples found in repository?
examples/send_self.rs (line 15)
8fn main() {
9 // Create the bot
10 let mut bot = Bot::new(&env::var("TELEGRAM_BOT_KEY").unwrap()).update_interval(200);
11
12 let handle = bot.new_cmd("/send_self")
13 .and_then(|(bot, msg)| {
14 bot.document(msg.chat.id)
15 .file("examples/send_self.rs")
16 .send()
17 })
18 .for_each(|_| Ok(()));
19
20 // enter the main loop
21 bot.run_with(handle);
22}More examples
examples/send_memory.rs (line 49)
8fn main() {
9 // Create the bot
10 let mut bot = Bot::new(&env::var("TELEGRAM_BOT_KEY").unwrap()).update_interval(200);
11
12 let text = r"
13Dearest creature in creation,
14Study English pronunciation.
15I will teach you in my verse
16Sounds like corpse, corps, horse, and worse.
17I will keep you, Suzy, busy,
18Make your head with heat grow dizzy.
19Tear in eye, your dress will tear.
20So shall I! Oh hear my prayer.
21
22Just compare heart, beard, and heard,
23Dies and diet, lord and word,
24Sword and sward, retain and Britain.
25(Mind the latter, how it's written.)
26Now I surely will not plague you
27With such words as plaque and ague.
28But be careful how you speak:
29Say break and steak, but bleak and streak;
30Cloven, oven, how and low,
31Script, receipt, show, poem, and toe.
32
33Hear me say, devoid of trickery,
34Daughter, laughter, and Terpsichore,
35Typhoid, measles, topsails, aisles,
36Exiles, similes, and reviles;
37Scholar, vicar, and cigar,
38Solar, mica, war and far;
39One, anemone, Balmoral,
40Kitchen, lichen, laundry, laurel;
41Gertrude, German, wind and mind,
42Scene, Melpomene, mankind.
43
44...";
45
46 let handle = bot.new_cmd("/send")
47 .and_then(move |(bot, msg)| {
48 bot.document(msg.chat.id)
49 .file(("poem.txt", text.as_bytes()))
50 .caption("The Chaos")
51 .send()
52 })
53 .for_each(|_| Ok(()));
54
55 // enter the main loop
56 bot.run_with(handle);
57}Auto Trait Implementations§
impl !RefUnwindSafe for WrapperSendDocument
impl !Sync for WrapperSendDocument
impl !UnwindSafe for WrapperSendDocument
impl Freeze for WrapperSendDocument
impl Send for WrapperSendDocument
impl Unpin for WrapperSendDocument
impl UnsafeUnpin for WrapperSendDocument
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more