feat(client): allow env setup.
This commit is contained in:
parent
956f664f17
commit
5bd757599d
1 changed files with 4 additions and 2 deletions
|
|
@ -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)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue