diff options
Diffstat (limited to 'internal/bot/bot.go')
| -rw-r--r-- | internal/bot/bot.go | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/internal/bot/bot.go b/internal/bot/bot.go index 4abf02c..b361841 100644 --- a/internal/bot/bot.go +++ b/internal/bot/bot.go @@ -13,15 +13,13 @@ import ( cepis "cep.is/go" - "cep.is/telegrambot/internal/lookup" "cep.is/telegrambot/internal/telegram" ) // Lookups is the subset of the cep.is client this bot needs. Depending on the // interface rather than the concrete client keeps the seam narrow and visible. // -// A failure may be a [*lookup.NotFoundError], which still matches -// cepis.ErrCEPNotFound and additionally names the municipality the CEP would +// A failure may be a [*cepis.Error] carrying the municipality the CEP would // belong to; nothing here has to know that, because [ErrorMessage] reads it. type Lookups interface { Lookup(ctx context.Context, cep string) (*cepis.Address, error) @@ -273,8 +271,8 @@ func inlineErrorTitle(err error) string { // Titles and descriptions are plain text for Telegram, so nothing here is // escaped: HTML applies to the message body alone. func inlineErrorDescription(err error) string { - if faixa := lookup.FaixaOf(err); faixa != nil { - return "Cairia em " + faixa.Place() + " — toque para ver" + if faixa := faixaOf(err); faixa != nil { + return "Cairia em " + place(faixa) + " — toque para ver" } return "Toque para enviar o motivo" } |