]> git.giacomolli.uk - onechat/commitdiff
Call the Telegram Bot API
authorAnderson A. Giacomolli <agiacomolli@gmail.com>
Sat, 7 Nov 2026 13:18:47 +0000 (10:18 -0300)
committerAnderson A. Giacomolli <agiacomolli@gmail.com>
Sat, 7 Nov 2026 13:18:47 +0000 (10:18 -0300)
A small client of the Bot API, on the standard library only, waits for
new messages with getUpdates long polling, sends plain text with no
parse mode, and shows the typing action. It tells a failure that a later
try can fix, such as a network error, HTTP 429 with its wait, or a
server error, from one that it cannot.

The bot token is a part of each URL, and a net/http error holds the URL.
So no error of the client wraps a net/http error: it keeps only the text
of the cause, with the token removed. A test checks the error text of
each kind of failure for the token.

Issue: a143bd8


No differences found