mirror of
https://github.com/marcogll/talia_bot.git
synced 2026-01-13 21:35:19 +00:00
docs: Add comprehensive comments and update README
This commit adds detailed inline comments and docstrings to all modules within the `app/modules/` directory to improve code clarity, readability, and maintainability. It also updates the `README.md` file to include `create_tag.py` and `print.py` in the "Módulos Funcionales" section, ensuring the documentation is synchronized with the codebase.
This commit is contained in:
@@ -1,12 +1,25 @@
|
||||
# app/modules/print.py
|
||||
"""
|
||||
This module provides a command for administrators to print out the current
|
||||
configuration details of the bot.
|
||||
|
||||
It is a debugging and administrative tool that allows authorized users to quickly
|
||||
inspect key configuration variables without accessing the environment directly.
|
||||
"""
|
||||
from telegram import Update
|
||||
from telegram.ext import ContextTypes
|
||||
from permissions import is_admin
|
||||
from config import TIMEZONE, CALENDAR_ID, N8N_WEBHOOK_URL
|
||||
from ..permissions import is_admin
|
||||
from ..config import TIMEZONE, CALENDAR_ID, N8N_WEBHOOK_URL
|
||||
|
||||
async def print_handler(update: Update, context: ContextTypes.DEFAULT_TYPE) -> None:
|
||||
"""Handles the /print command."""
|
||||
"""
|
||||
Handles the /print command.
|
||||
|
||||
When triggered, this function first checks if the user has admin privileges.
|
||||
If they do, it replies with a formatted message displaying the current values
|
||||
of the TIMEZONE, CALENDAR_ID, and N8N_WEBHOOK_URL configuration variables.
|
||||
If the user is not an admin, it sends a simple "not authorized" message.
|
||||
"""
|
||||
chat_id = update.effective_chat.id
|
||||
if is_admin(chat_id):
|
||||
config_details = (
|
||||
|
||||
Reference in New Issue
Block a user