// src/commands/help.js export async function handleHelp(bot, trigger) { const isGroup = trigger.message.roomType === 'group'; let text = `### ServiceChannel Bot Help\n\n`; if (isGroup) { text += `- **/woSummary** — status of the workorder linked to this space\n`; text += `- **/woHistory** - History of AV issues.\n`; text += `- **/woAttachments** — download attachments for the workorder in this space\n`; text += `- **/avStatus** — AV device status for the store linked to this space\n`; text += `- **/woApprove** — (re)post proposal approval card for current WO (when WAITING FOR APPROVAL)\n`; text += `- **/confirmed** — confirm WO resolution (SC CONFIRMED if allowed, else note + ops)\n`; text += `- **/addNote** — add a note to this work order in ServiceChannel (include your text after the command)\n`; text += `- **/trackStatus** — refresh FedEx shipment tracking for this WO (auto-poll every 2h, 8am–6pm ET)\n`; text += `- **/trackTest** — one-off FedEx API lookup (not stored; for testing)\n`; text += `\nFedEx tracking numbers in SC notes (e.g. \`FEDEX 876239420601\`) are registered automatically. Delivered packages notify the ops space.\n`; } else { text += `- **/woSummary ** — status of any work order\n`; text += `- **/woHistory ** — History of AV issues.\n`; text += `- **/woAttachments ** — download attachments for any work order\n`; text += `- **/avStatus ** — AV device status for any store\n`; text += `- **/woApprove ** — post proposal approval card (manual)\n`; text += `- **/trackTest ** — one-off FedEx API lookup (not stored)\n`; } text += `\nType **/help** again in a 1:1 or group space for context-specific commands.`; await bot.say('markdown', text); }