Skip to content
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

"telebot: result is True" #758

Closed
ofstudio opened this issue Nov 14, 2024 · 1 comment
Closed

"telebot: result is True" #758

ofstudio opened this issue Nov 14, 2024 · 1 comment

Comments

@ofstudio
Copy link

Success edit an InlineResult message always returns error ErrTrueResult

if _, err := c.Edit(c.InlineResult(), "foo bar"); err != nil {
    fmt.Println(err)
}

Output: telebot: result is True

What the purpose for ErrTrueResult?

gopkg.in/telebot.v4 v4.0.0-beta.4
go 1.23

@andriibeee
Copy link

telebot has ergonomic error flow handling, see how callbacks for new message must yield an error, i suppose the ErrTrueResult thing was made to distinguish successful response from nil without needing to return (error err, ok bool)-like tuple from handlers

@ofstudio ofstudio closed this as completed Dec 4, 2024
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

No branches or pull requests

2 participants