RyoNkmr / slack_pinned_storage

A super progressive storage interface

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Slack Pinned Storage

Requirements

A Slack app token with following permission scopes.

  • chat:write:bot(required)
  • pins:read(required)
  • pins:write(required)
  • channels:read(optional)

channels:read is not required when channelId is given.

SlackApps

Basic Usage

Setting and getting a value

from slack_pinned_storage import SlackPinnedStorage

token = 'YOUR_SLACK_APP_TOKEN'
storageIdentifier = 'IDENTIFIER_STRING'
channel = '#channelName' or 'IDXXXXX'

sps = SlackPinnedStorage(token, storageIdentifier, channel)

sps.set({'hello': 'python', 'fun': True})

sps.get()
>>> {'hello': 'python', 'fun': True}

After setting a value, post a json-stringified data as a message in the channel. IDENTIFIER_STRING{"hello": "python", "fun": true}

About

A super progressive storage interface

License:MIT License


Languages

Language:Python 100.0%