staging #2

Merged
pyaniz merged 5 commits from staging into main 2026-08-15 15:34:12 -05:00
Owner
No description provided.
change build
All checks were successful
Build and Publish Containers / build-and-push (push) Successful in 27s
b6b39ac4cb
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>
all
All checks were successful
Build and Publish Containers / build-and-push (push) Successful in 18s
79a01c586c
feat: list printings by set, and look up sets by code
All checks were successful
Build and Publish Containers / build-and-push (push) Successful in 18s
62bbcf3c63
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>
fix: /help crashed on the {MSC} example in its own text
All checks were successful
Build and Publish Containers / build-and-push (push) Successful in 13s
24618e1627
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>
pyaniz merged commit 82a67ecda9 into main 2026-08-15 15:34:12 -05:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
pyaniz/mtg-bot!2
No description provided.