Skip to content

feat: comments reply command (#30)#33

Merged
jdwit merged 1 commit into
mainfrom
feat/comments-reply
Jun 13, 2026
Merged

feat: comments reply command (#30)#33
jdwit merged 1 commit into
mainfrom
feat/comments-reply

Conversation

@jdwit

@jdwit jdwit commented Jun 13, 2026

Copy link
Copy Markdown
Owner

Closes #30.

What

Adds a reply subcommand to the comments group:

ytstudio comments reply COMMENT_ID --text "Thanks for watching!"

It posts a public reply to a top-level comment via comments.insert (part="snippet", body={"snippet": {"parentId": ..., "textOriginal": ...}}), reusing the existing get_data_service() / api() / handle_api_error plumbing. On success it prints the new reply id, matching the publish/reject output style. Like the other moderation actions, it executes immediately (no --execute).

Notes

  • Flat replies: YouTube replies are flat, so COMMENT_ID must be a top-level comment id (the id shown by comments list), not a reply id. An invalid or non-top-level id (HTTP 400/404) returns a clear, actionable error instead of a traceback.
  • Scope: comments.insert needs youtube.force-ssl, which is already requested in SCOPES for moderation; no scope change needed.
  • Quota: comments.insert is a ~50-unit write; added to the cheatsheet in docs/api-quota.md.

Docs

  • docs/comments.md: new Reply section + quota note.
  • docs/api-quota.md: comments.insert row.
  • README.md: comments feature line now lists reply.

Tests

Three tests added in tests/test_comments.py mirroring the existing comments tests: successful reply (asserts the request body), required --text, and the invalid-parent error path. Full suite: 248 passed; ruff check and ruff format clean.

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.
@jdwit jdwit merged commit 5ee41da into main Jun 13, 2026
7 checks passed
@jdwit jdwit deleted the feat/comments-reply branch June 13, 2026 09:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add comments reply command

1 participant