From 70282e3596ffaeb37d9da5e7ea55d8834ff9e53f Mon Sep 17 00:00:00 2001 From: Andrew Williams Date: Sun, 17 Aug 2025 00:02:17 +0100 Subject: [PATCH] Add some comments --- smsbot/webhook.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/smsbot/webhook.py b/smsbot/webhook.py index 1f79275..9477585 100644 --- a/smsbot/webhook.py +++ b/smsbot/webhook.py @@ -17,6 +17,9 @@ CALL_COUNT = Counter("webhook_call_count", "Total number of calls processed") class TwilioWebhookHandler(object): + """ + A wrapped Flask app handling webhooks received from Twilio + """ def __init__(self, account_sid: str | None = None, auth_token: str | None = None): self.app = Flask(self.__class__.__name__) self.app.add_url_rule("/", "index", self.index, methods=["GET"]) @@ -24,6 +27,7 @@ class TwilioWebhookHandler(object): self.app.add_url_rule("/message", "message", self.message, methods=["POST"]) self.app.add_url_rule("/call", "call", self.call, methods=["POST"]) + # Twilio auth details self.account_sid = account_sid self.auth_token = auth_token @@ -79,7 +83,7 @@ class TwilioWebhookHandler(object): return { "version": get_smsbot_version(), "owners": self.bot.owners, - "subscribers": self.bot.subscribers, + "subscribers": len(self.bot.subscribers), } @time(REQUEST_TIME)