mirror of
https://github.com/bit1001/tdl.git
synced 2024-11-10 08:26:07 +08:00
fix(tgc): ignore login
status. close #4
This commit is contained in:
parent
aab794fb80
commit
8ed91a6b4d
3 changed files with 4 additions and 4 deletions
|
@ -21,7 +21,7 @@ func Run(ctx context.Context, ns, proxy string, partSize, threads, limit int, ur
|
|||
return err
|
||||
}
|
||||
|
||||
c := tgc.New(proxy, kvd, floodwait.NewSimpleWaiter())
|
||||
c := tgc.New(proxy, kvd, false, floodwait.NewSimpleWaiter())
|
||||
|
||||
return c.Run(ctx, func(ctx context.Context) error {
|
||||
status, err := c.Auth().Status(ctx)
|
||||
|
|
|
@ -10,13 +10,13 @@ import (
|
|||
"time"
|
||||
)
|
||||
|
||||
func New(proxy string, kvd *kv.KV, middlewares ...telegram.Middleware) *telegram.Client {
|
||||
func New(proxy string, kvd *kv.KV, login bool, middlewares ...telegram.Middleware) *telegram.Client {
|
||||
return telegram.NewClient(consts.AppID, consts.AppHash, telegram.Options{
|
||||
Resolver: dcs.Plain(dcs.PlainOptions{
|
||||
Dial: utils.Proxy.GetDial(proxy).DialContext,
|
||||
}),
|
||||
Device: consts.Device,
|
||||
SessionStorage: storage.NewSession(kvd, true),
|
||||
SessionStorage: storage.NewSession(kvd, login),
|
||||
RetryInterval: time.Second,
|
||||
MaxRetries: 10,
|
||||
DialTimeout: 10 * time.Second,
|
||||
|
|
|
@ -19,7 +19,7 @@ func Run(ctx context.Context, ns, proxy string) error {
|
|||
return err
|
||||
}
|
||||
|
||||
c := tgc.New(proxy, kvd)
|
||||
c := tgc.New(proxy, kvd, true)
|
||||
|
||||
return c.Run(ctx, func(ctx context.Context) error {
|
||||
if err := c.Ping(ctx); err != nil {
|
||||
|
|
Loading…
Reference in a new issue