Версия 1.0

This commit is contained in:
Whyverum
2025-05-20 09:12:05 +07:00
commit 0b3b957c0a
34 changed files with 1964 additions and 0 deletions

31
README.md Normal file
View File

@@ -0,0 +1,31 @@
# Создание поста
new_post = {
"id": "cat_post",
"author_id": 123,
"mod": "HTML",
"type": "photo",
"text": "Мой котик!",
"media": "cat.jpg",
"private": True,
"allowed_users": [456, 789],
"buttons": [[{
"type": "share",
"name": "Поделиться",
"params": {"message": "Посмотрите этого котика!"}
}]]
}
post_id = storage.create_post(new_post)
# Получение поста
post = storage.get_post(post_id, user_id=456) # Доступ разрешен
post = storage.get_post(post_id, user_id=000) # Доступ запрещен
# Поиск постов
results = storage.search_posts("котик", user_id=456)
# Обновление поста
storage.update_post(post_id, updater_id=123, updates={"text": "Новый текст"})
# Удаление поста
storage.delete_post(post_id, deleter_id=123)