gitter

Gitter.im Web-API Bindings

Classes

AioGitterAPI(session, *args, **kwargs)

AioHTTP based implementation of GitterAPI

GitterAPI(token)

Sans-IO Base Class for Gitter API

Mention

Gitter User Mention

Message

Gitter Chat Message

Room

Gitter Chat Room

User

Gitter User

Documentation

class bioconda_utils.gitter.AioGitterAPI(session, *args, **kwargs)[source]

Bases: bioconda_utils.gitter.GitterAPI

AioHTTP based implementation of GitterAPI

class bioconda_utils.gitter.GitterAPI(token)[source]

Bases: object

Sans-IO Base Class for Gitter API

Methods

list_rooms([name])

Get list of current user’s rooms

get_room(uri)

Get a room using its URI

join_room(user, room)

Add user to a room

leave_room(user, room)

Remove user from room

edit_room(room[, topic, tags, noindex])

Set topic, tags or noindex for room

list_unread_items(user, room)

Get Ids for unread items of user in room

mark_as_read(user, room, ids)

Mark chat messages listed in ids as read

get_message(room, msgid)

Get a single message by its id

send_message(room, text, *args)

Send a new message

edit_message(room, message, text)

Edit a message

list_groups()

Get list of current user’s groups

get_user()

Get current user

iter_chat(room)

Listen to chat messages

Details

async edit_message(room, message, text)[source]

Edit a message

Return type

Message

async edit_room(room, topic=None, tags=None, noindex=None)[source]

Set topic, tags or noindex for room

Return type

None

async get_message(room, msgid)[source]

Get a single message by its id

Return type

Message

async get_room(uri)[source]

Get a room using its URI

Return type

Room

async get_user()[source]

Get current user

Return type

User

iter_chat(room)[source]

Listen to chat messages

Parameters

room (Room) – Room to listen in. Use list_rooms to find Room.

Return type

AsyncIterator[Message]

Returns

async iterator over chat messages

async join_room(user, room)[source]

Add user to a room

Return type

None

async leave_room(user, room)[source]

Remove user from room

Return type

bool

async list_groups()[source]

Get list of current user’s groups

async list_rooms(name=None)[source]

Get list of current user’s rooms

The list is filtered to match provided arguments.

Parameters

name (Optional[str]) – Room name

Return type

List[Room]

async list_unread_items(user, room)[source]

Get Ids for unread items of user in room

Return type

Tuple[List[str], List[str]]

Returns

Two lists of chat IDs are returned. The first are all unread mentions, the second only those in which the user was @Mentioned.

async mark_as_read(user, room, ids)[source]

Mark chat messages listed in ids as read

Return type

None

async send_message(room, text, *args)[source]

Send a new message

Return type

Message

class bioconda_utils.gitter.Mention[source]

Bases: tuple

Gitter User Mention

Create new instance of Mention(screenName, userId, userIds)

classmethod from_dict(data)[source]

Create User from dict

property screenName

User Name

property userId

User ID

property userIds

User IDs

class bioconda_utils.gitter.Message[source]

Bases: tuple

Gitter Chat Message

Create new instance of Message(id, text, html, sent, fromUser, unread, readBy, urls, mentions, issues, meta, v, gv, editedAt)

property editedAt

Edit timestamp (ISO)

property fromUser

User by whom message was sent

classmethod from_dict(data)[source]

Create Message from dict

property gv

Gravatar Version (used to force cache flushing)

property html

Message content (HTML)

property id

Message ID

property issues

Github #ISSUE references in message

property mentions

@mentions in message

property meta

(Unused)

property readBy

Number of users who read message

property sent

Posting timestamp (ISO)

property text

Message content (markdown)

property unread

Flag indicating whether we have read this

property urls

URLs present in message

property v

Version

class bioconda_utils.gitter.Room[source]

Bases: tuple

Gitter Chat Room

Create new instance of Room(id, name, topic, userCount, mentions, lurk, url, githubType, tags, unreadItems, avatarUrl, roomMember, groupId, public, lastAccessTime, favourite, oneToOne, user, uri, security, noindex, group, v)

property avatarUrl

Gravatar URL

property favourite

Flag marking this room as favorite

classmethod from_dict(data)[source]

Create Room from dict

property githubType

Type of room (ORG, REPO, ONETOONE, ORG_CHANNEL, REPO_CHANNEL, USER_CHANNEL)

property group

Unknown

property groupId

unknown

property id

Room ID

property lastAccessTime

Last time (ISO) room was accessed

property lurk

Flag marking this room as silenced (no notifications)

property mentions

Number of unread mentions of current user

property name

Room Name (e.g. bioconda/Lobby)

property noindex

unknown

property oneToOne

Flag marking personal chats

property public

unknown

property roomMember

unknown

property security

Unknown

property tags

List of tags attached to room

property topic

Room Topic

property unreadItems

Number of unread messages for current user

property uri

Room URI

property url

URL to this room for browser

property user

User if one-to-one

property userCount

List of users joined in room

property v

Version

class bioconda_utils.gitter.User[source]

Bases: tuple

Gitter User

Create new instance of User(id, username, displayName, url, avatarUrl, avatarUrlSmall, avatarUrlMedium, v, gv, providers)

property avatarUrl

Avatar URL

property avatarUrlMedium

Medium avatar URL

property avatarUrlSmall

Small avatar URL

property displayName

Gitter displayname (real name)

classmethod from_dict(data)[source]

Create User from dict

property gv

Gravatar Version (used to force cache flushing)

property id

User ID

property providers

List of OAUTH providers for user

property url

Profile URL (relative)

property username

Gitter username (OAUTH - Github/Gitlab)

property v

Version