diff options
Diffstat (limited to 'api')
| -rw-r--r-- | api/telegram/bot/bot.go | 3 | ||||
| -rw-r--r-- | api/telegram/bot/bot_test.go | 2 | ||||
| -rw-r--r-- | api/telegram/bot/dice.go | 2 | ||||
| -rw-r--r-- | api/telegram/bot/encrypted_credential.go | 4 | ||||
| -rw-r--r-- | api/telegram/bot/inline_keyboard_button.go | 2 | ||||
| -rw-r--r-- | api/telegram/bot/login_url.go | 6 | ||||
| -rw-r--r-- | api/telegram/bot/message_entity.go | 2 | ||||
| -rw-r--r-- | api/telegram/bot/options.go | 2 | ||||
| -rw-r--r-- | api/telegram/bot/passport_data.go | 2 | ||||
| -rw-r--r-- | api/telegram/bot/successful_payment.go | 2 | ||||
| -rw-r--r-- | api/telegram/bot/webhook.go | 2 | ||||
| -rw-r--r-- | api/telegram/bot/webhook_info.go | 2 |
12 files changed, 16 insertions, 15 deletions
diff --git a/api/telegram/bot/bot.go b/api/telegram/bot/bot.go index 48c53a4c..6fc853b6 100644 --- a/api/telegram/bot/bot.go +++ b/api/telegram/bot/bot.go @@ -79,7 +79,6 @@ const ( const ( methodDeleteWebhook = "deleteWebhook" methodGetMe = "getMe" - methodGetMyComands = "getMyCommands" methodGetWebhookInfo = "getWebhookInfo" methodSendMessage = "sendMessage" methodSetMyCommands = "setMyCommands" @@ -117,7 +116,7 @@ func New(opts Options) (bot *Bot, err error) { serverURL := defURL + opts.Token + "/" bot = &Bot{ opts: opts, - client: http.NewClient(serverURL, nil), + client: http.NewClient(serverURL, nil, false), } fmt.Printf("Bot options: %+v\n", opts) diff --git a/api/telegram/bot/bot_test.go b/api/telegram/bot/bot_test.go index 365e5e84..cdf40d92 100644 --- a/api/telegram/bot/bot_test.go +++ b/api/telegram/bot/bot_test.go @@ -15,7 +15,7 @@ const ( ) var ( - testBot *Bot + testBot *Bot //nolint: gochecknoglobals ) func TestMain(m *testing.M) { diff --git a/api/telegram/bot/dice.go b/api/telegram/bot/dice.go index 2ab09c2a..142d9b64 100644 --- a/api/telegram/bot/dice.go +++ b/api/telegram/bot/dice.go @@ -6,7 +6,7 @@ package bot // Dice represents a dice with random value from 1 to 6. (Yes, we're aware of // the “proper” singular of die. But it's awkward, and we decided to help it -// change. One dice at a time!) +// change. One dice at a time!). type Dice struct { Value int `json:"value"` // Value of the dice, 1-6 } diff --git a/api/telegram/bot/encrypted_credential.go b/api/telegram/bot/encrypted_credential.go index d4a92e55..1f713b62 100644 --- a/api/telegram/bot/encrypted_credential.go +++ b/api/telegram/bot/encrypted_credential.go @@ -5,7 +5,9 @@ package bot // -// EncryptedCredentials +// EncryptedCredentials contains data required for decrypting and +// authenticating EncryptedPassportElement. +// type EncryptedCredentials struct { // Base64-encoded encrypted JSON-serialized data with unique user's // payload, data hashes and secrets required for diff --git a/api/telegram/bot/inline_keyboard_button.go b/api/telegram/bot/inline_keyboard_button.go index 3bcc7f8d..42527841 100644 --- a/api/telegram/bot/inline_keyboard_button.go +++ b/api/telegram/bot/inline_keyboard_button.go @@ -17,7 +17,7 @@ type InlineKeyboardButton struct { // Optional. An HTTP URL used to automatically authorize the user. Can // be used as a replacement for the Telegram Login Widget. - LoginUrl *LoginUrl `json:"login_url"` + LoginURL *LoginURL `json:"login_url"` // Optional. Data to be sent in a callback query to the bot when // button is pressed, 1-64 bytes. diff --git a/api/telegram/bot/login_url.go b/api/telegram/bot/login_url.go index 86c62796..0d8ee809 100644 --- a/api/telegram/bot/login_url.go +++ b/api/telegram/bot/login_url.go @@ -5,13 +5,13 @@ package bot // -// LoginUrl represents a parameter of the inline keyboard button used to +// LoginURL represents a parameter of the inline keyboard button used to // automatically authorize a user. // Serves as a great replacement for the Telegram Login Widget when the user // is coming from Telegram. // All the user needs to do is tap/click a button and confirm that they want // to log in. -type LoginUrl struct { +type LoginURL struct { // An HTTP URL to be opened with user authorization data added to the // query string when the button is pressed. If the user refuses to // provide authorization data, the original URL without information @@ -21,7 +21,7 @@ type LoginUrl struct { // NOTE: You must always check the hash of the received data to verify // the authentication and the integrity of the data as described in // Checking authorization. - Url string `json:"url"` + URL string `json:"url"` // Optional. New text of the button in forwarded messages. ForwardText string `json:"forward_text"` diff --git a/api/telegram/bot/message_entity.go b/api/telegram/bot/message_entity.go index efff39c9..f38be566 100644 --- a/api/telegram/bot/message_entity.go +++ b/api/telegram/bot/message_entity.go @@ -4,7 +4,7 @@ package bot -// List of message entity types +// List of message entity types. const ( EntityTypeMention = "mention" // @username EntityTypeHashtag = "hashtag" // #hashtag diff --git a/api/telegram/bot/options.go b/api/telegram/bot/options.go index f798ca11..77dfae3e 100644 --- a/api/telegram/bot/options.go +++ b/api/telegram/bot/options.go @@ -35,7 +35,7 @@ type UpdateHandler func(update Update) // type Options struct { // Required. Your Bot authentication token. - // This option will be overriden by environment variable + // This option will be overridden by environment variable // TELEGRAM_TOKEN. Token string diff --git a/api/telegram/bot/passport_data.go b/api/telegram/bot/passport_data.go index 2adac683..526cec4e 100644 --- a/api/telegram/bot/passport_data.go +++ b/api/telegram/bot/passport_data.go @@ -10,7 +10,7 @@ package bot type PassportData struct { // Array with information about documents and other Telegram Passport // elements that was shared with the bot. - data []EncryptedPassportElement + data []EncryptedPassportElement //nolint: structcheck,unused // Encrypted credentials required to decrypt the data. Credentials EncryptedCredentials diff --git a/api/telegram/bot/successful_payment.go b/api/telegram/bot/successful_payment.go index 117d8101..9372fdc6 100644 --- a/api/telegram/bot/successful_payment.go +++ b/api/telegram/bot/successful_payment.go @@ -31,5 +31,5 @@ type SuccessfulPayment struct { TelegramPaymentChargeID string `json:"telegram_payment_charge_id"` // Provider payment identifier. - ProviderPaymentChargeID string `json:"telegram_payment_charge_id"` + ProviderPaymentChargeID string `json:"provider_payment_charge_id"` } diff --git a/api/telegram/bot/webhook.go b/api/telegram/bot/webhook.go index cbaf7eac..01358913 100644 --- a/api/telegram/bot/webhook.go +++ b/api/telegram/bot/webhook.go @@ -11,7 +11,7 @@ import "crypto/tls" // type Webhook struct { // HTTPS url to send updates to. - // This option will be overriden by environment variable + // This option will be overridden by environment variable // TELEGRAM_WEBHOOK_URL. URL string diff --git a/api/telegram/bot/webhook_info.go b/api/telegram/bot/webhook_info.go index 2206bf9b..d050598f 100644 --- a/api/telegram/bot/webhook_info.go +++ b/api/telegram/bot/webhook_info.go @@ -9,7 +9,7 @@ package bot // type WebhookInfo struct { // Webhook URL, may be empty if webhook is not set up. - Url string `json:"url"` + URL string `json:"url"` // Number of updates awaiting delivery PendingUpdateCount int `json:"pending_update_count"` |
