Python API wrapper for Rocket.Chat's REST API, enabling developers to programmatically interact with Rocket.Chat servers for chat automation, bot development, and integration purposes
—
Server asset management for uploading and managing custom assets like logos, favicons, and other server branding elements.
def assets_set_asset(self, asset_name, file, **kwargs):
"""
Set/upload a server asset.
Parameters:
- asset_name (str): Asset name (logo, favicon, etc.)
- file (str): File path to upload
Returns:
requests.Response: Asset upload result
"""
def assets_unset_asset(self, asset_name, **kwargs):
"""
Remove/unset a server asset.
Parameters:
- asset_name (str): Asset name to remove
Returns:
requests.Response: Asset removal result
"""AssetTypes = [
"logo", # Server logo
"favicon", # Favicon
"background", # Background image
"loginBackground" # Login background
]# Upload server logo
result = rocket.assets_set_asset(
asset_name='logo',
file='/path/to/logo.png'
)
# Upload favicon
rocket.assets_set_asset(
asset_name='favicon',
file='/path/to/favicon.ico'
)
# Remove asset
rocket.assets_unset_asset('background')Install with Tessl CLI
npx tessl i tessl/pypi-rocketchat-a-p-i