Closed wind-hx closed 1 year ago
check your system clock
My system time is fine
Is it related to the operating system? The time is automatically obtained by the system when it is connected to the Internet.
@wind-hx
@wind-hx
?
Is it related to the operating system? The time is automatically obtained by the system when it is connected to the Internet.
I couldn't recreate the error
what's your OS, timezone etc the randombyte gen is based on system time Unix so that must be the error The lib has been tested on Windows 10,11 and major linux distros
@AmarnathCJD Maybe post the full code
I am Mac OS operating system
package main
import (
"log"
"github.com/amarnathcjd/gogram/telegram"
)
func main() {
log.Printf("init...\n")
appID := int32(611335)
appHash := "d524b414d21f4d37f08684c1df41ac9c"
client, _ := telegram.NewClient(telegram.ClientConfig{
AppID: appID,
AppHash: appHash,
})
client.Connect()
authKey := []byte{188, 193, 215, 239, 216, 225, 180, 195, 131, 110, 125, 151, 248, 183, 61, 66, 108, 245, 107, 152, 157, 35, 224, 107, 30, 238, 17, 99, 79, 242, 39, 148, 148, 163, 151, 101, 126, 35, 158, 227, 144, 112, 79, 175, 196, 79, 213, 228, 219, 72, 17, 81, 141, 185, 223, 217, 98, 102, 200, 127, 50, 233, 38, 131, 19, 51, 2, 0, 81, 229, 83, 18, 125, 96, 223, 147, 202, 202, 80, 218, 70, 242, 211, 174, 42, 77, 114, 179, 43, 161, 246, 141, 27, 183, 192, 111, 203, 219, 14, 80, 175, 129, 158, 97, 125, 113, 106, 38, 139, 212, 206, 36, 228, 139, 37, 112, 251, 2, 188, 234, 125, 131, 112, 200, 141, 227, 31, 236, 200, 240, 129, 89, 49, 191, 244, 109, 205, 226, 186, 10, 132, 8, 71, 146, 89, 240, 99, 70, 197, 186, 115, 124, 161, 12, 182, 124, 209, 140, 147, 87, 60, 213, 101, 23, 177, 37, 82, 108, 64, 173, 167, 10, 4, 197, 168, 237, 230, 61, 138, 44, 249, 24, 154, 136, 47, 215, 158, 119, 147, 213, 204, 89, 241, 123, 235, 34, 207, 133, 224, 120, 115, 52, 253, 99, 152, 117, 8, 154, 207, 124, 231, 140, 134, 54, 86, 54, 126, 124, 165, 19, 113, 219, 142, 103, 103, 97, 148, 97, 36, 147, 33, 238, 8, 157, 213, 150, 161, 100, 131, 164, 255, 6, 1, 178, 217, 182, 51, 29, 12, 161, 117, 250, 80, 64, 36, 123}
authKeyHash := []byte{210, 193, 149, 11, 102, 194, 206, 136}
addr := "91.108.56.126:443"
dcId := 5
client.ImportRawSession(authKey, authKeyHash, addr, dcId, appID)
log.Printf("init end...\n")
user, err := client.GetMe()
if err != nil {
log.Println("error: ", err)
return
}
log.Println("user: ", user)
}
2023/05/12 13:48:46 init...
2023/05/12 13:48:46 gogram - mtproto - Info - Connecting to [149.154.167.91:443] - <TCPFull> ...
2023/05/12 13:48:46 gogram - mtproto - Info - Connection to [149.154.167.91:443] - <TCPFull> established
2023/05/12 13:48:48 init end...
Here is my full code with full log info
Is there an error in the code I provided?
Is it related to the operating system? The time is automatically obtained by the system when it is connected to the Internet.
I couldn't recreate the error
what's your OS, timezone etc the randombyte gen is based on system time Unix so that must be the error The lib has been tested on Windows 10,11 and major linux distros
My country is China and my time zone is GMT+8
@wind-hx It's something related to macos then lemme try seeding the bytes generator but idh a mac system to test it.
How can I solve this problem?
@wind-hx Try seeding the default crypto/rand seeder maybe before client starts
@AmarnathCJD I would need time to setup a macos vm to check the issue
stale issue
Example
Logs
What is causing the program to crash?Judging from the log printing time, there is a long time of no response in the middle.