attenpy 0.2.0__tar.gz → 0.2.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {attenpy-0.2.0 → attenpy-0.2.1}/PKG-INFO +1 -1
- {attenpy-0.2.0 → attenpy-0.2.1}/attenpy/__init__.py +3 -1
- {attenpy-0.2.0 → attenpy-0.2.1}/attenpy/endpoints/notices.py +1 -1
- {attenpy-0.2.0 → attenpy-0.2.1}/attenpy/models/__init__.py +2 -1
- {attenpy-0.2.0 → attenpy-0.2.1}/attenpy/models/attachment.py +10 -4
- {attenpy-0.2.0 → attenpy-0.2.1}/attenpy/models/notice.py +21 -15
- {attenpy-0.2.0 → attenpy-0.2.1}/attenpy.egg-info/PKG-INFO +1 -1
- {attenpy-0.2.0 → attenpy-0.2.1}/pyproject.toml +1 -1
- {attenpy-0.2.0 → attenpy-0.2.1}/LICENSE +0 -0
- {attenpy-0.2.0 → attenpy-0.2.1}/README.md +0 -0
- {attenpy-0.2.0 → attenpy-0.2.1}/attenpy/client.py +0 -0
- {attenpy-0.2.0 → attenpy-0.2.1}/attenpy/endpoints/__init__.py +0 -0
- {attenpy-0.2.0 → attenpy-0.2.1}/attenpy/endpoints/posts.py +0 -0
- {attenpy-0.2.0 → attenpy-0.2.1}/attenpy/endpoints/users.py +0 -0
- {attenpy-0.2.0 → attenpy-0.2.1}/attenpy/exceptions.py +0 -0
- {attenpy-0.2.0 → attenpy-0.2.1}/attenpy/http.py +0 -0
- {attenpy-0.2.0 → attenpy-0.2.1}/attenpy/models/base.py +0 -0
- {attenpy-0.2.0 → attenpy-0.2.1}/attenpy/models/post.py +0 -0
- {attenpy-0.2.0 → attenpy-0.2.1}/attenpy/models/user.py +0 -0
- {attenpy-0.2.0 → attenpy-0.2.1}/attenpy/pagination.py +0 -0
- {attenpy-0.2.0 → attenpy-0.2.1}/attenpy/payloads/__init__.py +0 -0
- {attenpy-0.2.0 → attenpy-0.2.1}/attenpy/payloads/notice.py +0 -0
- {attenpy-0.2.0 → attenpy-0.2.1}/attenpy/payloads/post.py +0 -0
- {attenpy-0.2.0 → attenpy-0.2.1}/attenpy/payloads/ws.py +0 -0
- {attenpy-0.2.0 → attenpy-0.2.1}/attenpy/ref.py +0 -0
- {attenpy-0.2.0 → attenpy-0.2.1}/attenpy/snowflake.py +0 -0
- {attenpy-0.2.0 → attenpy-0.2.1}/attenpy/types.py +0 -0
- {attenpy-0.2.0 → attenpy-0.2.1}/attenpy/utils.py +0 -0
- {attenpy-0.2.0 → attenpy-0.2.1}/attenpy/ws.py +0 -0
- {attenpy-0.2.0 → attenpy-0.2.1}/attenpy.egg-info/SOURCES.txt +0 -0
- {attenpy-0.2.0 → attenpy-0.2.1}/attenpy.egg-info/dependency_links.txt +0 -0
- {attenpy-0.2.0 → attenpy-0.2.1}/attenpy.egg-info/requires.txt +0 -0
- {attenpy-0.2.0 → attenpy-0.2.1}/attenpy.egg-info/top_level.txt +0 -0
- {attenpy-0.2.0 → attenpy-0.2.1}/setup.cfg +0 -0
|
@@ -2,6 +2,7 @@ from .client import Client
|
|
|
2
2
|
from .exceptions import AttenpyException, HTTPException, InvalidResponseError
|
|
3
3
|
from .models import (
|
|
4
4
|
Attachment,
|
|
5
|
+
AttachmentCategory,
|
|
5
6
|
Notice,
|
|
6
7
|
NoticeKind,
|
|
7
8
|
NoticeTarget,
|
|
@@ -20,10 +21,11 @@ from .payloads import (
|
|
|
20
21
|
from .ref import UserRef
|
|
21
22
|
from .snowflake import Snowflake
|
|
22
23
|
|
|
23
|
-
__version__ = "0.2.
|
|
24
|
+
__version__ = "0.2.1"
|
|
24
25
|
__all__ = [
|
|
25
26
|
"AttenpyException",
|
|
26
27
|
"Attachment",
|
|
28
|
+
"AttachmentCategory",
|
|
27
29
|
"BotReadyPayload",
|
|
28
30
|
"Client",
|
|
29
31
|
"HTTPException",
|
|
@@ -22,7 +22,7 @@ class NoticeEndpoint:
|
|
|
22
22
|
) -> AsyncIterator[Notice]:
|
|
23
23
|
params = None
|
|
24
24
|
if types:
|
|
25
|
-
params = {"type":
|
|
25
|
+
params = {"type": [i.value for i in set(types)]}
|
|
26
26
|
async for data in paginate(self.client.http, "/notices", params=params, **kw):
|
|
27
27
|
yield Notice.model_validate(data)
|
|
28
28
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from .attachment import Attachment, PartialAttachment
|
|
1
|
+
from .attachment import Attachment, AttachmentCategory, PartialAttachment
|
|
2
2
|
from .base import CursorPage, ErrorResponse, ListResponse, SuccessResponse
|
|
3
3
|
from .notice import Notice, NoticeKind, NoticeTarget, NoticeType
|
|
4
4
|
from .post import PartialPost, Post
|
|
@@ -12,6 +12,7 @@ User.model_rebuild()
|
|
|
12
12
|
|
|
13
13
|
__all__ = [
|
|
14
14
|
"Attachment",
|
|
15
|
+
"AttachmentCategory",
|
|
15
16
|
"CursorPage",
|
|
16
17
|
"ErrorResponse",
|
|
17
18
|
"PartialAttachment",
|
|
@@ -1,11 +1,19 @@
|
|
|
1
1
|
from datetime import datetime
|
|
2
|
-
from
|
|
2
|
+
from enum import Enum
|
|
3
3
|
|
|
4
4
|
from pydantic import BaseModel
|
|
5
5
|
|
|
6
6
|
from ..snowflake import Snowflake
|
|
7
7
|
|
|
8
8
|
|
|
9
|
+
class AttachmentCategory(str, Enum):
|
|
10
|
+
ICON = "icon"
|
|
11
|
+
BANNER = "banner"
|
|
12
|
+
POST_ATTACHMENT = "post_attachment"
|
|
13
|
+
GROUP_ICON = "group_icon"
|
|
14
|
+
CHAT_ATTACHMENT = "chat_attachment"
|
|
15
|
+
|
|
16
|
+
|
|
9
17
|
class PartialAttachment(BaseModel):
|
|
10
18
|
url: str
|
|
11
19
|
|
|
@@ -13,9 +21,7 @@ class PartialAttachment(BaseModel):
|
|
|
13
21
|
class Attachment(BaseModel):
|
|
14
22
|
id: int
|
|
15
23
|
url: str
|
|
16
|
-
category:
|
|
17
|
-
"icon", "banner", "post_attachment", "group_icon", "chat_attachment"
|
|
18
|
-
]
|
|
24
|
+
category: AttachmentCategory
|
|
19
25
|
mime: str
|
|
20
26
|
deleted: bool
|
|
21
27
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
from datetime import datetime
|
|
2
|
-
from
|
|
2
|
+
from enum import Enum
|
|
3
|
+
from typing import TYPE_CHECKING
|
|
3
4
|
|
|
4
5
|
from pydantic import BaseModel
|
|
5
6
|
|
|
@@ -8,20 +9,25 @@ from ..snowflake import Snowflake
|
|
|
8
9
|
if TYPE_CHECKING:
|
|
9
10
|
from .user import PartialUser
|
|
10
11
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
12
|
+
|
|
13
|
+
class NoticeType(str, Enum):
|
|
14
|
+
WELCOME = "welcome"
|
|
15
|
+
LOGIN = "login"
|
|
16
|
+
WARN = "warn"
|
|
17
|
+
FOLLOW = "follow"
|
|
18
|
+
MENTION = "mention"
|
|
19
|
+
REPLY = "reply"
|
|
20
|
+
QUOTE = "quote"
|
|
21
|
+
REPOST = "repost"
|
|
22
|
+
LOVE = "love"
|
|
23
|
+
INVITE_CHAT = "invite_chat"
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class NoticeKind(str, Enum):
|
|
27
|
+
SESSION = "session"
|
|
28
|
+
POST = "post"
|
|
29
|
+
CHAT = "chat"
|
|
30
|
+
WARN = "warn"
|
|
25
31
|
|
|
26
32
|
|
|
27
33
|
class NoticeTarget(BaseModel):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|