Skip to content

Commit

Permalink
Add Encode method to Session struct
Browse files Browse the repository at this point in the history
  • Loading branch information
AmarnathCJD committed Mar 1, 2024
1 parent cbf48d0 commit cd99cb4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions telegram/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ type Session struct {
AppID int32 `json:"app_id,omitempty"`
}

func (s *Session) Encode() string {
return session.NewStringSession(s.Key, s.Hash, 0, s.Hostname, s.AppID).Encode()
}

func NewClient(config ClientConfig) (*Client, error) {
client := &Client{wg: sync.WaitGroup{}, Log: utils.NewLogger("gogram - client"), stopCh: make(chan struct{})}
config = client.cleanClientConfig(config)
Expand Down

0 comments on commit cd99cb4

Please sign in to comment.