Skip to content

Releases: mr-linch/go-tg

v0.15.0: Bot API v7.2

29 Apr 13:58
39cc533
Compare
Choose a tag to compare

v0.14.0: CallbackDataFilter & TextMessageCallBuilder

19 Mar 18:43
ab4b6bb
Compare
Choose a tag to compare

What's Changed

Examples: https://github.com/mr-linch/go-tg/blob/main/examples/menu/main.go

Full Changelog: v0.13.0...v0.14.0

v0.13.0: Interceptors

12 Mar 14:39
5cf133d
Compare
Choose a tag to compare

Interceptors are used to modify or process the request before it is sent to the server and the response before it is returned to the caller. It's like a [tgb.Middleware], but for outgoing requests.

All interceptors should be registered on the client before the request is made.

client := tg.New("<TOKEN>",
  tg.WithClientInterceptors(
    tg.Interceptor(func(ctx context.Context, req *tg.Request, dst any, invoker tg.InterceptorInvoker) error {
      started := time.Now()

      // before request
      err := invoker(ctx, req, dst)
      // after request

      log.Print("call %s took %s", req.Method, time.Since(started))

      return err
    }),
  ),
)

Arguments of the interceptor are:

  • ctx - context of the request;
  • req - request object tg.Request;
  • dst - pointer to destination for the response, can be nil if the request is made with DoVoid method;
  • invoker - function for calling the next interceptor or the actual request.

Contrib package has some useful interceptors:

Interceptors are called in the order they are registered.

Example of using retry flood interceptor: examples/retry-flood

Full Changelog: v0.12.0...v0.13.0

Breaking Bot API v7.0 and v7.1 support and other minor changes

18 Feb 13:02
c6ec119
Compare
Choose a tag to compare

⚠️ This release is not compatible with previous releases. Bot API v7.0 has many changes in methods and types. Since types and methods are generated from official documentation, backward compatibility is broken.

Major breaking changes:

  • Types:
    • Fields Message.Forward* replaced with Message.ForwardOrigin.*
    • Change type of Message.PinnedMessage from Message to MaybeInaccessibleMessage
    • Renaming field of Message and type UserShared -> UsersShared
    • Change type of CallbackQuery.Message from Message to MaybeInaccessibleMessage
    • InputTextMessageContent.DisableWebPagePreview replaced with InputTextMessageContent.LinkPreviewOptions
  • Methods:
    • Replace *.DisableWebPagePreview(...) with *.LinkPreviewOptions(...)
    • Replace *.AllowSendingWithoutReply(...) and *.ReplyToMessageID(...) with *.ReplyParameters(...)
image image

Other changes

  • allow to use custom func for get ip from request by @mr-linch in #133
  • chore(deps): bump actions/setup-go from 4 to 5 by @dependabot in #134
  • chore(deps): bump codecov/codecov-action from 3 to 4 by @dependabot in #136
  • Add blockquote support for HTML and MD2 by @adasauce in #138
  • chore(deps): bump golangci/golangci-lint-action from 3 to 4 by @dependabot in #139

New Contributors

Full Changelog: v0.11.0...v0.12.0

Bot API v6.9 support and non-empty `Story` type fix

23 Sep 17:01
114f0b5
Compare
Choose a tag to compare

What's Changed

  • chore(deps): bump actions/checkout from 3 to 4 by @dependabot in #130
  • upgrade: Bot API 6.9 & non-empty Story type fix by @mr-linch in #132

Full Changelog: v0.10.0...v0.11.0

Bot API

image

v0.10.0

18 Aug 17:35
01dca14
Compare
Choose a tag to compare

What's Changed

  • chore(deps): bump github.com/stretchr/testify from 1.8.3 to 1.8.4 by @dependabot in #127
  • feat: upgrade to v6.8 by @mr-linch in #129

Full Changelog: v0.9.1...v0.10.0

v0.9.1

24 May 23:33
e1a72e6
Compare
Choose a tag to compare

What's Changed

  • chore(deps): bump github.com/stretchr/testify from 1.8.2 to 1.8.3 by @dependabot in #122
  • fix: unmarshal error for GetChatMenuButton by @mr-linch in #125

Full Changelog: v0.9.0...v0.9.1

v0.9.0

22 Apr 10:47
6d3a0a7
Compare
Choose a tag to compare

What's Changed

Bot API

https://core.telegram.org/bots/api#april-21-2023

Full Changelog: v0.8.1...v0.9.0

v0.8.1

10 Apr 10:28
2d3a2e6
Compare
Choose a tag to compare

What's Changed

  • chore(deps): bump actions/setup-go from 3 to 4 by @dependabot in #119
  • feat(tg): accept any http client what satisfies doer interface by @Satont in #120

New Contributors

Full Changelog: v0.8.0...v0.8.1

v0.8.0

12 Mar 17:04
1f7444c
Compare
Choose a tag to compare

What's Changed

  • chore(deps): bump github.com/stretchr/testify from 1.8.1 to 1.8.2 by @dependabot in #117
  • codegen: upgrade to v6.6 by @mr-linch in #118

Breaking Changes

Telegram Bot API changed a few methods and property names.
We follow new specification without backwards compatibility.
Pay special attention to uploadStickerFile, createNewStickerSet, and addStickerToSet and InputMedia* types.

Full Changelog: v0.7.0...v0.8.0