Download src/cli/program/message/register.read-edit-delete.ts from shimen/shinclaw: direct link, hf CLI and curl.
- Browser
- Download file 1.52 kB
-
https://huggingface.co/spaces/shimen/shinclaw/resolve/main/src/cli/program/message/register.read-edit-delete.ts
- Command line
-
hf download hf://spaces/shimen/shinclaw/src/cli/program/message/register.read-edit-delete.ts
-
curl -L -o register.read-edit-delete.ts https://huggingface.co/spaces/shimen/shinclaw/resolve/main/src/cli/program/message/register.read-edit-delete.ts
1.52 kB
| import type { Command } from "commander"; | |
| import type { MessageCliHelpers } from "./helpers.js"; | |
| export function registerMessageReadEditDeleteCommands( | |
| message: Command, | |
| helpers: MessageCliHelpers, | |
| ) { | |
| helpers | |
| .withMessageBase( | |
| helpers.withRequiredMessageTarget( | |
| message.command("read").description("Read recent messages"), | |
| ), | |
| ) | |
| .option("--limit <n>", "Result limit") | |
| .option("--before <id>", "Read/search before id") | |
| .option("--after <id>", "Read/search after id") | |
| .option("--around <id>", "Read around id") | |
| .option("--include-thread", "Include thread replies (Discord)", false) | |
| .action(async (opts) => { | |
| await helpers.runMessageAction("read", opts); | |
| }); | |
| helpers | |
| .withMessageBase( | |
| helpers.withRequiredMessageTarget( | |
| message | |
| .command("edit") | |
| .description("Edit a message") | |
| .requiredOption("--message-id <id>", "Message id") | |
| .requiredOption("-m, --message <text>", "Message body"), | |
| ), | |
| ) | |
| .option("--thread-id <id>", "Thread id (Telegram forum thread)") | |
| .action(async (opts) => { | |
| await helpers.runMessageAction("edit", opts); | |
| }); | |
| helpers | |
| .withMessageBase( | |
| helpers.withRequiredMessageTarget( | |
| message | |
| .command("delete") | |
| .description("Delete a message") | |
| .requiredOption("--message-id <id>", "Message id"), | |
| ), | |
| ) | |
| .action(async (opts) => { | |
| await helpers.runMessageAction("delete", opts); | |
| }); | |
| } | |