jackwener / jackwener/discord-cli

Feature: write commands (dc send / edit / delete)

Open
#3 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
131
Forks
29
PR merge metrics
No merged PRs in 30d

Description

## Motivation

The CLI is excellent for agent-driven, local-first reading (sync / search / export). The natural next step for an agent workflow is to *act* — reply in a channel, fix a typo in its own message, or retract one — without leaving the terminal. Today that requires a separate browser/automation layer.

## Proposal

Add three write subcommands under `dc`:

```
discord dc send ""
discord dc edit ""
discord dc delete
```

Implementation mirrors the existing read client:
- `client._mutate` (POST/PATCH/DELETE) reuses the same `_handle_rate_limit` backoff as `_get`.
- `send_message` / `edit_message` / `delete_message`.
- `db.update_message` / `db.delete_message` keep the local SQLite mirror consistent after a write.
- Output uses the shared `ok / schema_version / data` envelope; failures map to a clean error envelope (`forbidden`, `not_found`, …).

## Safety (does not weaken the user-token messaging)

Per CONTRIBUTING, writes are gated *more* strictly than reads, not less:
- every write prints a user-token risk warning;
- it confirms before writing, or requires `--yes`;
- in a non-interactive session it **refuses** to write without `--yes`, so a script can never post silently;
- single-shot calls only — no loops/bulk.

## Honest caveat — your call

Reading with a user token is a grey area; *automated writing* is a clearer ToS concern (self-bot). Totally understand if you'd rather keep this tool read-only, or ship it behind an explicit opt-in / env flag. Opening this to discuss whether you'd accept it before asking you to review the PR. Implementation is ready in #4 if you want to look.

Contributor guide

Open the contributing guide

Research direction

Start with the existing read client and its _get rate-limit handling, then inspect the proposed client._mutate, send_message/edit_message/delete_message, and db.update_message/delete_message entry points. Check CONTRIBUTING for the user-token warning and confirmation rules; done means the three single-shot commands, consistent SQLite updates, shared success envelopes, and clean failure envelopes are covered without non-interactive writes unless --yes is supplied.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, cli, database, security
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.