slack api decorator
Project description
slack-api-decorator
Slack-API-decorator provides simple decorator to receive slack-payload: Slash Command
and Event Subscription
.
install
$ pip install slackapidecorator
usage
Slash Command
from slack_api_decorator import SlashCommand
sc = SlashCommand(app_name="sample")
@sc.add(command="/example")
def accept_example(params):
return params
sc.execute(params={"payload from": "slack"})
Event Subscription
The events below are supported:
file_upload
message
reaction_added
from slack_api_decorator import EventSubscription
event_subscription = EventSubscription(app_name="sample")
@event_subscription.add(event_type="file_upload")
def file_upload_example(params):
return params
@event_subscription.add("reaction_added", channel_id="Uxxxxxxxx")
def reaction_added_in_channel(params):
return params
event_subscription.execute(params={"payload from": "slack"})
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for slackapidecorator-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 10f526ef9843155d2ea63ac4e4ed7c46c1e55103570a1490fdbe3037cb419bfa |
|
MD5 | 9260bdc337fea177fd38c57403c2b1ae |
|
BLAKE2b-256 | 559cb97aec3b5a4d83519680fb46978e485beab85dde3d23fa9ae8dd930d353f |