aboutsummaryrefslogtreecommitdiff
path: root/modules/rest_api.py
diff options
context:
space:
mode:
Diffstat (limited to 'modules/rest_api.py')
-rw-r--r--modules/rest_api.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/modules/rest_api.py b/modules/rest_api.py
index 28d05aed..601eebd8 100644
--- a/modules/rest_api.py
+++ b/modules/rest_api.py
@@ -30,9 +30,10 @@ class Handler(http.server.BaseHTTPRequestHandler):
if path.startswith("/api/"):
event_response = None
try:
- event_response = _events.on("api").on(method).on(
+ event_response = _bot.trigger(lambda:
+ _events.on("api").on(method).on(
endpoint).call_unsafe_for_result(params=params,
- path=args, data=data, headers=dict(self.headers))
+ path=args, data=data, headers=dict(self.headers)))
except Exception as e:
_log.error("failed to call API endpoint \"%s\"",
[path], exc_info=True)