我正在使用go-tdlib收集 Telegram 中的消息。当我第三次重新启动服务时。它停止工作。所以我打印了这些消息。它不断给我authorizationsStateWaitPhoneNumber地位。我什至无法在控制台中输入我的电话号码。下面是代码:package mainimport ( "fmt" "log" "math" "os" "os/signal" "syscall" "time" "github.com/Arman92/go-tdlib" "github.com/joho/godotenv")const ( MaxAttempt = 10)var ( apiID string apiHash string)var allChats []*tdlib.Chatvar haveFullChatList boolfunc main() { log.Println("Start Service") log.Printf("API ID: %+v\n", apiID) log.Printf("API HASH: %+v\n", apiHash) tdlib.SetLogVerbosityLevel(1) tdlib.SetFilePath("./errors.txt") // Create new instance of client client := tdlib.NewClient(tdlib.Config{ APIID: apiID, APIHash: apiHash, SystemLanguageCode: "en", DeviceModel: "Server", SystemVersion: "1.0.0", ApplicationVersion: "1.0.0", UseMessageDatabase: true, UseFileDatabase: true, UseChatInfoDatabase: true, UseTestDataCenter: false, DatabaseDirectory: "./tdlib-db", FileDirectory: "./tdlib-files", IgnoreFileNames: false, }) log.Println("Starting auth") // Wait while we get AuthorizationReady! // Note: See authorization example for complete authorization sequence example currentState, err := client.Authorize() if err != nil { log.Fatalf("Authorize error: %+v\n", err) } attempt := 0 for ; currentState.GetAuthorizationStateEnum() != tdlib.AuthorizationStateReadyType; currentState, err = client.Authorize() { if err != nil { log.Fatalf("Authorize error: %+v\n", err) } fmt.Printf("Current auth state: %+v\n", currentState) attempt += 1 time.Sleep(5000 * time.Millisecond) }以前有人遇到过这个问题吗?我究竟做错了什么?
目前暂无任何回答
- 0 回答
- 0 关注
- 137 浏览
添加回答
举报
0/150
提交
取消