telegram-bot-api-6.5: Easy to use library for building Telegram bots. Exports Telegram Bot API.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Telegram.Bot.API.GettingUpdates

Synopsis

Update

data Update Source #

This object represents an incoming update. At most one of the optional parameters can be present in any given update.

Constructors

Update 

Fields

Instances

Instances details
FromJSON Update Source # 
Instance details

Defined in Telegram.Bot.API.GettingUpdates

ToJSON Update Source # 
Instance details

Defined in Telegram.Bot.API.GettingUpdates

Generic Update Source # 
Instance details

Defined in Telegram.Bot.API.GettingUpdates

Associated Types

type Rep Update :: Type -> Type #

Methods

from :: Update -> Rep Update x #

to :: Rep Update x -> Update #

Show Update Source # 
Instance details

Defined in Telegram.Bot.API.GettingUpdates

type Rep Update Source # 
Instance details

Defined in Telegram.Bot.API.GettingUpdates

type Rep Update = D1 ('MetaData "Update" "Telegram.Bot.API.GettingUpdates" "telegram-bot-api-6.5-3pY7XQZ5v9zCuyh8HdDMyB" 'False) (C1 ('MetaCons "Update" 'PrefixI 'True) (((S1 ('MetaSel ('Just "updateUpdateId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 UpdateId) :*: (S1 ('MetaSel ('Just "updateMessage") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Message)) :*: S1 ('MetaSel ('Just "updateEditedMessage") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Message)))) :*: ((S1 ('MetaSel ('Just "updateChannelPost") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Message)) :*: S1 ('MetaSel ('Just "updateEditedChannelPost") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Message))) :*: (S1 ('MetaSel ('Just "updateInlineQuery") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe InlineQuery)) :*: S1 ('MetaSel ('Just "updateChosenInlineResult") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe ChosenInlineResult))))) :*: (((S1 ('MetaSel ('Just "updateCallbackQuery") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe CallbackQuery)) :*: S1 ('MetaSel ('Just "updateShippingQuery") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe ShippingQuery))) :*: (S1 ('MetaSel ('Just "updatePreCheckoutQuery") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe PreCheckoutQuery)) :*: S1 ('MetaSel ('Just "updatePoll") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Poll)))) :*: ((S1 ('MetaSel ('Just "updatePollAnswer") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe PollAnswer)) :*: S1 ('MetaSel ('Just "updateMyChatMember") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe ChatMemberUpdated))) :*: (S1 ('MetaSel ('Just "updateChatMember") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe ChatMemberUpdated)) :*: S1 ('MetaSel ('Just "updateChatJoinRequest") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe ChatJoinRequest)))))))

getUpdates

getUpdates :: GetUpdatesRequest -> ClientM (Response [Update]) Source #

Use this method to receive incoming updates using long polling. An list of Update objects is returned.

NOTE: This method will not work if an outgoing webhook is set up.

NOTE: In order to avoid getting duplicate updates, recalculate offset after each server response.

data GetUpdatesRequest Source #

Request parameters for getUpdates.

Constructors

GetUpdatesRequest 

Fields

  • getUpdatesOffset :: Maybe UpdateId

    Identifier of the first update to be returned. Must be greater by one than the highest among the identifiers of previously received updates. By default, updates starting with the earliest unconfirmed update are returned. An update is considered confirmed as soon as getUpdates is called with an offset higher than its update_id. The negative offset can be specified to retrieve updates starting from -offset update from the end of the updates queue. All previous updates will forgotten.

  • getUpdatesLimit :: Maybe Int

    Limits the number of updates to be retrieved. Values between 1—100 are accepted. Defaults to 100.

  • getUpdatesTimeout :: Maybe Seconds

    Timeout in seconds for long polling. Defaults to 0, i.e. usual short polling. Should be positive, short polling should be used for testing purposes only.

  • getUpdatesAllowedUpdates :: Maybe [UpdateType]

    List the types of updates you want your bot to receive. For example, specify [“message”, “edited_channel_post”, “callback_query”] to only receive updates of these types. See GetUpdates for a complete list of available update types. Specify an empty list to receive all updates regardless of type (default). If not specified, the previous setting will be used. Please note that this parameter doesn't affect updates created before the call to the getUpdates, so unwanted updates may be received for a short period of time.

Instances

Instances details
FromJSON GetUpdatesRequest Source # 
Instance details

Defined in Telegram.Bot.API.GettingUpdates

ToJSON GetUpdatesRequest Source # 
Instance details

Defined in Telegram.Bot.API.GettingUpdates

Generic GetUpdatesRequest Source # 
Instance details

Defined in Telegram.Bot.API.GettingUpdates

Associated Types

type Rep GetUpdatesRequest :: Type -> Type #

type Rep GetUpdatesRequest Source # 
Instance details

Defined in Telegram.Bot.API.GettingUpdates

type Rep GetUpdatesRequest = D1 ('MetaData "GetUpdatesRequest" "Telegram.Bot.API.GettingUpdates" "telegram-bot-api-6.5-3pY7XQZ5v9zCuyh8HdDMyB" 'False) (C1 ('MetaCons "GetUpdatesRequest" 'PrefixI 'True) ((S1 ('MetaSel ('Just "getUpdatesOffset") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe UpdateId)) :*: S1 ('MetaSel ('Just "getUpdatesLimit") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Int))) :*: (S1 ('MetaSel ('Just "getUpdatesTimeout") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Seconds)) :*: S1 ('MetaSel ('Just "getUpdatesAllowedUpdates") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe [UpdateType])))))

data UpdateType Source #

Instances

Instances details
FromJSON UpdateType Source # 
Instance details

Defined in Telegram.Bot.API.GettingUpdates

ToJSON UpdateType Source # 
Instance details

Defined in Telegram.Bot.API.GettingUpdates

Generic UpdateType Source # 
Instance details

Defined in Telegram.Bot.API.GettingUpdates

Associated Types

type Rep UpdateType :: Type -> Type #

type Rep UpdateType Source # 
Instance details

Defined in Telegram.Bot.API.GettingUpdates

type Rep UpdateType = D1 ('MetaData "UpdateType" "Telegram.Bot.API.GettingUpdates" "telegram-bot-api-6.5-3pY7XQZ5v9zCuyh8HdDMyB" 'False) (((C1 ('MetaCons "UpdateMessage" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "UpdateEditedMessage" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "UpdateChannelPost" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "UpdateEditedChannelPost" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "UpdateInlineQuery" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "UpdateChosenInlineResult" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "UpdateCallbackQuery" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "UpdateShippingQuery" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "UpdatePreCheckoutQuery" 'PrefixI 'False) (U1 :: Type -> Type)))))