1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
//! Crypto-bank telegram chat bot module.
#![feature(test, try_trait, box_syntax, stmt_expr_attributes, proc_macro_hygiene)]

#[macro_use]
extern crate log;
#[macro_use]
extern crate failure;

#[macro_use]
extern crate serde_derive;
extern crate serde;

extern crate futures_async_stream;
extern crate tokio;

extern crate telegram_bot_async as telegram_client;

extern crate cxmr_balances;
extern crate cxmr_broker;
extern crate cxmr_exchanges;
#[macro_use]
extern crate err_convert_macro;

mod client;
mod handle;
pub mod plugins;
pub use self::client::*;
pub use self::handle::*;

/// Crypto market currency error type.
#[derive(Debug, Fail)]
pub enum Error {
    /// Option is `None` error.
    #[fail(display = "option none")]
    OptionNone,

    /// Telegram chat client error.
    #[fail(display = "telegram error: {}", _0)]
    Telegram(#[cause] telegram_client::Error),
}

err_converter!(Telegram, telegram_client::Error);
err_converter_no_args!(OptionNone, std::option::NoneError);