[−][src]Macro tbot::bot
Constructs a new Bot
, extracting the token from the environment at
compile time.
You can provide a connector as the second parameter,
e.g. bot!("...", connector)
.
If you need to extract the token at runtime, use Bot::from_env
.
Example
use tbot::prelude::*; let mut bot = tbot::bot!("BOT_TOKEN"); let me = bot .get_me() .into_future() .map(|me| { dbg!(me); }) .map_err(|err| { dbg!(err); }); tbot::run(me);