fix: issues

This commit is contained in:
Rogee
2024-09-02 16:07:14 +08:00
parent d739ca0184
commit 73ce8585bb
8 changed files with 201 additions and 76 deletions

View File

@@ -20,16 +20,10 @@ type TClient struct {
logger *zap.Logger
api *tg.Client
downloadMedia bool
waitLogin chan error
block chan struct{}
}
// func (t *TClient) Close() {
// t.block <- struct{}{}
// }
func NewClient(logger *zap.Logger, config *config.Config) *TClient {
c := &TClient{
Config: config,
@@ -46,11 +40,6 @@ func NewClient(logger *zap.Logger, config *config.Config) *TClient {
return c
}
func (t *TClient) WithMedia() *TClient {
t.downloadMedia = true
return t
}
func (t *TClient) Login(ctx context.Context) error {
t.logger.Info("login phone", zap.String("phone", t.Config.Phone))
flow := auth.NewFlow(Terminal{PhoneNumber: client.Config.Phone}, auth.SendCodeOptions{})