Struct groupme_bot::Groupme [] [src]

pub struct Groupme { /* fields omitted */ }

Local representation of Groupme API account for managing bots.

Methods

impl Groupme
[src]

[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"));

[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");

[src]

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();

[src]

Destroys a bot and removes it from its group.

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: Bot = groupme.bot("Secret bot_id");

groupme.destroy(bot);

Trait Implementations

impl Debug for Groupme
[src]

[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl !Send for Groupme

impl !Sync for Groupme