Struct groupme_bot::Groupme
[−]
[src]
pub struct Groupme { /* fields omitted */ }
Local representation of Groupme API account for managing bots.
Methods
impl Groupme
[src]
pub fn new(token: Option<&str>) -> Groupme
[src]
Coustructs a new Groupme
.
Takes an optional API access token. The token is not needed to use post messages.
Examples
use groupme_bot::Groupme; let groupme: Groupme = Groupme::new(None); let groupme: Groupme = Groupme::new(Some("Secret API Token"));
pub fn bot(&self, bot_id: &str) -> Bot
[src]
Creates a Bot
from its bot id.
Examples
use groupme_bot::{Groupme, Bot}; let groupme: Groupme = Groupme::new(None); let bot: Bot = groupme.bot("Secret bot_id");
pub fn create_bot(
&self,
name: &str,
group_id: &str
) -> Result<BotBuilder, GroupmeError>
[src]
&self,
name: &str,
group_id: &str
) -> Result<BotBuilder, GroupmeError>
Creates a new Groupme for a group.
Takes a group_id. Group ids can be found with the groups API:
curl https://api.groupme.com/v3/groups?token=<token>
Errors
Will return a GroupmeError::NoTokenError
if there is no provided token.
Examples
use groupme_bot::{Groupme, Bot}; let groupme: Groupme = Groupme::new(Some("Required API Token")); let bot = groupme .create_bot("My bot", "Required group ID") .unwrap() .create() .unwrap();