-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add VideoPost message type #145
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@huan ping |
Shall we also add like and comments related method in this PR? |
Here #149 , I will merge it into this PR later. |
src/mod.ts
Outdated
VideoPostPayload, | ||
} from './schemas/video-post.js' | ||
import type { | ||
CommentPayload, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about we reuse Message
for comments?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean discard Comment
class ? Or only reuse MessagePayload
for CommentPayload
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If so, how do you think about it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree, see: wechaty/wechaty#2245 (comment)
src/schemas/comment.ts
Outdated
@@ -0,0 +1,7 @@ | |||
export interface CommentPayload { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to consider reusing the Message payload first.
replyId
is like we are quoting another message?
Discussion is welcome.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree, show my draft design here:
-
add
MessageType.Comment
-
add
quoteId
toMessagePayloadBase
-
methods change
- commentContent() -> comment() // differ with message.say()
- commentRevoke() -> delete() // differ with message.recall()
- commentReply() -> reply()
@@ -0,0 +1,4 @@ | |||
export interface ListOption { | |||
pageSize: number, | |||
currentPage: number, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to the Google Cloud API Design guides, where should we put the next_page_token
in this payload?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't agree, next_page_token
is in response object. Use pageToken
replace currentPage
.
And then I would add startAfter
, it could make get list more flexibly.
interface ListOption {
pageSize: number,
pageToken?: number,
startAfter?: string,
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
startAfter
is not a good name, because the list should be a [start, end) range.
To include the start number, the name of startFrom
would be better than startAfter
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we want to get the list which start from one specific KEY
, how to do with ListOption
?
For example, Moment timeline, when we want to get the next page, we should specific the last moment id as the KEY
.
Due to the moment timeline will have new moment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question about the type of startAfter
the list should be a [start, end) range.
-
number
Vote for rename it to
startFrom
. -
string
Vote for keep
startAfter
, due to we only known thestartAfter
key.
Merge to #182 |
Related issue: #144