aboutsummaryrefslogtreecommitdiff
path: root/telegram
diff options
context:
space:
mode:
Diffstat (limited to 'telegram')
-rw-r--r--telegram/client.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/telegram/client.go b/telegram/client.go
index 688912b..82f65d0 100644
--- a/telegram/client.go
+++ b/telegram/client.go
@@ -7,6 +7,7 @@ import (
"strconv"
"dev.narayana.im/narayana/telegabber/config"
+ "dev.narayana.im/narayana/telegabber/persistence"
"github.com/zelenin/go-tdlib/client"
)
@@ -35,12 +36,13 @@ type Client struct {
client *client.Client
jid string
parameters *client.TdlibParameters
+ session *persistence.Session
online bool
logVerbosity client.Option
}
// NewClient instantiates a Telegram App
-func NewClient(conf config.TelegramConfig, jid string) (Client, error) {
+func NewClient(conf config.TelegramConfig, jid string, session *persistence.Session) (Client, error) {
logVerbosity := client.WithLogVerbosity(&client.SetLogVerbosityLevelRequest{
NewVerbosityLevel: stringToLogConstant(conf.Loglevel),
})
@@ -76,6 +78,7 @@ func NewClient(conf config.TelegramConfig, jid string) (Client, error) {
return Client{
parameters: &parameters,
jid: jid,
+ session: session,
logVerbosity: logVerbosity,
}, nil
}