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.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8b7331de98cb8c056e182e0d53da3d10bd8c02f3ccff958760128122088f94c6 |
|
MD5 | cd836d21071028a3e20a17581faa08d7 |
|
BLAKE2b-256 | ed421b5d8e2ca1cd8ec3d842edaf970aaa0d7462c77a5b60dbbc4325f5ce930d |