diff --git a/src/index.ts b/src/index.ts index 4b4e152..eed7ba4 100644 --- a/src/index.ts +++ b/src/index.ts @@ -39,6 +39,8 @@ function formatMenu(menu: ParsedMenu): string { } const sorted = [...menu.items].sort((a, b) => { + if (a.inactive !== b.inactive) return a.inactive ? 1 : -1 + if (a.price !== b.price) return a.price - b.price const na = parseInt(a.name.match(/^(\d+)\./)?.[1] ?? "99", 10) const nb = parseInt(b.name.match(/^(\d+)\./)?.[1] ?? "99", 10) return na - nb @@ -58,6 +60,7 @@ async function tg(text: string): Promise { return } await sendMessage(config.telegram.botToken, config.telegram.chatId, text) + console.log(`TG sent: ${text.slice(0, 80)}${text.length > 80 ? "…" : ""}`) } async function main() {