added todo, so strange events with tdlib
This commit is contained in:
parent
735000ced1
commit
8ee4975ef9
10
app/app.go
10
app/app.go
@ -72,9 +72,8 @@ type Options struct {
|
||||
TrashLogHost string `env:"TRASH_LOG_HOST" default:"localhost:7113"`
|
||||
ModuleLogger string `env:"MODULE_LOGGER" default:"core-local"`
|
||||
ClickHouseCred string `env:"CLICK_HOUSE_CRED" default:"tcp://10.8.0.15:9000/default?sslmode=disable"`
|
||||
BotID int `env:"BOT_ID"` // 6712573453
|
||||
RedisHost string `env:"REDIS_HOST" default:"localhost:6379"`
|
||||
RedisPassword string `env:"REDIS_PASSWORD"`
|
||||
RedisPassword string `env:"REDIS_PASSWORD" default:"admin"`
|
||||
RedisDB uint64 `env:"REDIS_DB" default:"2"`
|
||||
}
|
||||
|
||||
@ -175,9 +174,10 @@ func New(ctx context.Context, opts interface{}, ver appInit.Version) (appInit.Co
|
||||
}
|
||||
|
||||
tgWC := workers.NewTgListenerWC(workers.Deps{
|
||||
BotID: int64(options.BotID),
|
||||
Redis: redisClient,
|
||||
Dal: pgdal,
|
||||
BotID: int64(6712573453), // todo убрать
|
||||
Redis: redisClient,
|
||||
Dal: pgdal,
|
||||
TgClient: tgClient,
|
||||
})
|
||||
|
||||
go tgWC.Start(ctx)
|
||||
|
@ -168,6 +168,7 @@ func (tg *TelegramClient) CreateChannel(channelName string, botID int64) (string
|
||||
var inviteLink string
|
||||
var channelId int64
|
||||
for _, activeClient := range tg.TgClients {
|
||||
// todo пока не понимаю это какой то рандом? в один день бот норм находится в другой уже не находится хотя абсолютно с точки зрения тг кода этой функции и бота не менялось
|
||||
_, err := activeClient.GetUser(&client.GetUserRequest{
|
||||
UserId: botID,
|
||||
})
|
||||
|
@ -264,11 +264,13 @@ func (s *Service) PostLeadTarget(ctx *fiber.Ctx) error {
|
||||
return ctx.Status(fiber.StatusUnauthorized).SendString("account id is required")
|
||||
}
|
||||
|
||||
//accountID := "64f2cd7a7047f28fdabf6d9e"
|
||||
|
||||
if _, ok := model.ValidLeadTargetTypes[req.Type]; !ok {
|
||||
return ctx.Status(fiber.StatusBadRequest).SendString("Invalid type")
|
||||
}
|
||||
|
||||
if req.Type == "" || req.Target == "" {
|
||||
if req.Type == "" || (req.Target == "" && req.Type != string(model.LeadTargetTg)) {
|
||||
return ctx.Status(fiber.StatusBadRequest).SendString("Type and Target don't be nil")
|
||||
}
|
||||
|
||||
|
@ -36,7 +36,7 @@ func NewTgListenerWC(deps Deps) *TgListenerWorker {
|
||||
}
|
||||
|
||||
func (wc *TgListenerWorker) Start(ctx context.Context) {
|
||||
ticker := time.NewTicker(10 * time.Second)
|
||||
ticker := time.NewTicker(10 * time.Second) //time.Minute
|
||||
defer ticker.Stop()
|
||||
|
||||
for {
|
||||
|
Loading…
Reference in New Issue
Block a user