Download src/cli/program/message/register.pins.ts from shimen/shinclaw: direct link, hf CLI and curl.
- Browser
- Download file 1.14 kB
-
https://huggingface.co/spaces/shimen/shinclaw/resolve/main/src/cli/program/message/register.pins.ts
- Command line
-
hf download hf://spaces/shimen/shinclaw/src/cli/program/message/register.pins.ts
-
curl -L -o register.pins.ts https://huggingface.co/spaces/shimen/shinclaw/resolve/main/src/cli/program/message/register.pins.ts
1.14 kB
| import type { Command } from "commander"; | |
| import type { MessageCliHelpers } from "./helpers.js"; | |
| export function registerMessagePinCommands(message: Command, helpers: MessageCliHelpers) { | |
| const pins = [ | |
| helpers | |
| .withMessageBase( | |
| helpers.withRequiredMessageTarget(message.command("pin").description("Pin a message")), | |
| ) | |
| .requiredOption("--message-id <id>", "Message id") | |
| .action(async (opts) => { | |
| await helpers.runMessageAction("pin", opts); | |
| }), | |
| helpers | |
| .withMessageBase( | |
| helpers.withRequiredMessageTarget(message.command("unpin").description("Unpin a message")), | |
| ) | |
| .requiredOption("--message-id <id>", "Message id") | |
| .action(async (opts) => { | |
| await helpers.runMessageAction("unpin", opts); | |
| }), | |
| helpers | |
| .withMessageBase( | |
| helpers.withRequiredMessageTarget( | |
| message.command("pins").description("List pinned messages"), | |
| ), | |
| ) | |
| .option("--limit <n>", "Result limit") | |
| .action(async (opts) => { | |
| await helpers.runMessageAction("list-pins", opts); | |
| }), | |
| ] as const; | |
| void pins; | |
| } | |