You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
449 B
31 lines
449 B
3 years ago
|
package auth
|
||
|
|
||
|
import (
|
||
|
"io"
|
||
|
|
||
|
"github.com/gotd/td/tg"
|
||
|
)
|
||
|
|
||
|
// Client implements Telegram authentication.
|
||
|
type Client struct {
|
||
|
api *tg.Client
|
||
|
rand io.Reader
|
||
|
appID int
|
||
|
appHash string
|
||
|
}
|
||
|
|
||
|
// NewClient initializes and returns Telegram authentication client.
|
||
|
func NewClient(
|
||
|
api *tg.Client,
|
||
|
rand io.Reader,
|
||
|
appID int,
|
||
|
appHash string,
|
||
|
) *Client {
|
||
|
return &Client{
|
||
|
api: api,
|
||
|
rand: rand,
|
||
|
appID: appID,
|
||
|
appHash: appHash,
|
||
|
}
|
||
|
}
|