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_uploadmessagereaction_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"})
Metadata
Release files for slackapidecorator 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| slackapidecorator-0.2.0.tar.gz | 8.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| slackapidecorator-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 19.9 kB
Release files / slackapidecorator-0.2.0.tar.gz
| Download URL | slackapidecorator-0.2.0.tar.gz |
|---|---|
| Size | 8.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
25d1c4113bebc2729d10452e50f73ec19f25e822b2779d39b135c2ccbba9ae67
|
|
BLAKE2b-256 checksum How to use checksums |
5d8a0fba49719e1c66ab808fcf2a79dc18a934075f82630cef563ad888dc7f89
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.7
|
Release files / slackapidecorator-0.2.0-py3-none-any.whl
| Download URL | slackapidecorator-0.2.0-py3-none-any.whl |
|---|---|
| Size | 11.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8b7331de98cb8c056e182e0d53da3d10bd8c02f3ccff958760128122088f94c6
|
|
BLAKE2b-256 checksum How to use checksums |
ed421b5d8e2ca1cd8ec3d842edaf970aaa0d7462c77a5b60dbbc4325f5ce930d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.7
|