Skip to content

Commit

Permalink
todo
Browse files Browse the repository at this point in the history
  • Loading branch information
AmarnathCJD committed Jul 7, 2024
1 parent 760298a commit 5864450
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions telegram/updates.go
Original file line number Diff line number Diff line change
Expand Up @@ -683,3 +683,46 @@ func (c *Client) GetDifference(Pts, Limit int32) (Message, error) {

return nil, nil
}

// TODO: impl like client.On("message", func(m *NewMessage) { ... })

// interface for all common events
// type ev interface{}

// var (
// OnMessage ev = "message"
// OnEdit ev = "edit"
// OnDelete ev = "delete"
// OnInline ev = "inline"
// OnCallback ev = "callback"
// OnInlineCallback ev = "inlineCallback"
// OnParticipant ev = "participant"
// OnRaw ev = "raw"
// )

// type handleInterface interface{}

// func (c *Client) On(pattern interface{}, handler interface{}, filters ...Filter) handleInterface {
// switch pattern := pattern.(type) {
// case ev:
// switch pattern {
// case OnMessage:
// return c.AddMessageHandler(OnNewMessage, handler, filters...)
// case OnEditMessage:
// return c.AddEditHandler(OnEditMessage, handler)
// case OnInline:
// return c.AddInlineHandler(OnInlineQuery, handler)
// case OnCallback:
// return c.AddCallbackHandler(OnCallbackQuery, handler)
// case OnInlineCallback:
// return c.AddInlineCallbackHandler(OnInlineCallbackQuery, handler)
// case OnParticipant:
// return c.AddParticipantHandler(handler)
// case OnRaw:
// return c.AddRawHandler(Update{}, func(m Update, c *Client) error {
// return handler(packUpdate(c, m))
// })
// }
// }
// return c.AddMessageHandler(pattern, handler, filters...)
// }

0 comments on commit 5864450

Please sign in to comment.