WebHook broker that accepts notifications from multiple platforms and performs simple actions in response
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

slack.py 424B

12345678910111213141516
  1. import json
  2. from .service import Service
  3. class Slack(Service):
  4. def __init__(self):
  5. super().__init__("slack")
  6. def accept_hook(self, identifier, request):
  7. if request.content_type == "application/json":
  8. content = request.json()
  9. else:
  10. content = json.loads(request.get_data()["payload"])
  11. yield {"type": f"slack", "source": identifier, "text": content["text"]}