mirror of
https://github.com/nonebot/nonebot2.git
synced 2024-11-24 09:05:04 +08:00
49 lines
972 B
Python
49 lines
972 B
Python
from enum import Enum
|
|
from typing import List, Optional
|
|
|
|
from pydantic import BaseModel
|
|
|
|
|
|
class Headers(BaseModel):
|
|
sign: str
|
|
token: str
|
|
# ms
|
|
timestamp: int
|
|
|
|
|
|
class TextMessage(BaseModel):
|
|
content: str
|
|
|
|
|
|
class AtUsersItem(BaseModel):
|
|
dingtalkId: str
|
|
staffId: Optional[str]
|
|
|
|
|
|
class ConversationType(str, Enum):
|
|
private = '1'
|
|
group = '2'
|
|
|
|
|
|
class MessageModel(BaseModel):
|
|
msgtype: str = None
|
|
text: Optional[TextMessage] = None
|
|
msgId: str
|
|
# ms
|
|
createAt: int = None
|
|
conversationType: ConversationType = None
|
|
conversationId: str = None
|
|
conversationTitle: str = None
|
|
senderId: str = None
|
|
senderNick: str = None
|
|
senderCorpId: str = None
|
|
senderStaffId: str = None
|
|
chatbotUserId: str = None
|
|
chatbotCorpId: str = None
|
|
atUsers: List[AtUsersItem] = None
|
|
sessionWebhook: str = None
|
|
# ms
|
|
sessionWebhookExpiredTime: int = None
|
|
isAdmin: bool = None
|
|
isInAtList: bool = None
|