a fun bot for the hc slack

feat: add command line starts with description

dunkirk.sh eb986417 daa90739

verified
Changed files
+22 -3
src
features
takes
handlers
setup
+1 -1
src/features/takes/handlers/help.ts
···
export default async function handleHelp(): Promise<MessageResponse> {
return {
-
text: `*Takes Commands*\n\n• \`/takes start [minutes]\` - Start a new takes session, optionally specifying duration\n• \`/takes pause\` - Pause your current session (max ${TakesConfig.MAX_PAUSE_DURATION} min)\n• \`/takes resume\` - Resume your paused session\n• \`/takes stop [notes]\` - End your current session with optional notes\n• \`/takes status\` - Check the status of your session\n• \`/takes history\` - View your past takes sessions`,
+
text: `*Takes Commands*\n\n• \`/takes start [description]\` - Start a new takes session, optionally specifying description\n• \`/takes pause\` - Pause your current session (max ${TakesConfig.MAX_PAUSE_DURATION} min)\n• \`/takes resume\` - Resume your paused session\n• \`/takes stop [notes]\` - End your current session with optional notes\n• \`/takes status\` - Check the status of your session\n• \`/takes history\` - View your past takes sessions`,
response_type: "ephemeral",
blocks: [
{
+21 -2
src/features/takes/setup/commands.ts
···
// Route to the appropriate handler function
switch (subcommand) {
-
case "start":
-
response = await handleStart(userId, channelId);
+
case "start": {
+
if (args.length < 2) {
+
response = getDescriptionBlocks();
+
break;
+
}
+
+
const descriptionInput = args.slice(1).join(" ");
+
+
if (!descriptionInput.trim()) {
+
response = getDescriptionBlocks(
+
"Please enter a note for your session.",
+
);
+
break;
+
}
+
+
response = await handleStart(
+
userId,
+
channelId,
+
descriptionInput,
+
);
break;
+
}
case "pause":
response = await handlePause(userId);
break;