Update webhook_handler.py
Browse files- webhook_handler.py +2 -2
webhook_handler.py
CHANGED
|
@@ -9,7 +9,7 @@ logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(
|
|
| 9 |
logger = logging.getLogger(__name__)
|
| 10 |
|
| 11 |
# Webhook secret for verification (set this when creating the webhook)
|
| 12 |
-
WEBHOOK_SECRET = "
|
| 13 |
|
| 14 |
class WebhookHandler(BaseHTTPRequestHandler):
|
| 15 |
def do_POST(self):
|
|
@@ -73,7 +73,7 @@ class WebhookHandler(BaseHTTPRequestHandler):
|
|
| 73 |
"""Handle dialin.connected event (e.g., trigger bot startup)."""
|
| 74 |
# Example: Send payload to /start endpoint (modify URL as needed)
|
| 75 |
import requests
|
| 76 |
-
start_url = "https
|
| 77 |
try:
|
| 78 |
response = requests.post(start_url, json=payload, timeout=5)
|
| 79 |
logger.info(f"Sent to /start: {response.status_code} - {response.text}")
|
|
|
|
| 9 |
logger = logging.getLogger(__name__)
|
| 10 |
|
| 11 |
# Webhook secret for verification (set this when creating the webhook)
|
| 12 |
+
WEBHOOK_SECRET = "your-base64-encoded-secret" # Replace with your secret
|
| 13 |
|
| 14 |
class WebhookHandler(BaseHTTPRequestHandler):
|
| 15 |
def do_POST(self):
|
|
|
|
| 73 |
"""Handle dialin.connected event (e.g., trigger bot startup)."""
|
| 74 |
# Example: Send payload to /start endpoint (modify URL as needed)
|
| 75 |
import requests
|
| 76 |
+
start_url = "https://<your-space>.hf.space/start" # Replace with your endpoint
|
| 77 |
try:
|
| 78 |
response = requests.post(start_url, json=payload, timeout=5)
|
| 79 |
logger.info(f"Sent to /start: {response.status_code} - {response.text}")
|