Skip to content

Commit

Permalink
Add telegram.SetClient function (#602)
Browse files Browse the repository at this point in the history
Co-authored-by: Niko Köser <koeserniko@gmail.com>
  • Loading branch information
onemedicine and nikoksr authored Jun 7, 2023
1 parent 5e9ddeb commit 2966e18
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions service/telegram/telegram.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,14 @@ func New(apiToken string) (*Telegram, error) {
return t, nil
}

// SetClient set a new custom BotAPI instance.
// For example allowing you to use NewBotAPIWithClient:
//
// -> https://pkg.go.dev/github.com/go-telegram-bot-api/telegram-bot-api#NewBotAPIWithClient
func (t *Telegram) SetClient(client *tgbotapi.BotAPI) {
t.client = client
}

// SetParseMode sets the parse mode for the message body.
// For more information about telegram constants:
//
Expand Down

0 comments on commit 2966e18

Please sign in to comment.