Skip to content

Commit

Permalink
💬 add hook page as string
Browse files Browse the repository at this point in the history
  • Loading branch information
jorge-jrzz committed Jun 25, 2024
1 parent 3129ef9 commit f16006f
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 35 deletions.
38 changes: 37 additions & 1 deletion pynani/Messenger.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,42 @@ def jsonify(data: Union[Dict, str], status_code: int) -> Tuple:
return data.encode('utf-8'), status_code, {'Content-Type': 'text/html'}


HOOK_PAGE = """<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Verificación de Token</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 20px;
}
.container {
max-width: 600px;
margin: auto;
padding: 20px;
border: 1px solid #ccc;
border-radius: 5px;
background-color: #f9f9f9;
}
h1 {
text-align: center;
}
p {
text-align: center;
}
</style>
</head>
<body>
<div class="container">
<h1>Hello, World!</h1>
<p>This is the endpoint to verify the token 🔐🔗</p>
</div>
</body>
</html>"""


class Messenger():
"""
Initializes the Messenger class with the provided access token and page ID.
Expand Down Expand Up @@ -78,7 +114,7 @@ def verify_token(self, params: Dict, token: str) -> Tuple:
logger.info('Verification successful - %d', 200)
return jsonify(challenge, 200)
logger.warning('This endpoint is to verify token - %d', 200,)
return jsonify(Path("pynani/verify_token.html").read_text(encoding='utf-8'), 200)
return jsonify(HOOK_PAGE, 200)


def get_sender_id(self, data: dict) -> Optional[str]:
Expand Down
34 changes: 0 additions & 34 deletions pynani/verify_token.html

This file was deleted.

0 comments on commit f16006f

Please sign in to comment.