Slack API client providing comprehensive Python interface for messaging, file sharing, user management, and team communication features.
—
Manage reactions, starred items, pinned messages, and other interactive Slack features.
Add, view, and manage emoji reactions on messages and files.
def add(self, name, file_=None, file_comment=None, channel=None, timestamp=None):
"""
Add emoji reaction to message or file.
Args:
name (str): Emoji name (without colons, e.g., 'thumbsup')
file_ (str, optional): File ID to react to
file_comment (str, optional): File comment ID to react to
channel (str, optional): Channel ID (required with timestamp)
timestamp (str, optional): Message timestamp (required with channel)
Note: Must specify either file_/file_comment OR channel+timestamp
Returns:
Response: Reaction confirmation
"""
def get(self, file_=None, file_comment=None, channel=None, timestamp=None, full=None):
"""
Get reactions for message or file.
Args:
file_ (str, optional): File ID
file_comment (str, optional): File comment ID
channel (str, optional): Channel ID
timestamp (str, optional): Message timestamp
full (bool, optional): Include full user info in reactions
Returns:
Response: Reaction details with user information
"""
def list(self, user=None, full=None, count=None, page=None):
"""
List reactions by user.
Args:
user (str, optional): User ID (current user if None)
full (bool, optional): Include full item details
count (int, optional): Number of items per page
page (int, optional): Page number
Returns:
Response: User's reactions with context
"""
def remove(self, name, file_=None, file_comment=None, channel=None, timestamp=None):
"""
Remove emoji reaction from message or file.
Args:
name (str): Emoji name to remove
file_ (str, optional): File ID
file_comment (str, optional): File comment ID
channel (str, optional): Channel ID (required with timestamp)
timestamp (str, optional): Message timestamp (required with channel)
Returns:
Response: Removal confirmation
"""Star and unstar messages, files, and other items for easy reference.
def add(self, file_=None, file_comment=None, channel=None, timestamp=None):
"""
Star an item.
Args:
file_ (str, optional): File ID to star
file_comment (str, optional): File comment ID to star
channel (str, optional): Channel ID (for message starring)
timestamp (str, optional): Message timestamp (for message starring)
Note: Must specify at least one of the parameters
Returns:
Response: Star confirmation
"""
def list(self, user=None, count=None, page=None):
"""
List starred items.
Args:
user (str, optional): User ID (current user if None)
count (int, optional): Number of items per page
page (int, optional): Page number
Returns:
Response: List of starred items with details
"""
def remove(self, file_=None, file_comment=None, channel=None, timestamp=None):
"""
Remove star from an item.
Args:
file_ (str, optional): File ID to unstar
file_comment (str, optional): File comment ID to unstar
channel (str, optional): Channel ID (for message unstarring)
timestamp (str, optional): Message timestamp (for message unstarring)
Returns:
Response: Unstar confirmation
"""Pin and unpin messages and files in channels for easy reference.
def add(self, channel, file_=None, file_comment=None, timestamp=None):
"""
Pin an item to a channel.
Args:
channel (str): Channel ID to pin in
file_ (str, optional): File ID to pin
file_comment (str, optional): File comment ID to pin
timestamp (str, optional): Message timestamp to pin
Note: Must specify one of file_, file_comment, or timestamp
Returns:
Response: Pin confirmation
"""
def remove(self, channel, file_=None, file_comment=None, timestamp=None):
"""
Unpin an item from a channel.
Args:
channel (str): Channel ID to unpin from
file_ (str, optional): File ID to unpin
file_comment (str, optional): File comment ID to unpin
timestamp (str, optional): Message timestamp to unpin
Returns:
Response: Unpin confirmation
"""
def list(self, channel):
"""
List pinned items in a channel.
Args:
channel (str): Channel ID
Returns:
Response: List of pinned items in channel
"""Manage workspace custom emoji.
def list(self):
"""
List custom emoji in workspace.
Returns:
Response: Dictionary of custom emoji names and URLs
"""Usage:
# Add reaction to message
slack.reactions.add('thumbsup', channel='C1234567890', timestamp='1234567890.123456')
# Star a message
slack.stars.add(channel='C1234567890', timestamp='1234567890.123456')
# Pin a message
slack.pins.add('C1234567890', timestamp='1234567890.123456')
# List pinned items in channel
pins = slack.pins.list('C1234567890')
# Get custom emoji
emoji = slack.emoji.list()
for name, url in emoji.body['emoji'].items():
print(f":{name}: -> {url}")class Reactions(BaseAPI):
"""Emoji reaction management."""
def add(self, name, file_=None, file_comment=None, channel=None, timestamp=None): ...
def get(self, file_=None, file_comment=None, channel=None, timestamp=None, full=None): ...
def list(self, user=None, full=None, count=None, page=None): ...
def remove(self, name, file_=None, file_comment=None, channel=None, timestamp=None): ...
class Stars(BaseAPI):
"""Starred item management."""
def add(self, file_=None, file_comment=None, channel=None, timestamp=None): ...
def list(self, user=None, count=None, page=None): ...
def remove(self, file_=None, file_comment=None, channel=None, timestamp=None): ...
class Pins(BaseAPI):
"""Pinned item management."""
def add(self, channel, file_=None, file_comment=None, timestamp=None): ...
def remove(self, channel, file_=None, file_comment=None, timestamp=None): ...
def list(self, channel): ...
class Emoji(BaseAPI):
"""Custom emoji management."""
def list(self): ...Install with Tessl CLI
npx tessl i tessl/pypi-slacker