Impl msg/view and made Message compact with msg/view and quoted message.#224
Closed
sileence114 wants to merge 0 commit into
Closed
Impl msg/view and made Message compact with msg/view and quoted message.#224sileence114 wants to merge 0 commit into
sileence114 wants to merge 0 commit into
Conversation
TWT233
reviewed
Jan 17, 2024
TWT233
left a comment
Owner
There was a problem hiding this comment.
还没看 message.py,这个文件改动有点太大了,要稍晚一点看
| self.is_blocked: bool = kwargs.get('is_blocked') | ||
| self.is_target_blocked: bool = kwargs.get('is_target_blocked') | ||
| self.target_info: Dict = kwargs.get('target_info') | ||
| self.target_info: User = kwargs.get('target_info') |
Owner
There was a problem hiding this comment.
换成 User 的话需要构造,因为构造函数内部还有逻辑,不是纯 data class
Contributor
Author
There was a problem hiding this comment.
我保留一下兼容性:
self.target: User = User(...)
self._target_info: Dict = kwargs.get('target_info')
@property
def target_info(self):
warnings.warn("deprecated", ...)
return self._target_info
| req = api.Message.view(msg_id=msg_id) | ||
| return PublicMessage(_gate_=self.gate, **(await self.gate.exec_req(req))) | ||
|
|
||
| async def fetch_direct_message(self, chat_code: str, msg_id: str): |
Owner
There was a problem hiding this comment.
Suggested change
| async def fetch_direct_message(self, chat_code: str, msg_id: str): | |
| async def fetch_private_message(self, chat_code: str, msg_id: str): |
client层可以屏蔽掉底层API的命名,切换成我们提供的概念,统一性和可理解性更好
Owner
There was a problem hiding this comment.
可以单独提MR?不过涉及 PublicMessage,有没有先后次序关系
|
|
||
| def unpack_id(obj): | ||
| """extract obj's id if not basic data type""" | ||
| """extract objet's id if not basic data type""" |
Owner
There was a problem hiding this comment.
Suggested change
| """extract objet's id if not basic data type""" | |
| """extract object's id if not basic data type""" |
不过就用 obj 的话能对应参数名,方便理解
Contributor
Author
There was a problem hiding this comment.
obj's IDE 会划波浪线,不过不该也无所谓
TWT233
reviewed
Jan 19, 2024
Contributor
Author
两个小的MR已提交,修改doc-string的那个不管了。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
client.py
Client.fetch_message(...)Client.fetch_direct_message(...)message.py
更改为
其他