Struct telebot::bot::Bot
[−]
[src]
pub struct Bot { pub key: String, pub handle: Handle, pub last_id: Cell<u32>, pub update_interval: Cell<u64>, pub handlers: RefCell<HashMap<String, UnboundedSender<(RcBot, Message)>>>, pub session: Session, }
The main bot structure
Fields
key: String
handle: Handle
last_id: Cell<u32>
update_interval: Cell<u64>
handlers: RefCell<HashMap<String, UnboundedSender<(RcBot, Message)>>>
session: Session
Methods
impl Bot
[src]
fn new(handle: Handle, key: &str) -> Bot
[src]
fn fetch_json<'a>(
&self,
func: &str,
msg: &str
) -> impl Future<Item = String, Error = Error> + 'a
[src]
&self,
func: &str,
msg: &str
) -> impl Future<Item = String, Error = Error> + 'a
Creates a new request and adds a JSON message to it. The returned Future contains a the reply as a string. This method should be used if no file is added because a JSON msg is always compacter than a formdata one.
fn fetch_formdata<'a, T>(
&self,
func: &str,
msg: Value,
file: T,
kind: &str,
file_name: &str
) -> impl Future<Item = String, Error = Error> + 'a where
T: Read,
[src]
&self,
func: &str,
msg: Value,
file: T,
kind: &str,
file_name: &str
) -> impl Future<Item = String, Error = Error> + 'a where
T: Read,
Creates a new request with some byte content (e.g. a file). The method properties have to be in the formdata setup and cannot be sent as JSON.
fn _fetch<'a>(
&self,
func: &str,
a: Easy
) -> impl Future<Item = String, Error = Error> + 'a
[src]
&self,
func: &str,
a: Easy
) -> impl Future<Item = String, Error = Error> + 'a
calls cURL and parses the result for an error