ошибка в названиях get_hastags и get_posts_by_hastag
This commit is contained in:
@@ -8,7 +8,7 @@ from requests.exceptions import HTTPError, ConnectionError
|
|||||||
from itd.routes.users import get_user, update_profile, follow, unfollow, get_followers, get_following, update_privacy
|
from itd.routes.users import get_user, update_profile, follow, unfollow, get_followers, get_following, update_privacy
|
||||||
from itd.routes.etc import get_top_clans, get_who_to_follow, get_platform_status
|
from itd.routes.etc import get_top_clans, get_who_to_follow, get_platform_status
|
||||||
from itd.routes.comments import get_comments, add_comment, delete_comment, like_comment, unlike_comment, add_reply_comment
|
from itd.routes.comments import get_comments, add_comment, delete_comment, like_comment, unlike_comment, add_reply_comment
|
||||||
from itd.routes.hashtags import get_hastags, get_posts_by_hastag
|
from itd.routes.hashtags import get_hashtags, get_posts_by_hashtag
|
||||||
from itd.routes.notifications import get_notifications, mark_as_read, mark_all_as_read, get_unread_notifications_count
|
from itd.routes.notifications import get_notifications, mark_as_read, mark_all_as_read, get_unread_notifications_count
|
||||||
from itd.routes.posts import create_post, get_posts, get_post, edit_post, delete_post, pin_post, repost, view_post, get_liked_posts
|
from itd.routes.posts import create_post, get_posts, get_post, edit_post, delete_post, pin_post, repost, view_post, get_liked_posts
|
||||||
from itd.routes.reports import report
|
from itd.routes.reports import report
|
||||||
@@ -527,7 +527,7 @@ class Client:
|
|||||||
Returns:
|
Returns:
|
||||||
list[Hashtag]: Список хэштэгов
|
list[Hashtag]: Список хэштэгов
|
||||||
"""
|
"""
|
||||||
res = get_hastags(self.token, limit)
|
res = get_hashtags(self.token, limit)
|
||||||
res.raise_for_status()
|
res.raise_for_status()
|
||||||
|
|
||||||
return [Hashtag.model_validate(hashtag) for hashtag in res.json()['data']['hashtags']]
|
return [Hashtag.model_validate(hashtag) for hashtag in res.json()['data']['hashtags']]
|
||||||
@@ -546,7 +546,7 @@ class Client:
|
|||||||
list[Post]: Посты
|
list[Post]: Посты
|
||||||
Pagination: Пагинация
|
Pagination: Пагинация
|
||||||
"""
|
"""
|
||||||
res = get_posts_by_hastag(self.token, hashtag, limit, cursor)
|
res = get_posts_by_hashtag(self.token, hashtag, limit, cursor)
|
||||||
res.raise_for_status()
|
res.raise_for_status()
|
||||||
data = res.json()['data']
|
data = res.json()['data']
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,17 @@
|
|||||||
|
from warnings import deprecated
|
||||||
from uuid import UUID
|
from uuid import UUID
|
||||||
from itd.request import fetch
|
from itd.request import fetch
|
||||||
|
|
||||||
|
@deprecated("get_hastags устарела используйте get_hashtags")
|
||||||
def get_hastags(token: str, limit: int = 10):
|
def get_hastags(token: str, limit: int = 10):
|
||||||
return fetch(token, 'get', 'hashtags/trending', {'limit': limit})
|
return fetch(token, 'get', 'hashtags/trending', {'limit': limit})
|
||||||
|
|
||||||
|
def get_hashtags(token: str, limit: int = 10):
|
||||||
|
return fetch(token, 'get', 'hashtags/trending', {'limit': limit})
|
||||||
|
|
||||||
|
@deprecated("get_posts_by_hastag устерла используй get_posts_by_hashtag")
|
||||||
def get_posts_by_hastag(token: str, hashtag: str, limit: int = 20, cursor: UUID | None = None):
|
def get_posts_by_hastag(token: str, hashtag: str, limit: int = 20, cursor: UUID | None = None):
|
||||||
return fetch(token, 'get', f'hashtags/{hashtag}/posts', {'limit': limit, 'cursor': cursor})
|
return fetch(token, 'get', f'hashtags/{hashtag}/posts', {'limit': limit, 'cursor': cursor})
|
||||||
|
|
||||||
|
def get_posts_by_hashtag(token: str, hashtag: str, limit: int = 20, cursor: UUID | None = None):
|
||||||
|
return fetch(token, 'get', f'hashtags/{hashtag}/posts', {'limit': limit, 'cursor': cursor})
|
||||||
|
|||||||
Reference in New Issue
Block a user