teamwire_api/groups¶
Group¶
A class representing a circle of users
Attributes
gid: unicode. The circle IDtitle: unicode. The title or name of the circlemembers: list of User objects. The members of the circleowner: User object (None if not present). The user that created the circleis_circle: boolean. Whether the object is a users circleis_public: boolean. Whether the circle is public
get_members¶
Method to get the list of members of a circle
Returns
a list of User objects
is_member¶
Method to check if a user is member of this group
Arguments
- user: string UID or User object. A user ID or a User object to be checked for membership in this group
Returns
True if the provided user is a member of the group
Groups¶
An accessor to the circles visible to the bot.
get_group¶
coroutine to get a circle by its legacy group id
Arguments
- gid: unicode. The legacy group id of the circle to be retrieved
Returns
a Group object
Raises
exceptions.TWNotFoundError if a circle with the provided legacy Group ID doesn't exist
exceptions.TWConnectionError in case of network error or timeout
exceptions.TWServerError in case of backend-related problems
get_list¶
Get all circles visible to the bot, incl. private circles.
Returns
a list of Group objects
Raises
exceptions.TWConnectionError in case of network error or timeout
exceptions.TWServerError in case of backend-related problems