Skip to content

Commit ba91980

Browse files
authored
Merge pull request #8 from danriedl/main
feat(client): allow env setup.
2 parents 956f664 + 5bd7575 commit ba91980

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

internal/tg/client.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,12 @@ func New(appID int, appHash, sessionPath string) *Client {
1717
}
1818

1919
func (c *Client) T() *telegram.Client {
20-
return telegram.NewClient(c.appID, c.appHash, telegram.Options{
20+
opts := telegram.Options{
2121
SessionStorage: &telegram.FileSessionStorage{
2222
Path: c.sessionPath,
2323
},
2424
NoUpdates: true,
25-
})
25+
}
26+
opts, _ = telegram.OptionsFromEnvironment(opts)
27+
return telegram.NewClient(c.appID, c.appHash, opts)
2628
}

0 commit comments

Comments
 (0)