Skip to content

Commit

Permalink
telebot: bump version to v4
Browse files Browse the repository at this point in the history
  • Loading branch information
demget committed Oct 11, 2024
1 parent 65ca005 commit e337578
Show file tree
Hide file tree
Showing 14 changed files with 23 additions and 23 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Telebot
>"I never knew creating Telegram bots could be so _sexy_!"
[![GoDoc](https://godoc.org/gopkg.in/telebot.v3?status.svg)](https://godoc.org/gopkg.in/telebot.v3)
[![GoDoc](https://godoc.org/gopkg.in/telebot.v4?status.svg)](https://godoc.org/gopkg.in/telebot.v4)
[![GitHub Actions](https://github.com/tucnak/telebot/actions/workflows/go.yml/badge.svg)](https://github.com/tucnak/telebot/actions)
[![codecov.io](https://codecov.io/gh/tucnak/telebot/coverage.svg?branch=v3)](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/telebot.v3
go get -u gopkg.in/telebot.v4
```

* [Overview](#overview)
Expand Down Expand Up @@ -52,7 +52,7 @@ import (
"os"
"time"

tele "gopkg.in/telebot.v3"
tele "gopkg.in/telebot.v4"
)

func main() {
Expand Down Expand Up @@ -80,7 +80,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 into one of the Telebot-provided
endpoints. You can find the full list
[here](https://godoc.org/gopkg.in/telebot.v3#pkg-constants).
[here](https://godoc.org/gopkg.in/telebot.v4#pkg-constants).

There are dozens of supported endpoints (see package consts). Let me know
if you'd like to see some endpoint or endpoint ideas implemented. This system
Expand Down Expand Up @@ -136,7 +136,7 @@ Telebot has a simple and recognizable way to set up middleware — chained funct
Import a `middleware` package to get some basic out-of-box middleware
implementations:
```go
import "gopkg.in/telebot.v3/middleware"
import "gopkg.in/telebot.v4/middleware"
```

```go
Expand Down Expand Up @@ -292,7 +292,7 @@ b.Send(user, "text", tele.Silent, tele.NoPreview)
```

Full list of supported option-flags you can find
[here](https://pkg.go.dev/gopkg.in/telebot.v3#Option).
[here](https://pkg.go.dev/gopkg.in/telebot.v4#Option).

## Editable
If you want to edit some existing message, you don't really need to store the
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module gopkg.in/telebot.v3
module gopkg.in/telebot.v4

go 1.16

Expand Down
2 changes: 1 addition & 1 deletion layout/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"time"

"github.com/spf13/viper"
tele "gopkg.in/telebot.v3"
tele "gopkg.in/telebot.v4"
)

// Config represents typed map interface related to the "config" section in layout.
Expand Down
2 changes: 1 addition & 1 deletion layout/default.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package layout

import (
tele "gopkg.in/telebot.v3"
tele "gopkg.in/telebot.v4"
)

// DefaultLayout is a simplified layout instance with pre-defined locale by default.
Expand Down
2 changes: 1 addition & 1 deletion layout/layout.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"text/template"

"github.com/goccy/go-yaml"
tele "gopkg.in/telebot.v3"
tele "gopkg.in/telebot.v4"
)

type (
Expand Down
2 changes: 1 addition & 1 deletion layout/layout_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"time"

"github.com/stretchr/testify/assert"
tele "gopkg.in/telebot.v3"
tele "gopkg.in/telebot.v4"
)

//go:embed *
Expand Down
10 changes: 5 additions & 5 deletions layout/middleware.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package layout

import (
tele "gopkg.in/telebot.v3"
tele "gopkg.in/telebot.v4"
)

// LocaleFunc is the function used to fetch the locale of the recipient.
Expand All @@ -11,11 +11,11 @@ type LocaleFunc func(tele.Recipient) string
// Middleware builds a telebot middleware to make localization work.
//
// Usage:
// b.Use(lt.Middleware("en", func(r tele.Recipient) string {
// loc, _ := db.UserLocale(r.Recipient())
// return loc
// }))
//
// b.Use(lt.Middleware("en", func(r tele.Recipient) string {
// loc, _ := db.UserLocale(r.Recipient())
// return loc
// }))
func (lt *Layout) Middleware(defaultLocale string, localeFunc ...LocaleFunc) tele.MiddlewareFunc {
var f LocaleFunc
if len(localeFunc) > 0 {
Expand Down
2 changes: 1 addition & 1 deletion layout/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (

"github.com/goccy/go-yaml"
"github.com/spf13/viper"
tele "gopkg.in/telebot.v3"
tele "gopkg.in/telebot.v4"
)

type Settings struct {
Expand Down
2 changes: 1 addition & 1 deletion middleware/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"encoding/json"
"log"

tele "gopkg.in/telebot.v3"
tele "gopkg.in/telebot.v4"
)

// Logger returns a middleware that logs incoming updates.
Expand Down
2 changes: 1 addition & 1 deletion middleware/middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"errors"
"log"

tele "gopkg.in/telebot.v3"
tele "gopkg.in/telebot.v4"
)

// AutoRespond returns a middleware that automatically responds
Expand Down
2 changes: 1 addition & 1 deletion middleware/middleware_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

tele "gopkg.in/telebot.v3"
tele "gopkg.in/telebot.v4"
)

var b, _ = tele.NewBot(tele.Settings{Offline: true})
Expand Down
2 changes: 1 addition & 1 deletion middleware/restrict.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package middleware

import tele "gopkg.in/telebot.v3"
import tele "gopkg.in/telebot.v4"

// RestrictConfig defines config for Restrict middleware.
type RestrictConfig struct {
Expand Down
2 changes: 1 addition & 1 deletion react/react.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package react

import (
tele "gopkg.in/telebot.v3"
tele "gopkg.in/telebot.v4"
)

type Reaction = tele.Reaction
Expand Down
2 changes: 1 addition & 1 deletion telebot.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//
// import (
// "time"
// tele "gopkg.in/telebot.v3"
// tele "gopkg.in/telebot.v4"
// )
//
// func main() {
Expand Down

0 comments on commit e337578

Please sign in to comment.