WebHook broker that accepts notifications from multiple platforms and performs simple actions in response
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

reportbot.py 408B

1234567891011121314151617
  1. import requests
  2. from .service import Service
  3. class ReportBot(Service):
  4. def __init__(self, url, key, channel):
  5. super().__init__("reportbot")
  6. self._url = url
  7. self._key = key
  8. self._channel = channel
  9. def announce(self, message):
  10. requests.post(
  11. self._url,
  12. {"key": self._key, "command": f"CM {self._channel}", "args": message},
  13. )