feat(client): allow env setup.

This commit is contained in:
Dan Riedl 2025-07-01 14:28:06 +02:00
parent 956f664f17
commit 5bd757599d

View file

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