servchan/src/commands/help.js
jmcqueen d6549c07f8 Add FedEx shipment tracking with polling, ops delivery alerts, and backfill.
Auto-register tracking numbers from SC notes, poll FedEx on a business-hours cron, and expose /trackStatus, /trackTest, and admin /track-backfill.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-26 07:06:48 -04:00

30 lines
No EOL
1.8 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// 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, 8am6pm 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 <WO-number>** — status of any work order\n`;
text += `- **/woHistory <store-number>** — History of AV issues.\n`;
text += `- **/woAttachments <WO-number>** — download attachments for any work order\n`;
text += `- **/avStatus <store-number>** — AV device status for any store\n`;
text += `- **/woApprove <WO-number>** — post proposal approval card (manual)\n`;
text += `- **/trackTest <tracking-number>** — 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);
}