Merge pull request #8 from danriedl/main

feat(client): allow env setup.
This commit is contained in:
Father of chain 2025-08-21 13:42:46 +03:00 committed by GitHub
commit ba919808e0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -17,10 +17,12 @@ func New(appID int, appHash, sessionPath string) *Client {
}
func (c *Client) T() *telegram.Client {
return telegram.NewClient(c.appID, c.appHash, telegram.Options{
opts := telegram.Options{
SessionStorage: &telegram.FileSessionStorage{
Path: c.sessionPath,
},
NoUpdates: true,
})
}
opts, _ = telegram.OptionsFromEnvironment(opts)
return telegram.NewClient(c.appID, c.appHash, opts)
}