Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func StartClient ¶
func StartClient(c ClientHelper)
StartClient is the helper for gotd/td which creates client, runs it, prepares storage etc.
Types ¶
type ClientHelper ¶
type ClientHelper struct { // Unique Telegram Application ID, get it from https://my.telegram.org/apps. AppID int // Unique Telegram API Hash, get it from https://my.telegram.org/apps. ApiHash string // Session info of the authenticated user, use sessionMaker.NewSession function to fill this field. Session *sessionMaker.SessionName // BotToken is the unique API Token for the bot you're trying to authorize, get it from @BotFather. BotToken string // Mobile number of the authenticating user. Phone string // Dispatcher handlers the incoming updates and execute mapped handlers. It is recommended to use dispatcher.MakeDispatcher function for this field. Dispatcher telegram.UpdateHandler // TaskFunc is used to for all your post authorization function calls and setting up handlers, check examples for further help. TaskFunc func(ctx context.Context, client *telegram.Client) error // A Logger provides fast, leveled, structured logging. All methods are safe for concurrent use. Logger *zap.Logger }
func (ClientHelper) CreateClient ¶
Click to show internal directories.
Click to hide internal directories.