Skip to content

teamwire_api/groups

Group

class Group()

A class representing a circle of users

Attributes

  • gid: unicode. The circle ID
  • title: unicode. The title or name of the circle
  • members: list of User objects. The members of the circle
  • owner: User object (None if not present). The user that created the circle
  • is_circle: boolean. Whether the object is a users circle
  • is_public: boolean. Whether the circle is public

get_members

def get_members()

Method to get the list of members of a circle

Returns

a list of User objects

is_member

def is_member(user)

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

class Groups()

An accessor to the circles visible to the bot.

get_group

async def get_group(gid)

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

async def 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