Added updatesChannel type with Clear() method
This commit is contained in:
parent
e2916e08ad
commit
66446d51ff
2 changed files with 22 additions and 9 deletions
10
types.go
10
types.go
|
@ -37,6 +37,16 @@ type Update struct {
|
|||
CallbackQuery *CallbackQuery `json:"callback_query"`
|
||||
}
|
||||
|
||||
//updatesChannel is the channel for getting updates.
|
||||
type updatesChannel <-chan Update
|
||||
|
||||
//Clear discards all the actual incoming updates
|
||||
func (ch updatesChannel) Clear() {
|
||||
for len(ch) != 0 {
|
||||
<-ch
|
||||
}
|
||||
}
|
||||
|
||||
// User is a user on Telegram.
|
||||
type User struct {
|
||||
ID int `json:"id"`
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue