Test Servers

Test Servers

If you wish to test your application in a separate environment, Gogram is able to authorize your account into Telegram’s test servers without hassle. All you need to do is start a new session (e.g.: β€œmode_test”) settings TestMode to true in ClientConfig and then call the Client.Start method.

 
package main
 
import (
    "github.com/amarnathcjd/gogram/telegram"
)
 
func main() {
    // Create a new client
    client := telegram.NewClient(&telegram.ClientConfig{
        AppID:     12345,
        AppHash:   "0123456789abcdef0123456789abcdef",
        TestMode:  true,
    })
 
    // Start the client
    client.Start()
 
    // voila, you are now in the test servers
}

If this is the first time you login into test servers, you will be asked to register your account first. Accounts registered on test servers reside in a different, parallel instance of a Telegram server.

Test Numbers

Beside normal numbers, the test environment allows you to login with reserved test numbers. Valid phone numbers follow the pattern 99966XYYYY, where X is the DC number (1 to 3) and YYYY are random numbers. Users with such numbers always get XXXXX or XXXXXX as the confirmation code (the DC number, repeated five or six times).

About 2fa, Unknown.