|
|
|
@ -1,13 +1,13 @@
|
|
|
|
|
# Telebot
|
|
|
|
|
>"I never knew creating Telegram bots could be so _sexy_!"
|
|
|
|
|
|
|
|
|
|
[![GoDoc](https://godoc.org/gopkg.in/tucnak/telebot.v2?status.svg)](https://godoc.org/gopkg.in/tucnak/telebot.v2)
|
|
|
|
|
[![Travis](https://travis-ci.org/tucnak/telebot.svg?branch=v2)](https://travis-ci.org/tucnak/telebot)
|
|
|
|
|
[![GoDoc](https://godoc.org/gopkg.in/tucnak/telebot.v3?status.svg)](https://godoc.org/gopkg.in/tucnak/telebot.v3)
|
|
|
|
|
[![Travis](https://travis-ci.org/tucnak/telebot.svg?branch=v3)](https://travis-ci.org/tucnak/telebot)
|
|
|
|
|
[![codecov.io](https://codecov.io/gh/tucnak/telebot/coverage.svg?branch=develop)](https://codecov.io/gh/tucnak/telebot)
|
|
|
|
|
[![Discuss on Telegram](https://img.shields.io/badge/telegram-discuss-0088cc.svg)](https://t.me/go_telebot)
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
go get -u gopkg.in/tucnak/telebot.v2
|
|
|
|
|
go get -u gopkg.in/tucnak/telebot.v3
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
* [Overview](#overview)
|
|
|
|
@ -48,7 +48,7 @@ import (
|
|
|
|
|
"log"
|
|
|
|
|
"time"
|
|
|
|
|
|
|
|
|
|
tb "gopkg.in/tucnak/telebot.v2"
|
|
|
|
|
tele "gopkg.in/tucnak/telebot.v3"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
@ -66,8 +66,8 @@ func main() {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
b.Handle("/hello", func(m *tele.Message) {
|
|
|
|
|
b.Send(m.Sender, "Hello World!")
|
|
|
|
|
b.Handle("/hello", func(m tele.Context) error {
|
|
|
|
|
return m.Send("Hello")
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
b.Start()
|
|
|
|
@ -79,7 +79,7 @@ Simple, innit? Telebot's routing system takes care of delivering updates
|
|
|
|
|
to their endpoints, so in order to get to handle any meaningful event,
|
|
|
|
|
all you got to do is just plug your function to one of the Telebot-provided
|
|
|
|
|
endpoints. You can find the full list
|
|
|
|
|
[here](https://godoc.org/gopkg.in/tucnak/telebot.v2#pkg-constants).
|
|
|
|
|
[here](https://godoc.org/gopkg.in/tucnak/telebot.v3#pkg-constants).
|
|
|
|
|
|
|
|
|
|
```go
|
|
|
|
|
b, _ := tele.NewBot(settings)
|
|
|
|
@ -257,7 +257,7 @@ b.Send(user, "text", tele.Silent, tele.NoPreview)
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Full list of supported option-flags you can find
|
|
|
|
|
[here](https://github.com/tucnak/telebot/blob/v2/options.go#L9).
|
|
|
|
|
[here](https://github.com/tucnak/telebot/blob/v3/options.go#L9).
|
|
|
|
|
|
|
|
|
|
## Editable
|
|
|
|
|
If you want to edit some existing message, you don't really need to store the
|
|
|
|
|