Functioncustom-idv0.2.7
Throws:
When no definition owns the wire, or when the matched one refuses it.
decodeFor<Defs>(
defs: Defs,
wire: string
): DecodedRoute<Defs>const Approve = new CustomId('approve').snowflake('userId');
const Reject = new CustomId('reject').snowflake('userId').str('reason');
const { prefix, params } = decodeFor([Approve, Reject], wire);
// params.reason exists on this branch alone
if (prefix === 'reject') await deny(params.userId, params.reason);Defs
Defsdefs
defs: DefsThe customId definitions to try, in order.
wire
wire: stringThe customId string from the interaction.