staging #2
Loading…
Reference in a new issue
No description provided.
Delete branch "staging"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
pydantic-settings JSON-decodes complex fields inside the environment source, which runs before field validators. An empty ALLOWED_CHAT_IDS= therefore hit json.loads("") and aborted startup with a SettingsError - and .env.example ships exactly that value, so a first run from the documented config crashed in a loop. Mark the field NoDecode so the raw string reaches the validator, and widen the validator to accept an empty value, a comma-separated list, or a JSON array, tolerating surrounding brackets, quotes and whitespace. A non-numeric entry now reports which value was wrong instead of a bare JSON parse error. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>Printings picker: inline results for !p were photo results, which Telegram renders as a grid of near-identical card images. They are article results now, so they render as a list led by the set code and set name, followed by the collector number and price. The chosen printing's art still arrives with the message, as a link preview pinned above the text. Set lookup: {MSC} in a message, /set msc, or !s msc inline reports the set's name, type, release date and size, plus where its cards can be played. Scryfall tracks legality per card rather than per printing, so a set that reprints older cards holds a mix - MSC alone spans Standard-legal cards through to ones banned in Pauper. The summary therefore counts how many of the sampled cards are legal in each format and says so, rather than implying one answer for the whole set. Set codes share the brace syntax with mana symbols, so a code must be three to six alphanumerics with at least one letter; {R}, {10} and {100} never trigger a lookup, while 2X2, 40K and 10E still do. An unrecognised code is ignored rather than answered so conversation stays quiet, while /set always replies. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>The help text documents the new set syntax, and it was rendered with str.format(), which reads {MSC} as a replacement field. /start and /help both raised KeyError: 'MSC' and answered nothing. Render the help and about text with string.Template instead, so $username and $ask_note are the only placeholders and braces are literal. The templates exist to document brace syntax, so a substitution scheme that ignores braces is the one that fits. Fix the same bug in /rule, which was latent but reachable: implicit string concatenation merges the f-string and the following literal into one string before .format() is applied, so the already-interpolated user input was parsed for fields too. /rule {MSC} raised KeyError rather than reporting a bad rule number. Interpolate through the f-string alone. Checked every reply path that echoes user input against brace-heavy arguments; no .format() calls on templates remain. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>