slack-term 1.26.2 → 1.26.3
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/dist/cli.js +62 -62
- package/package.json +1 -1
- package/ts/cli.ts +16 -0
package/package.json
CHANGED
package/ts/cli.ts
CHANGED
|
@@ -1577,6 +1577,16 @@ async function cmdScheduleSend(token: string, args: ScheduleSendArgs): Promise<v
|
|
|
1577
1577
|
// than anywhere else: the message goes out later, unattended, under whichever
|
|
1578
1578
|
// identity was current at schedule time.
|
|
1579
1579
|
const self = await getSelf();
|
|
1580
|
+
|
|
1581
|
+
// Self-DM is worst here: the message fires later, unattended, and Slack never
|
|
1582
|
+
// notifies you about your own post — so a scheduled reminder to yourself is
|
|
1583
|
+
// delivered into silence at exactly the moment you were counting on it.
|
|
1584
|
+
if (await isSelfDmChannel(token, channelId, self?.userId, args.cookie)) {
|
|
1585
|
+
console.error(
|
|
1586
|
+
`Warning: "${args.target}" is a DM to yourself — Slack will NOT notify you when this fires.`,
|
|
1587
|
+
);
|
|
1588
|
+
}
|
|
1589
|
+
|
|
1580
1590
|
const code = safetyCode(channelId, args.message, String(postAt), self?.userId ?? "");
|
|
1581
1591
|
|
|
1582
1592
|
if (args.code !== code) {
|
|
@@ -1668,6 +1678,12 @@ async function cmdUpload(token: string, args: UploadArgs): Promise<void> {
|
|
|
1668
1678
|
else if (args.userId) channelId = await openDm(token, args.userId, args.cookie);
|
|
1669
1679
|
else channelId = await resolveChannel(token, ref, args.cookie);
|
|
1670
1680
|
|
|
1681
|
+
// Same silent-delivery footgun as `send`: a file uploaded to your own DM
|
|
1682
|
+
// notifies nobody, so it lands and is never seen.
|
|
1683
|
+
if (await isSelfDmChannel(token, channelId, (await getSelf())?.userId, args.cookie)) {
|
|
1684
|
+
console.error(`Warning: "${args.target}" is a DM to yourself — Slack will NOT notify you of your own upload.`);
|
|
1685
|
+
}
|
|
1686
|
+
|
|
1671
1687
|
const isBatch = args.filePaths.length > 1;
|
|
1672
1688
|
const files = args.filePaths.map((fp) => {
|
|
1673
1689
|
const filename = basename(fp);
|