Update documentation and code snippets

This commit is contained in:
2025-12-02 11:22:31 +03:00
parent 2ff47398ba
commit 7c20bf296b
23 changed files with 63 additions and 62 deletions
+2 -2
View File
@@ -5,7 +5,7 @@ router = Router(title="Data Example")
@router.command(Command("set", description="Set data"))
def set_handler(response: Response):
# Обновляем глобальное хранилище данных
# Update global data storage
response.update_data(
{
"user_name": "John",
@@ -18,7 +18,7 @@ def set_handler(response: Response):
@router.command(Command("show", description="Show data"))
def show_handler(response: Response):
# Получаем данные из глобального хранилища
# Get data from global storage
data = response.get_data()
if "user_name" in data:
print(f"User: {data['user_name']}")
+1 -1
View File
@@ -5,7 +5,7 @@ router = Router(title="Get Data Example")
@router.command(Command("info", description="Show all stored data"))
def info_handler(response: Response):
# Получаем все данные из глобального хранилища
# Get all data from global storage
all_data = response.get_data()
if all_data:
+1 -1
View File
@@ -5,7 +5,7 @@ router = Router(title="Clear Data Example")
@router.command(Command("clear", description="Clear all stored data"))
def clear_handler(response: Response):
# Очищаем всё хранилище данных
# Clear all data storage
response.clear_data()
print("All data cleared")
+2 -2
View File
@@ -17,12 +17,12 @@ def store_handler(response: Response):
@router.command(Command("remove", description="Remove specific key"))
def remove_handler(response: Response):
# Удаляем конкретный ключ из хранилища
# Delete specific key from storage
try:
response.delete_from_data("temp_key")
print("Key 'temp_key' deleted")
# Проверяем, что осталось
# Check what remains
remaining = response.get_data()
print(f"Remaining keys: {list(remaining.keys())}")
except KeyError: