gitter¶
Gitter.im Web-API Bindings
Classes
|
AioHTTP based implementation of GitterAPI |
|
Sans-IO Base Class for Gitter API |
|
Gitter User Mention |
|
Gitter Chat Message |
|
Gitter Chat Room |
|
Gitter User |
Documentation
- class bioconda_utils.gitter.User(id: str, username: str, displayName: str, url: str, avatarUrl: str, avatarUrlSmall: str, avatarUrlMedium: str, v: str, gv: str, providers: Optional[List[str]] = None)[source]¶
Gitter User
Create new instance of User(id, username, displayName, url, avatarUrl, avatarUrlSmall, avatarUrlMedium, v, gv, providers)
- property id¶
User ID
- property username¶
Gitter username (OAUTH - Github/Gitlab)
- property displayName¶
Gitter displayname (real name)
- property url¶
Profile URL (relative)
- property avatarUrl¶
Avatar URL
- property avatarUrlSmall¶
Small avatar URL
- property avatarUrlMedium¶
Medium avatar URL
- property v¶
Version
- property gv¶
Gravatar Version (used to force cache flushing)
- property providers¶
List of OAUTH providers for user
- class bioconda_utils.gitter.Mention(screenName: str, userId: Optional[str] = None, userIds: Optional[List[str]] = None)[source]¶
Gitter User Mention
Create new instance of Mention(screenName, userId, userIds)
- property screenName¶
User Name
- property userId¶
User ID
- property userIds¶
User IDs
- class bioconda_utils.gitter.Message(id: str, text: str, html: str, sent: str, fromUser: User, unread: bool, readBy: int, urls: List[str], mentions: List[Mention], issues: List[str], meta: str, v: str, gv: Optional[str] = None, editedAt: Optional[str] = None)[source]¶
Gitter Chat Message
Create new instance of Message(id, text, html, sent, fromUser, unread, readBy, urls, mentions, issues, meta, v, gv, editedAt)
- property id¶
Message ID
- property text¶
Message content (markdown)
- property html¶
Message content (HTML)
- property sent¶
Posting timestamp (ISO)
- property fromUser¶
User by whom message was sent
- property unread¶
Flag indicating whether we have read this
- property readBy¶
Number of users who read message
- property urls¶
URLs present in message
- property mentions¶
@mentions in message
- property issues¶
Github #ISSUE references in message
- property meta¶
(Unused)
- property v¶
Version
- property gv¶
Gravatar Version (used to force cache flushing)
- property editedAt¶
Edit timestamp (ISO)
- class bioconda_utils.gitter.Room(id: str, name: str, topic: str, userCount: int, mentions: List[str], lurk: bool, url: str, githubType: str, tags: List[str], unreadItems: int, avatarUrl: str, roomMember: str, groupId: str, public: str, lastAccessTime: Optional[str] = None, favourite: bool = False, oneToOne: Optional[bool] = None, user: Optional[User] = None, uri: Optional[str] = None, security: Optional[str] = None, noindex: Optional[str] = None, group: Optional[str] = None, v: Optional[str] = None)[source]¶
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 id¶
Room ID
- property name¶
Room Name (e.g.
bioconda/Lobby
)
- property topic¶
Room Topic
- property userCount¶
List of users joined in room
- property mentions¶
Number of unread mentions of current user
- property lurk¶
Flag marking this room as silenced (no notifications)
- property url¶
URL to this room for browser
- property githubType¶
Type of room (
ORG
,REPO
,ONETOONE
,ORG_CHANNEL
,REPO_CHANNEL
,USER_CHANNEL
)
- property tags¶
List of tags attached to room
- property unreadItems¶
Number of unread messages for current user
- property avatarUrl¶
Gravatar URL
- property roomMember¶
unknown
- property groupId¶
unknown
- property public¶
unknown
- property lastAccessTime¶
Last time (ISO) room was accessed
- property favourite¶
Flag marking this room as favorite
- property oneToOne¶
Flag marking personal chats
- property user¶
User if one-to-one
- property uri¶
Room URI
- property security¶
Unknown
- property noindex¶
unknown
- property group¶
Unknown
- property v¶
Version
- class bioconda_utils.gitter.GitterAPI(token)[source]¶
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
Get list of current user's groups
get_user
()Get current user
iter_chat
(room)Listen to chat messages
Details
- async list_rooms(name=None)[source]¶
Get list of current user’s rooms
The list is filtered to match provided arguments.
- async edit_room(room, topic=None, tags=None, noindex=None)[source]¶
Set topic, tags or noindex for room
- Return type:
- async iter_chat(room)[source]¶
Listen to chat messages
- Parameters:
room (
Room
) – Room to listen in. Uselist_rooms
to findRoom
.- Return type:
- Returns:
async iterator over chat messages