Add /city — set the prayer location by name (groups + desktop fix) - #72
Merged
Conversation
Telegram offers no share-location button in group chats and none at all on Desktop, which made groups effectively unconfigurable from there. /city <name> forward-geocodes the typed place (Google Geocoding, localized), offers up to five matches as inline buttons, and funnels the pick through the same saveLocation path as a shared location. Admin-gated in groups; callback carries only rounded coordinates, so no picker state is stored. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Telegram renders the share-location button only in private chats, and Telegram Desktop can't attach a location at all — so a group (or a desktop-only user) had no reasonable way to configure the bot. This was the gap we discussed; option 1 (city-name lookup) won.
What
New
/city <name>command, available in both private and group chats (admin-gated in groups via the existingcanConfigurecheck):/city Istanbul→ forward-geocode via the Google Geocoding API (same key, localized to the chat language)/citywith no argument shows a localized usage hint; an unknown name gets a "try adding the country" reply.Implementation
port.LocationResolvergainsSearch(ctx, query, language); implemented in the Google Maps adapter (ZERO_RESULTS→ empty slice, not an error)domain.LocationCandidateDTO (label + coordinates only)handleLocation's persistence block extracted intosaveLocation, now shared by location messages and city picks — no behavior change for the existing flowcity:<lat>:<lng>with 3-decimal rounding — fits the 64-byte limit, no server-side picker state/cityregistered in the Telegram command menu (12 commands now);location_groupdead-end message now suggests/cityin all 8 localescity_usage,city_no_results,city_choose) ×8 locales, enforced by the completeness testPrivacy
Nothing new is stored: the chosen coordinates are a public city center, rounded to 3 decimals like every location write; Place ID only, no formatted address.
Tests
Searchhappy path (query/language params, label+coords parsing) andZERO_RESULTSrequest-flows.md) updated in-PRmake checkgreen (17 packages)🤖 Generated with Claude Code