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