LongPolling constructor

LongPolling(
  1. Telegram telegram, {
  2. int offset = 0,
  3. int limit = 100,
  4. int timeout = 30,
  5. List<String>? allowedUpdates,
})

Setup long polling

Throws LongPollingException if limit is less than 1 or greater than 100 or timeout is greater than 50.

Implementation

LongPolling(this.telegram,
    {this.offset = 0,
    this.limit = 100,
    this.timeout = 30,
    this.allowedUpdates}) {
  if (limit > 100 || limit < 1) {
    throw LongPollingException('Limit must between 1 and 100.');
  }
  if (timeout > maxTimeout) {
    throw LongPollingException('Timeout may not greater than $maxTimeout.');
  }
}