Skip to content

Commit

Permalink
Merge branch 'cwijesek/post-prod-deploy-fixes' into cwijesek/no-meeti…
Browse files Browse the repository at this point in the history
…ng-dm-remind
  • Loading branch information
QuantumManiac committed Feb 26, 2024
2 parents 3c7bc15 + 0684cb5 commit 778118a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/listeners/commands/helpCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import { logCommandUsed } from "../../utils/logging";
import { postEphemeralMessage } from "../../utils/slack";
import { SlackLogger } from "../../classes/SlackLogger";

const message = `For guides on how to use minerva's functionality, check out the feature reference guides in the Google Drive (<https://drive.google.com/drive/u/1/folders/1h7FZKuF3Zvv8EygjB8pSTk2aGuHHpBtj|link>)
* <https://docs.google.com/document/d/1KbeJtU06Uosjpd3XlvEGtElOx5lAZz9vDe8yzHyFhvU/edit#heading=h.g3pdvke98aqf|Meeting Reminders>
* <https://docs.google.com/document/d/1otYHtmFHzkN8g7089EGQpxi9-7C_iKFhDt2L2tuwxHs/edit#heading=h.8w6auka00s3p|Message Notifications>
const message = `For instructions on how to use minerva's functionality, check out the feature reference guides in the Google Drive (<https://drive.google.com/drive/u/1/folders/1h7FZKuF3Zvv8EygjB8pSTk2aGuHHpBtj|link>)
<https://docs.google.com/document/d/1KbeJtU06Uosjpd3XlvEGtElOx5lAZz9vDe8yzHyFhvU/edit#heading=h.g3pdvke98aqf|Meeting Reminders>
<https://docs.google.com/document/d/1otYHtmFHzkN8g7089EGQpxi9-7C_iKFhDt2L2tuwxHs/edit#heading=h.8w6auka00s3p|Message Notifications>
`;

/**
Expand Down
6 changes: 4 additions & 2 deletions src/listeners/commands/notifyCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export default async function notifyCommandHandler({

const responseMessage = `Notified ${
notifyType == NotifyType.DM_SINGLE_CHANNEL_GUESTS ? `${singleChannelGuestsMessaged} single-channel guests in` : ""
} channels ${channelSet
} channel(s) ${channelSet
.values()
.map((c) => `\`${c.name}\``)
.join(", ")} about message \`${messageUrl}\``;
Expand All @@ -119,7 +119,9 @@ export function parseNotifyCommand(command: string): NotifyParameters {
const tokens = command.split(" ");

if (tokens.length == 1 && tokens[0].trim() == "") {
throw new Error("Please provide a message to send. Usage: `/notify <messageURL>`");
throw new Error(
"Please provide a message to send. Usage: `/notify LINK {copy | copy-ping} [default] [#channel1 #channel2 …]`",
);
}

// Check if first token is a valid URL
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/commands/notifyCommand.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ describe("parseNotifyCommand", () => {
it("throws an error when the command is empty", () => {
const commandArgs = "";
expect(() => parseNotifyCommand(commandArgs)).toThrow(
"Please provide a message to send. Usage: `/notify <messageURL>`",
"Please provide a message to send. Usage: `/notify LINK {copy | copy-ping} [default] [#channel1 #channel2 …]`",
);
});

Expand Down

0 comments on commit 778118a

Please sign in to comment.