bot/src/commands/ihave.ts
openaliro/openaliro
Module

ihave.ts

@file /ihave — register hardware.

bot/src/commands/ihave.ts1 documented symbols

Overview

@file /ihave — register hardware. Board, radio and NFC front-end are command options: Discord fills these in from choices before the interaction ever reaches this Worker, which is a client-validated dropdown exactly like a modal string select would be, and costs nothing against a modal's (unconfirmed) component limit. See bot/README.md for why those three fields live here and not in the modal. Everything else — phone model, iOS version, the awake window, and the UTC offset — is free text or needs a 25-option select the command-option choices list cannot hold (iOS version) or is genuinely one-shot text (the awake window), so it goes in a modal. The three option values are not available on the follow-up MODAL_SUBMIT interaction — it is a separate interaction — so they are smuggled through the modal's own custom_id.

depends on boards.ts command.ts discord.ts followup.ts modal.ts rigs.ts  ·  used by index.ts

flowchart TD
  decodeState --> isKnownBoard
  decodeState --> isKnownNfc
  decodeState --> isKnownRadio

API

Ffunction encodeState(board: string, radio: string, nfc: string): string

bot/src/commands/ihave.ts:75

ihave:board:radio:nfc — none of the three values can contain :, they are closed enums validated before this is built.

called by handler
Undocumented (3)

decodeState, handler, modalHandler