slack-term 1.49.0 → 1.50.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -0
- package/dist/cli.js +272 -266
- package/package.json +1 -1
- package/ts/ask.ts +5 -5
- package/ts/botIntent.ts +1 -1
- package/ts/cli.ts +157 -114
- package/ts/identity.ts +152 -0
- package/ts/relay.ts +4 -0
- package/ts/relayInit.ts +2 -1
- package/ts/sentlog.ts +3 -3
- package/ts/stream.ts +12 -0
- package/worker/src/slack.ts +12 -0
package/package.json
CHANGED
package/ts/ask.ts
CHANGED
|
@@ -543,19 +543,19 @@ export type AskParsed =
|
|
|
543
543
|
* the three causes have completely different fixes: wrong link, a body someone
|
|
544
544
|
* edited, or a bug here. */
|
|
545
545
|
export function askExplainReject(text: string): string {
|
|
546
|
-
if (!text.trim()) return "
|
|
546
|
+
if (!text.trim()) return "the message body is empty (it may be a bot post or an attachment-only message)";
|
|
547
547
|
const lines = text.split("\n");
|
|
548
548
|
const last = lines[lines.length - 1] ?? "";
|
|
549
549
|
if (text.startsWith(ASK_RESOLVED_PREFIX)) {
|
|
550
|
-
return "
|
|
550
|
+
return "it is marked answered, but the quoted answer text is missing";
|
|
551
551
|
}
|
|
552
552
|
if (!/_$/.test(last)) {
|
|
553
|
-
return "
|
|
553
|
+
return "it does not end with the `ask` instructions line — this message was not posted by `slack ask`, or its text has been edited";
|
|
554
554
|
}
|
|
555
555
|
if (!lines[0]!.startsWith(ASK_MARKER_PREFIX) && !lines[0]!.startsWith("*")) {
|
|
556
|
-
return "
|
|
556
|
+
return "it does not start with the (bold) question — its text may have been edited";
|
|
557
557
|
}
|
|
558
|
-
return "
|
|
558
|
+
return "cannot read the list of choices — they are not numbered consecutively from 1, or the text has been edited";
|
|
559
559
|
}
|
|
560
560
|
|
|
561
561
|
export function askParseMessage(text: string): AskParsed {
|
package/ts/botIntent.ts
CHANGED
|
@@ -33,7 +33,7 @@ export function isWriteCommand(path: (string | number)[]): boolean {
|
|
|
33
33
|
/** Read-only modes of a write command. `ask --ls` only reads the local
|
|
34
34
|
* sent-log and the questions' live state. (`ask --waitFor` and
|
|
35
35
|
* `poll --results` are NOT here: both can edit the posted message.) */
|
|
36
|
-
function isReadMode(path: (string | number)[], argv: Record<string, unknown>): boolean {
|
|
36
|
+
export function isReadMode(path: (string | number)[], argv: Record<string, unknown>): boolean {
|
|
37
37
|
return String(path[0] ?? "") === "ask" && argv.ls === true;
|
|
38
38
|
}
|
|
39
39
|
|