Struct groupme_bot::Bot
[−]
[src]
pub struct Bot { /* fields omitted */ }
Groupme Bot interface for posting messages.
Methods
impl Bot
[src]
pub fn post(&self, text: &str) -> Result<(), GroupmeError>
[src]
Causes the bot to post a new message.
Errors
Returns an Err(GroupmeError::AuthError)
if the bot_id is not found.
Examples
use groupme_bot::{Groupme, Bot}; let groupme = Groupme::new(None); let bot: Bot = groupme.bot("Some bot_id"); bot.post("Hello from Rust!").unwrap();
pub fn post_image(
&self,
text: &str,
picture_url: &str
) -> Result<(), GroupmeError>
[src]
&self,
text: &str,
picture_url: &str
) -> Result<(), GroupmeError>
Causes the bot to post an image and message.
Groupme will only accept image urls from their Image Service.
Errors
Returns an Err(GroupmeError::AuthError)
if the bot_id is not found.
Examples
use groupme_bot::{Groupme, Bot}; let groupme = Groupme::new(None); let bot: Bot = groupme.bot("Some bot_id"); bot.post_image("Hello from Rust!", "https://i.groupme.com/something.large").unwrap();
pub fn bot_id(&self) -> &str
[src]
Returns the bot_id for any created bot.
Is not garanteed to match Groupme API if the Bot
was created from its bot_id.