Skip to content

Deduplicate code, improve response accuracy. #202

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 124 commits into from
Nov 8, 2021
Merged

Deduplicate code, improve response accuracy. #202

merged 124 commits into from
Nov 8, 2021

Conversation

Syfaro
Copy link
Member

@Syfaro Syfaro commented Oct 8, 2018

This PR internally restructures the library so that new configs only need a params method instead of requiring a duplicated values method. It also removes the number of unnecessary functions that return an APIResponse, which is a breaking change. This would be tagged v5.

I'd love to get feedback on these changes, make sure I haven't overlooked anything obvious, and to hear if there's any other ideas for improving features that might result in backwards incompatible changes.

If you want to test this version, you can use go 1.11's mod tool to directly fetch the develop branch.

export GO111MODULES=on
go get github.com/go-telegram-bot-api/telegram-bot-api@develop

@Syfaro Syfaro merged commit 6b71d4d into master Nov 8, 2021
@Syfaro Syfaro deleted the develop branch November 8, 2021 19:29
@Syfaro Syfaro restored the develop branch November 8, 2021 19:29
@Syfaro Syfaro deleted the develop branch November 9, 2021 15:14
Comment on lines -467 to -480
// SetWebhook sets a webhook.
//
// If this is set, GetUpdates will not get any data!
//
// If you do not have a legitimate TLS certificate, you need to include
// your self signed certificate with the config.
func (bot *BotAPI) SetWebhook(config WebhookConfig) (APIResponse, error) {

if config.Certificate == nil {
v := url.Values{}
v.Add("url", config.URL.String())
if config.MaxConnections != 0 {
v.Add("max_connections", strconv.Itoa(config.MaxConnections))
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The README example needs to be updated correspondingly:

_, err = bot.SetWebhook(wh)

@liyishuai liyishuai mentioned this pull request Jan 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

How to get inline keyboard from callback query ?