fix(bot): 修復 /bot/internal/cmd 呼叫未定義 verify_internal_token
All checks were successful
CD Pipeline / deploy (push) Successful in 1m20s

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
ogt
2026-04-22 09:46:07 +08:00
parent 6852609cba
commit efd05a2f65

View File

@@ -5926,7 +5926,8 @@ def internal_cmd():
"""接受 momo-telegram-bot 轉發的 cmd:* 按鈕指令並執行"""
try:
token = request.headers.get('X-Internal-Token', '')
if not verify_internal_token(token):
_expected = os.getenv("INTERNAL_WEBHOOK_TOKEN", "")
if _expected and token != _expected:
return jsonify({'ok': False, 'error': 'Unauthorized'}), 401
body = request.get_json(silent=True) or {}
chat_id = body.get('chat_id')