send_memory/
send_memory.rs1use telebot::Bot;
2use futures::stream::Stream;
3use std::env;
4
5use telebot::functions::*;
7
8fn main() {
9 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 bot.run_with(handle);
57}