| Safe Haskell | None | 
|---|---|
| Language | Haskell2010 | 
Telegram.Bot.API.GettingUpdates
Contents
Synopsis
- newtype UpdateId = UpdateId Int32
- data Update = Update {}
- updateChatId :: Update -> Maybe ChatId
- extractUpdateMessage :: Update -> Maybe Message
- type GetUpdates = "getUpdates" :> (ReqBody '[JSON] GetUpdatesRequest :> Get '[JSON] (Response [Update]))
- getUpdates :: GetUpdatesRequest -> ClientM (Response [Update])
- data GetUpdatesRequest = GetUpdatesRequest {}
- data UpdateType
Update
Instances
| Eq UpdateId Source # | |
| Ord UpdateId Source # | |
| Defined in Telegram.Bot.API.GettingUpdates | |
| Show UpdateId Source # | |
| FromJSON UpdateId Source # | |
| Defined in Telegram.Bot.API.GettingUpdates | |
| ToJSON UpdateId Source # | |
| Defined in Telegram.Bot.API.GettingUpdates Methods toEncoding :: UpdateId -> Encoding toJSONList :: [UpdateId] -> Value toEncodingList :: [UpdateId] -> Encoding | |
This object represents an incoming update. At most one of the optional parameters can be present in any given update.
Constructors
| Update | |
| Fields 
 | |
Instances
getUpdates
type GetUpdates = "getUpdates" :> (ReqBody '[JSON] GetUpdatesRequest :> Get '[JSON] (Response [Update])) Source #
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 
 | |
Instances
data UpdateType Source #
Constructors
| UpdateMessage | |
| UpdateEditedMessage | |
| UpdateChannelPost | |
| UpdateEditedChannelPost | |
| UpdateInlineQuery | |
| UpdateChosenInlineResult | |
| UpdateCallbackQuery | |
| UpdateShippingQuery | |
| UpdatePreCheckoutQuery | 
Instances
| Generic UpdateType Source # | |
| Defined in Telegram.Bot.API.GettingUpdates Associated Types type Rep UpdateType :: Type -> Type # | |
| FromJSON UpdateType Source # | |
| Defined in Telegram.Bot.API.GettingUpdates | |
| ToJSON UpdateType Source # | |
| Defined in Telegram.Bot.API.GettingUpdates Methods toJSON :: UpdateType -> Value toEncoding :: UpdateType -> Encoding toJSONList :: [UpdateType] -> Value toEncodingList :: [UpdateType] -> Encoding | |
| type Rep UpdateType Source # | |
| Defined in Telegram.Bot.API.GettingUpdates type Rep UpdateType = D1 (MetaData "UpdateType" "Telegram.Bot.API.GettingUpdates" "telegram-bot-simple-0.3.0-inplace" 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))))) | |