Send Telegram notices, answer phone commands and call the heartbeat (refs #52)
Every notice is written to the queue in the same transaction as what it tells, then sent every ten seconds. Each has a state: pending, sent, or failed with its error. Network failures and 429s are retried with growing pauses (Telegram's own wait when it gives one). Refusals are final. A notice that could not leave within a day is given up instead of arriving late. Every fill now also reaches the phone, and so do pause, resume and restart. Commands are read by long polling and obeyed only from the configured chat and only when fresh, so yesterday's /pausa never pauses today. They are /stato, /posizioni, /oggi, /pausa, /riprendi, /ferma (confirmed with /conferma within two minutes) and /aiuto. Restarting after "Ferma tutto", real money, limits and keys stay in the interface. Also added: - the heartbeat call every minute when an address is configured; - the morning summary at 08:00, caught up within four hours; - an optional hourly or evening status; - a Telegram section in Impostazioni: test-before-save, a test button, the queue's state and the last successful heartbeat; - on desktop, the first-run page recommends the heartbeat. Tests run against a fake Telegram server, including the commands through the real server. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
d00dfbd32f
commit
84c540786c
16 files changed
+1416
-17
No files matched your search
@@ -76,6 +76,9 @@ internal sealed record ServerOverrides
|
||||
|
||||
public Func<Anubis.Brokers.IWebSocketTransport>? MarketSockets { get; init; }
|
||||
|
||||
/// <summary>Answers the Telegram calls and the sign of life instead of the network; tests without it have no Telegram.</summary>
|
||||
public HttpMessageHandler? TelegramHttp { get; init; }
|
||||
|
||||
/// <summary>True starts the accounts and the order managers in a test; off by default in tests.</summary>
|
||||
public bool? Trading { get; init; }
|
||||
}
|
||||
Reference in new issue
Block a user