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>
30 lines
No EOL
1.8 KiB
JavaScript
30 lines
No EOL
1.8 KiB
JavaScript
// 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 <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);
|
||
} |