// Receive incoming updates using long polling (wiki). An Array of Update
// objects is returned.
Receive incoming updates using long polling (wiki). An Array of Update
objects is returned.
// Receive incoming updates using long polling ( wiki ) . An Array of Update // objects is returned .
func (e *Bot) GetUpdates(offset, limit, timeout int) ([]Update, error) {
	res, err := e.CallMethod("getUpdates", map[string]int{
		"offset":  offset,
		"limit":   limit,
		"timeout": timeout,
	})
	if err != nil {
		return nil, err
	}
	updates := &GetUpdatesResponse{}
	err = json.Unmarshal(res, updates)
	if err != nil {
		return nil, err
	}
	if !updates.OK {
		return nil, errors.New(updates.Description)
	}
	return updates.Result, nil
}
func ( e * Bot ) GetUpdates ( offset , limit , timeout int ) ( [ ] Update , error ) { res , err := e . CallMethod ( " " , map [ string ] int { " " : offset , " " : limit , " " : timeout , } ) if err != nil { return nil , err } updates := & GetUpdatesResponse { } err = json . Unmarshal ( res , updates ) if err != nil { return nil , err } if ! updates . OK { return nil , errors . New ( updates . Description ) } return updates . Result , nil }
Receive incoming updates using long polling (wiki).
Receive incoming updates using long polling ( wiki ) .