INNER CODE UNIT · TypeScript
checkAlertConditions
alexanderwanyoike/the0 · example-bots/typescript-price-alerts/main.ts:209
function checkAlertConditions(
state: BotState,
priceData: { value: number; change_pct: number },
threshold: number,
symbol: string
): {
symbol: string;
type: string;
change_pct: number;
message: string;
severity: string;
} | null {
const now = Date.now();
if (now - state.lastAlertTime < 30000) {
return null;
}