bot/src/commands/help-me.ts
openaliro/openaliro
Module

help-me.ts

@file /help-me — collect the context once, match it, escalate honestly.

bot/src/commands/help-me.ts5 documented symbols

Overview

@file /help-me — collect the context once, match it, escalate honestly. The whole point of this bot. Support here costs three or four round trips before anyone knows which board, which image, and what the console said, so this asks for all of it in one form and posts a thread that already has the answer or already says there isn't one. Two interactions, not one. Discord will not let a command defer and then open a modal, so board and image are command options (enumerated, validated by Discord) and the free text is collected by the modal that the command returns. The selections ride through on the modal's custom_id. The matcher never speculates. No match is reported as no match and pings the maintainer, because "I don't recognise this" is a useful thing to tell somebody and a plausible guess is not.

depends on api.ts boards.ts citations.ts command.ts db.ts discord.ts followup.ts images.ts rigs.ts signatures.ts  ·  used by index.ts

API

Fexport function parseModalId(customId: string): Selections | null

bot/src/commands/help-me.ts:129

Parse what the modal carried through, rejecting anything not on the lists.

called by onModalSubmit  ·  calls isKnownBoard, isKnownImage

Fexport function threadName(board: string, expected: string, actual: string): string

bot/src/commands/help-me.ts:241

Discord caps a thread name at 100 characters and newlines read badly in a channel list.

called by onModalSubmit  ·  calls boardLabel

Fexport function consoleBlock(text: string): string

bot/src/commands/help-me.ts:247

The console paste, fenced, with the truncation stated rather than implied.

called by onModalSubmit

Fexport function contextBlock(input: BlockInput): string

bot/src/commands/help-me.ts:281

The context block. Says what is known, what matched and why, and what is still unknown. The last part matters: a report that looks complete but silently omits the NCS pin costs the round trip this bot exists to remove.

called by onModalSubmit  ·  calls boardLabel, imageLabel, matchesSection

Ffunction matchesSection(matches: BlockInput["matches"], budget: number): string

bot/src/commands/help-me.ts:318

The match list, trimmed to budget characters, saying what it dropped.

called by contextBlock  ·  calls formatCitations
Undocumented (3)

optionBoolean, handler, onModalSubmit