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.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ae7bf5cbd664ad15047b8b837f8b6086d6e868f15006f8da5dede0b71ee26195 |
|
MD5 | 2a54741727bdb81490e20660c6a4f266 |
|
BLAKE2b-256 | 0fd4d794523f190b812fd042ba7f214f1cbae3e9a82d6721d77b0bce8c5d652f |