feat: comments reply command (#30)#33
Merged
Merged
Conversation
Add 'ytstudio comments reply COMMENT_ID --text ...' to post a public reply to a top-level comment via comments.insert. Validates that the parent is a top-level comment id (flat replies) with a clear error on an invalid or reply id, and prints the new reply id like publish/reject. Docs (comments.md, api-quota.md) and the README feature line updated; tests mirror the existing comments tests.
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.
Closes #30.
What
Adds a
replysubcommand to the comments group:It posts a public reply to a top-level comment via
comments.insert(part="snippet",body={"snippet": {"parentId": ..., "textOriginal": ...}}), reusing the existingget_data_service()/api()/handle_api_errorplumbing. On success it prints the new reply id, matching thepublish/rejectoutput style. Like the other moderation actions, it executes immediately (no--execute).Notes
COMMENT_IDmust be a top-level comment id (theidshown bycomments list), not a reply id. An invalid or non-top-level id (HTTP 400/404) returns a clear, actionable error instead of a traceback.comments.insertneedsyoutube.force-ssl, which is already requested inSCOPESfor moderation; no scope change needed.comments.insertis a ~50-unit write; added to the cheatsheet indocs/api-quota.md.Docs
docs/comments.md: new Reply section + quota note.docs/api-quota.md:comments.insertrow.README.md: comments feature line now lists reply.Tests
Three tests added in
tests/test_comments.pymirroring the existing comments tests: successful reply (asserts the request body), required--text, and the invalid-parent error path. Full suite: 248 passed;ruff checkandruff formatclean.