Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- newtype UpdateId = UpdateId Int
- data Update = Update {
- updateUpdateId :: UpdateId
- updateMessage :: Maybe Message
- updateEditedMessage :: Maybe Message
- updateChannelPost :: Maybe Message
- updateEditedChannelPost :: Maybe Message
- updateBusinessConnection :: Maybe BusinessConnection
- updateBusinessMessage :: Maybe Message
- updateEditedBusinessMessage :: Maybe Message
- updateDeletedBusinessMessages :: Maybe BusinessMessagesDeleted
- updateMessageReaction :: Maybe MessageReactionUpdated
- updateMessageReactionCount :: Maybe MessageReactionCountUpdated
- updateInlineQuery :: Maybe InlineQuery
- updateChosenInlineResult :: Maybe ChosenInlineResult
- updateCallbackQuery :: Maybe CallbackQuery
- updateShippingQuery :: Maybe ShippingQuery
- updatePreCheckoutQuery :: Maybe PreCheckoutQuery
- updatePoll :: Maybe Poll
- updatePollAnswer :: Maybe PollAnswer
- updateMyChatMember :: Maybe ChatMemberUpdated
- updateChatMember :: Maybe ChatMemberUpdated
- updateChatJoinRequest :: Maybe ChatJoinRequest
- updateChatBoost :: Maybe ChatBoostUpdated
- updateRemovedChatBoost :: Maybe ChatBoostRemoved
- updateChatId :: Update -> Maybe ChatId
- extractUpdateMessage :: Update -> Maybe Message
- type GetUpdatesAs a = "getUpdates" :> (ReqBody '[JSON] GetUpdatesRequest :> Get '[JSON] (Response [a]))
- type GetUpdates = GetUpdatesAs Update
- getUpdates :: GetUpdatesRequest -> ClientM (Response [Update])
- getUpdatesAsValue :: GetUpdatesRequest -> ClientM (Response [Value])
- data GetUpdatesRequest = GetUpdatesRequest {}
- data UpdateType
- = UpdateMessage
- | UpdateEditedMessage
- | UpdateChannelPost
- | UpdateEditedChannelPost
- | UpdateBusinessConnection
- | UpdateBusinessMessage
- | UpdateEditedBusinessMessage
- | UpdateDeletedBusinessMessages
- | UpdateMessageReaction
- | UpdateMessageReactionCount
- | UpdateInlineQuery
- | UpdateChosenInlineResult
- | UpdateCallbackQuery
- | UpdateShippingQuery
- | UpdatePreCheckoutQuery
- | UpdatePoll
- | UpdatePollAnswer
- | UpdateMyChatMember
- | UpdateChatMember
- | UpdateChatJoinRequest
- | UpdateChatBoost
- | UpdateRemovedChatBoost
- defGetUpdates :: GetUpdatesRequest
Update
This object represents an incoming update. At most one of the optional parameters can be present in any given update.
Update | |
|
Instances
getUpdates
type GetUpdatesAs a = "getUpdates" :> (ReqBody '[JSON] GetUpdatesRequest :> Get '[JSON] (Response [a])) Source #
type GetUpdates = GetUpdatesAs 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.
getUpdatesAsValue :: GetUpdatesRequest -> ClientM (Response [Value]) Source #
More liberal version of getUpdates
funcion.
It's useful when you aren't sure that you can parse all the types of updates, so you would recieve a list of Value with updates, that you can parse later.
data GetUpdatesRequest Source #
Request parameters for getUpdates
.
GetUpdatesRequest | |
|
Instances
data UpdateType Source #
Instances
FromJSON UpdateType Source # | |
Defined in Telegram.Bot.API.GettingUpdates parseJSON :: Value -> Parser UpdateType # parseJSONList :: Value -> Parser [UpdateType] # | |
ToJSON UpdateType Source # | |
Defined in Telegram.Bot.API.GettingUpdates toJSON :: UpdateType -> Value # toEncoding :: UpdateType -> Encoding # toJSONList :: [UpdateType] -> Value # toEncodingList :: [UpdateType] -> Encoding # omitField :: UpdateType -> Bool # | |
Generic UpdateType Source # | |
Defined in Telegram.Bot.API.GettingUpdates type Rep UpdateType :: Type -> Type # from :: UpdateType -> Rep UpdateType x # to :: Rep UpdateType x -> UpdateType # | |
type Rep UpdateType Source # | |
Defined in Telegram.Bot.API.GettingUpdates type Rep UpdateType = D1 ('MetaData "UpdateType" "Telegram.Bot.API.GettingUpdates" "telegram-bot-api-7.4.3-38UQu7GyDDHHZ1He0cP5zf" '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 "UpdateBusinessConnection" 'PrefixI 'False) (U1 :: Type -> Type)))) :+: ((C1 ('MetaCons "UpdateBusinessMessage" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "UpdateEditedBusinessMessage" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "UpdateDeletedBusinessMessages" 'PrefixI 'False) (U1 :: Type -> Type))) :+: (C1 ('MetaCons "UpdateMessageReaction" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "UpdateMessageReactionCount" '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) :+: C1 ('MetaCons "UpdatePoll" 'PrefixI 'False) (U1 :: Type -> Type)))) :+: ((C1 ('MetaCons "UpdatePollAnswer" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "UpdateMyChatMember" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "UpdateChatMember" 'PrefixI 'False) (U1 :: Type -> Type))) :+: (C1 ('MetaCons "UpdateChatJoinRequest" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "UpdateChatBoost" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "UpdateRemovedChatBoost" 'PrefixI 'False) (U1 :: Type -> Type)))))) |