telegram-api 0.1.0.1 → 0.2.0.0
raw patch · 7 files changed
+256/−40 lines, 7 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
- Web.Telegram.API.Bot.Requests: Markdown :: ParseMode
- Web.Telegram.API.Bot.Requests: data ParseMode
- Web.Telegram.API.Bot.Requests: instance Data.Aeson.Types.Class.FromJSON Web.Telegram.API.Bot.Requests.ParseMode
- Web.Telegram.API.Bot.Requests: instance Data.Aeson.Types.Class.ToJSON Web.Telegram.API.Bot.Requests.ParseMode
- Web.Telegram.API.Bot.Requests: instance GHC.Generics.Constructor Web.Telegram.API.Bot.Requests.C1_0ParseMode
- Web.Telegram.API.Bot.Requests: instance GHC.Generics.Datatype Web.Telegram.API.Bot.Requests.D1ParseMode
- Web.Telegram.API.Bot.Requests: instance GHC.Generics.Generic Web.Telegram.API.Bot.Requests.ParseMode
- Web.Telegram.API.Bot.Requests: instance GHC.Show.Show Web.Telegram.API.Bot.Requests.ParseMode
+ Web.Telegram.API.Bot.API: answerInlineQuery :: Token -> AnswerInlineQueryRequest -> IO (Either ServantError InlineQueryResponse)
+ Web.Telegram.API.Bot.Data: ChosenInlineResult :: Text -> User -> Text -> ChosenInlineResult
+ Web.Telegram.API.Bot.Data: InlineQuery :: Text -> User -> Text -> Text -> InlineQuery
+ Web.Telegram.API.Bot.Data: InlineQueryResultArticle :: Text -> Maybe Text -> Maybe Text -> Maybe ParseMode -> Maybe Bool -> Maybe Text -> Maybe Bool -> Maybe Text -> Maybe Text -> Maybe Int -> Maybe Int -> InlineQueryResult
+ Web.Telegram.API.Bot.Data: InlineQueryResultGif :: Text -> Text -> Maybe Int -> Maybe Int -> Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> Maybe ParseMode -> Maybe Bool -> InlineQueryResult
+ Web.Telegram.API.Bot.Data: InlineQueryResultMpeg4Gif :: Text -> Text -> Maybe Int -> Maybe Int -> Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> Maybe ParseMode -> Maybe Bool -> InlineQueryResult
+ Web.Telegram.API.Bot.Data: InlineQueryResultPhoto :: Text -> Text -> Maybe Int -> Maybe Int -> Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> Maybe ParseMode -> Maybe Bool -> InlineQueryResult
+ Web.Telegram.API.Bot.Data: InlineQueryResultVideo :: Text -> Text -> Text -> Maybe Text -> Maybe ParseMode -> Maybe Bool -> Maybe Int -> Maybe Int -> Maybe Int -> Maybe Text -> Maybe Text -> Maybe Text -> InlineQueryResult
+ Web.Telegram.API.Bot.Data: Markdown :: ParseMode
+ Web.Telegram.API.Bot.Data: [chosen_from] :: ChosenInlineResult -> User
+ Web.Telegram.API.Bot.Data: [chosen_inline_result] :: Update -> Maybe ChosenInlineResult
+ Web.Telegram.API.Bot.Data: [chosen_query] :: ChosenInlineResult -> Text
+ Web.Telegram.API.Bot.Data: [chosen_result_id] :: ChosenInlineResult -> Text
+ Web.Telegram.API.Bot.Data: [inline_query] :: Update -> Maybe InlineQuery
+ Web.Telegram.API.Bot.Data: [iq_res_caption] :: InlineQueryResult -> Maybe Text
+ Web.Telegram.API.Bot.Data: [iq_res_description] :: InlineQueryResult -> Maybe Text
+ Web.Telegram.API.Bot.Data: [iq_res_disable_web_page_preview] :: InlineQueryResult -> Maybe Bool
+ Web.Telegram.API.Bot.Data: [iq_res_gif_height] :: InlineQueryResult -> Maybe Int
+ Web.Telegram.API.Bot.Data: [iq_res_gif_url] :: InlineQueryResult -> Text
+ Web.Telegram.API.Bot.Data: [iq_res_gif_width] :: InlineQueryResult -> Maybe Int
+ Web.Telegram.API.Bot.Data: [iq_res_hide_url] :: InlineQueryResult -> Maybe Bool
+ Web.Telegram.API.Bot.Data: [iq_res_id] :: InlineQueryResult -> Text
+ Web.Telegram.API.Bot.Data: [iq_res_message_text] :: InlineQueryResult -> Maybe Text
+ Web.Telegram.API.Bot.Data: [iq_res_mime_type] :: InlineQueryResult -> Text
+ Web.Telegram.API.Bot.Data: [iq_res_mpeg4_height] :: InlineQueryResult -> Maybe Int
+ Web.Telegram.API.Bot.Data: [iq_res_mpeg4_url] :: InlineQueryResult -> Text
+ Web.Telegram.API.Bot.Data: [iq_res_mpeg4_width] :: InlineQueryResult -> Maybe Int
+ Web.Telegram.API.Bot.Data: [iq_res_parse_mode] :: InlineQueryResult -> Maybe ParseMode
+ Web.Telegram.API.Bot.Data: [iq_res_photo_height] :: InlineQueryResult -> Maybe Int
+ Web.Telegram.API.Bot.Data: [iq_res_photo_url] :: InlineQueryResult -> Text
+ Web.Telegram.API.Bot.Data: [iq_res_photo_width] :: InlineQueryResult -> Maybe Int
+ Web.Telegram.API.Bot.Data: [iq_res_thumb_height] :: InlineQueryResult -> Maybe Int
+ Web.Telegram.API.Bot.Data: [iq_res_thumb_url] :: InlineQueryResult -> Maybe Text
+ Web.Telegram.API.Bot.Data: [iq_res_thumb_width] :: InlineQueryResult -> Maybe Int
+ Web.Telegram.API.Bot.Data: [iq_res_title] :: InlineQueryResult -> Maybe Text
+ Web.Telegram.API.Bot.Data: [iq_res_url] :: InlineQueryResult -> Maybe Text
+ Web.Telegram.API.Bot.Data: [iq_res_video_duration] :: InlineQueryResult -> Maybe Int
+ Web.Telegram.API.Bot.Data: [iq_res_video_height] :: InlineQueryResult -> Maybe Int
+ Web.Telegram.API.Bot.Data: [iq_res_video_url] :: InlineQueryResult -> Text
+ Web.Telegram.API.Bot.Data: [iq_res_video_width] :: InlineQueryResult -> Maybe Int
+ Web.Telegram.API.Bot.Data: [query_from] :: InlineQuery -> User
+ Web.Telegram.API.Bot.Data: [query_id] :: InlineQuery -> Text
+ Web.Telegram.API.Bot.Data: [query_offset] :: InlineQuery -> Text
+ Web.Telegram.API.Bot.Data: [query_query] :: InlineQuery -> Text
+ Web.Telegram.API.Bot.Data: data ChosenInlineResult
+ Web.Telegram.API.Bot.Data: data InlineQuery
+ Web.Telegram.API.Bot.Data: data InlineQueryResult
+ Web.Telegram.API.Bot.Data: data ParseMode
+ Web.Telegram.API.Bot.Data: instance Data.Aeson.Types.Class.FromJSON Web.Telegram.API.Bot.Data.ChosenInlineResult
+ Web.Telegram.API.Bot.Data: instance Data.Aeson.Types.Class.FromJSON Web.Telegram.API.Bot.Data.InlineQuery
+ Web.Telegram.API.Bot.Data: instance Data.Aeson.Types.Class.FromJSON Web.Telegram.API.Bot.Data.InlineQueryResult
+ Web.Telegram.API.Bot.Data: instance Data.Aeson.Types.Class.FromJSON Web.Telegram.API.Bot.Data.ParseMode
+ Web.Telegram.API.Bot.Data: instance Data.Aeson.Types.Class.ToJSON Web.Telegram.API.Bot.Data.ChosenInlineResult
+ Web.Telegram.API.Bot.Data: instance Data.Aeson.Types.Class.ToJSON Web.Telegram.API.Bot.Data.InlineQuery
+ Web.Telegram.API.Bot.Data: instance Data.Aeson.Types.Class.ToJSON Web.Telegram.API.Bot.Data.InlineQueryResult
+ Web.Telegram.API.Bot.Data: instance Data.Aeson.Types.Class.ToJSON Web.Telegram.API.Bot.Data.ParseMode
+ Web.Telegram.API.Bot.Data: instance GHC.Generics.Constructor Web.Telegram.API.Bot.Data.C1_0ChosenInlineResult
+ Web.Telegram.API.Bot.Data: instance GHC.Generics.Constructor Web.Telegram.API.Bot.Data.C1_0InlineQuery
+ Web.Telegram.API.Bot.Data: instance GHC.Generics.Constructor Web.Telegram.API.Bot.Data.C1_0InlineQueryResult
+ Web.Telegram.API.Bot.Data: instance GHC.Generics.Constructor Web.Telegram.API.Bot.Data.C1_0ParseMode
+ Web.Telegram.API.Bot.Data: instance GHC.Generics.Constructor Web.Telegram.API.Bot.Data.C1_1InlineQueryResult
+ Web.Telegram.API.Bot.Data: instance GHC.Generics.Constructor Web.Telegram.API.Bot.Data.C1_2InlineQueryResult
+ Web.Telegram.API.Bot.Data: instance GHC.Generics.Constructor Web.Telegram.API.Bot.Data.C1_3InlineQueryResult
+ Web.Telegram.API.Bot.Data: instance GHC.Generics.Constructor Web.Telegram.API.Bot.Data.C1_4InlineQueryResult
+ Web.Telegram.API.Bot.Data: instance GHC.Generics.Datatype Web.Telegram.API.Bot.Data.D1ChosenInlineResult
+ Web.Telegram.API.Bot.Data: instance GHC.Generics.Datatype Web.Telegram.API.Bot.Data.D1InlineQuery
+ Web.Telegram.API.Bot.Data: instance GHC.Generics.Datatype Web.Telegram.API.Bot.Data.D1InlineQueryResult
+ Web.Telegram.API.Bot.Data: instance GHC.Generics.Datatype Web.Telegram.API.Bot.Data.D1ParseMode
+ Web.Telegram.API.Bot.Data: instance GHC.Generics.Generic Web.Telegram.API.Bot.Data.ChosenInlineResult
+ Web.Telegram.API.Bot.Data: instance GHC.Generics.Generic Web.Telegram.API.Bot.Data.InlineQuery
+ Web.Telegram.API.Bot.Data: instance GHC.Generics.Generic Web.Telegram.API.Bot.Data.InlineQueryResult
+ Web.Telegram.API.Bot.Data: instance GHC.Generics.Generic Web.Telegram.API.Bot.Data.ParseMode
+ Web.Telegram.API.Bot.Data: instance GHC.Generics.Selector Web.Telegram.API.Bot.Data.S1_0_0ChosenInlineResult
+ Web.Telegram.API.Bot.Data: instance GHC.Generics.Selector Web.Telegram.API.Bot.Data.S1_0_0InlineQuery
+ Web.Telegram.API.Bot.Data: instance GHC.Generics.Selector Web.Telegram.API.Bot.Data.S1_0_0InlineQueryResult
+ Web.Telegram.API.Bot.Data: instance GHC.Generics.Selector Web.Telegram.API.Bot.Data.S1_0_10InlineQueryResult
+ Web.Telegram.API.Bot.Data: instance GHC.Generics.Selector Web.Telegram.API.Bot.Data.S1_0_1ChosenInlineResult
+ Web.Telegram.API.Bot.Data: instance GHC.Generics.Selector Web.Telegram.API.Bot.Data.S1_0_1InlineQuery
+ Web.Telegram.API.Bot.Data: instance GHC.Generics.Selector Web.Telegram.API.Bot.Data.S1_0_1InlineQueryResult
+ Web.Telegram.API.Bot.Data: instance GHC.Generics.Selector Web.Telegram.API.Bot.Data.S1_0_2ChosenInlineResult
+ Web.Telegram.API.Bot.Data: instance GHC.Generics.Selector Web.Telegram.API.Bot.Data.S1_0_2InlineQuery
+ Web.Telegram.API.Bot.Data: instance GHC.Generics.Selector Web.Telegram.API.Bot.Data.S1_0_2InlineQueryResult
+ Web.Telegram.API.Bot.Data: instance GHC.Generics.Selector Web.Telegram.API.Bot.Data.S1_0_2Update
+ Web.Telegram.API.Bot.Data: instance GHC.Generics.Selector Web.Telegram.API.Bot.Data.S1_0_3InlineQuery
+ Web.Telegram.API.Bot.Data: instance GHC.Generics.Selector Web.Telegram.API.Bot.Data.S1_0_3InlineQueryResult
+ Web.Telegram.API.Bot.Data: instance GHC.Generics.Selector Web.Telegram.API.Bot.Data.S1_0_3Update
+ Web.Telegram.API.Bot.Data: instance GHC.Generics.Selector Web.Telegram.API.Bot.Data.S1_0_4InlineQueryResult
+ Web.Telegram.API.Bot.Data: instance GHC.Generics.Selector Web.Telegram.API.Bot.Data.S1_0_5InlineQueryResult
+ Web.Telegram.API.Bot.Data: instance GHC.Generics.Selector Web.Telegram.API.Bot.Data.S1_0_6InlineQueryResult
+ Web.Telegram.API.Bot.Data: instance GHC.Generics.Selector Web.Telegram.API.Bot.Data.S1_0_7InlineQueryResult
+ Web.Telegram.API.Bot.Data: instance GHC.Generics.Selector Web.Telegram.API.Bot.Data.S1_0_8InlineQueryResult
+ Web.Telegram.API.Bot.Data: instance GHC.Generics.Selector Web.Telegram.API.Bot.Data.S1_0_9InlineQueryResult
+ Web.Telegram.API.Bot.Data: instance GHC.Generics.Selector Web.Telegram.API.Bot.Data.S1_1_0InlineQueryResult
+ Web.Telegram.API.Bot.Data: instance GHC.Generics.Selector Web.Telegram.API.Bot.Data.S1_1_10InlineQueryResult
+ Web.Telegram.API.Bot.Data: instance GHC.Generics.Selector Web.Telegram.API.Bot.Data.S1_1_1InlineQueryResult
+ Web.Telegram.API.Bot.Data: instance GHC.Generics.Selector Web.Telegram.API.Bot.Data.S1_1_2InlineQueryResult
+ Web.Telegram.API.Bot.Data: instance GHC.Generics.Selector Web.Telegram.API.Bot.Data.S1_1_3InlineQueryResult
+ Web.Telegram.API.Bot.Data: instance GHC.Generics.Selector Web.Telegram.API.Bot.Data.S1_1_4InlineQueryResult
+ Web.Telegram.API.Bot.Data: instance GHC.Generics.Selector Web.Telegram.API.Bot.Data.S1_1_5InlineQueryResult
+ Web.Telegram.API.Bot.Data: instance GHC.Generics.Selector Web.Telegram.API.Bot.Data.S1_1_6InlineQueryResult
+ Web.Telegram.API.Bot.Data: instance GHC.Generics.Selector Web.Telegram.API.Bot.Data.S1_1_7InlineQueryResult
+ Web.Telegram.API.Bot.Data: instance GHC.Generics.Selector Web.Telegram.API.Bot.Data.S1_1_8InlineQueryResult
+ Web.Telegram.API.Bot.Data: instance GHC.Generics.Selector Web.Telegram.API.Bot.Data.S1_1_9InlineQueryResult
+ Web.Telegram.API.Bot.Data: instance GHC.Generics.Selector Web.Telegram.API.Bot.Data.S1_2_0InlineQueryResult
+ Web.Telegram.API.Bot.Data: instance GHC.Generics.Selector Web.Telegram.API.Bot.Data.S1_2_1InlineQueryResult
+ Web.Telegram.API.Bot.Data: instance GHC.Generics.Selector Web.Telegram.API.Bot.Data.S1_2_2InlineQueryResult
+ Web.Telegram.API.Bot.Data: instance GHC.Generics.Selector Web.Telegram.API.Bot.Data.S1_2_3InlineQueryResult
+ Web.Telegram.API.Bot.Data: instance GHC.Generics.Selector Web.Telegram.API.Bot.Data.S1_2_4InlineQueryResult
+ Web.Telegram.API.Bot.Data: instance GHC.Generics.Selector Web.Telegram.API.Bot.Data.S1_2_5InlineQueryResult
+ Web.Telegram.API.Bot.Data: instance GHC.Generics.Selector Web.Telegram.API.Bot.Data.S1_2_6InlineQueryResult
+ Web.Telegram.API.Bot.Data: instance GHC.Generics.Selector Web.Telegram.API.Bot.Data.S1_2_7InlineQueryResult
+ Web.Telegram.API.Bot.Data: instance GHC.Generics.Selector Web.Telegram.API.Bot.Data.S1_2_8InlineQueryResult
+ Web.Telegram.API.Bot.Data: instance GHC.Generics.Selector Web.Telegram.API.Bot.Data.S1_2_9InlineQueryResult
+ Web.Telegram.API.Bot.Data: instance GHC.Generics.Selector Web.Telegram.API.Bot.Data.S1_3_0InlineQueryResult
+ Web.Telegram.API.Bot.Data: instance GHC.Generics.Selector Web.Telegram.API.Bot.Data.S1_3_1InlineQueryResult
+ Web.Telegram.API.Bot.Data: instance GHC.Generics.Selector Web.Telegram.API.Bot.Data.S1_3_2InlineQueryResult
+ Web.Telegram.API.Bot.Data: instance GHC.Generics.Selector Web.Telegram.API.Bot.Data.S1_3_3InlineQueryResult
+ Web.Telegram.API.Bot.Data: instance GHC.Generics.Selector Web.Telegram.API.Bot.Data.S1_3_4InlineQueryResult
+ Web.Telegram.API.Bot.Data: instance GHC.Generics.Selector Web.Telegram.API.Bot.Data.S1_3_5InlineQueryResult
+ Web.Telegram.API.Bot.Data: instance GHC.Generics.Selector Web.Telegram.API.Bot.Data.S1_3_6InlineQueryResult
+ Web.Telegram.API.Bot.Data: instance GHC.Generics.Selector Web.Telegram.API.Bot.Data.S1_3_7InlineQueryResult
+ Web.Telegram.API.Bot.Data: instance GHC.Generics.Selector Web.Telegram.API.Bot.Data.S1_3_8InlineQueryResult
+ Web.Telegram.API.Bot.Data: instance GHC.Generics.Selector Web.Telegram.API.Bot.Data.S1_3_9InlineQueryResult
+ Web.Telegram.API.Bot.Data: instance GHC.Generics.Selector Web.Telegram.API.Bot.Data.S1_4_0InlineQueryResult
+ Web.Telegram.API.Bot.Data: instance GHC.Generics.Selector Web.Telegram.API.Bot.Data.S1_4_10InlineQueryResult
+ Web.Telegram.API.Bot.Data: instance GHC.Generics.Selector Web.Telegram.API.Bot.Data.S1_4_11InlineQueryResult
+ Web.Telegram.API.Bot.Data: instance GHC.Generics.Selector Web.Telegram.API.Bot.Data.S1_4_1InlineQueryResult
+ Web.Telegram.API.Bot.Data: instance GHC.Generics.Selector Web.Telegram.API.Bot.Data.S1_4_2InlineQueryResult
+ Web.Telegram.API.Bot.Data: instance GHC.Generics.Selector Web.Telegram.API.Bot.Data.S1_4_3InlineQueryResult
+ Web.Telegram.API.Bot.Data: instance GHC.Generics.Selector Web.Telegram.API.Bot.Data.S1_4_4InlineQueryResult
+ Web.Telegram.API.Bot.Data: instance GHC.Generics.Selector Web.Telegram.API.Bot.Data.S1_4_5InlineQueryResult
+ Web.Telegram.API.Bot.Data: instance GHC.Generics.Selector Web.Telegram.API.Bot.Data.S1_4_6InlineQueryResult
+ Web.Telegram.API.Bot.Data: instance GHC.Generics.Selector Web.Telegram.API.Bot.Data.S1_4_7InlineQueryResult
+ Web.Telegram.API.Bot.Data: instance GHC.Generics.Selector Web.Telegram.API.Bot.Data.S1_4_8InlineQueryResult
+ Web.Telegram.API.Bot.Data: instance GHC.Generics.Selector Web.Telegram.API.Bot.Data.S1_4_9InlineQueryResult
+ Web.Telegram.API.Bot.Data: instance GHC.Show.Show Web.Telegram.API.Bot.Data.ChosenInlineResult
+ Web.Telegram.API.Bot.Data: instance GHC.Show.Show Web.Telegram.API.Bot.Data.InlineQuery
+ Web.Telegram.API.Bot.Data: instance GHC.Show.Show Web.Telegram.API.Bot.Data.InlineQueryResult
+ Web.Telegram.API.Bot.Data: instance GHC.Show.Show Web.Telegram.API.Bot.Data.ParseMode
+ Web.Telegram.API.Bot.Requests: AnswerInlineQueryRequest :: Text -> [InlineQueryResult] -> Maybe Int -> Maybe Bool -> Maybe Text -> AnswerInlineQueryRequest
+ Web.Telegram.API.Bot.Requests: [query_cache_time] :: AnswerInlineQueryRequest -> Maybe Int
+ Web.Telegram.API.Bot.Requests: [query_inline_query_id] :: AnswerInlineQueryRequest -> Text
+ Web.Telegram.API.Bot.Requests: [query_is_personal] :: AnswerInlineQueryRequest -> Maybe Bool
+ Web.Telegram.API.Bot.Requests: [query_next_offset] :: AnswerInlineQueryRequest -> Maybe Text
+ Web.Telegram.API.Bot.Requests: [query_results] :: AnswerInlineQueryRequest -> [InlineQueryResult]
+ Web.Telegram.API.Bot.Requests: data AnswerInlineQueryRequest
+ Web.Telegram.API.Bot.Requests: instance Data.Aeson.Types.Class.FromJSON Web.Telegram.API.Bot.Requests.AnswerInlineQueryRequest
+ Web.Telegram.API.Bot.Requests: instance Data.Aeson.Types.Class.ToJSON Web.Telegram.API.Bot.Requests.AnswerInlineQueryRequest
+ Web.Telegram.API.Bot.Requests: instance GHC.Generics.Constructor Web.Telegram.API.Bot.Requests.C1_0AnswerInlineQueryRequest
+ Web.Telegram.API.Bot.Requests: instance GHC.Generics.Datatype Web.Telegram.API.Bot.Requests.D1AnswerInlineQueryRequest
+ Web.Telegram.API.Bot.Requests: instance GHC.Generics.Generic Web.Telegram.API.Bot.Requests.AnswerInlineQueryRequest
+ Web.Telegram.API.Bot.Requests: instance GHC.Generics.Selector Web.Telegram.API.Bot.Requests.S1_0_0AnswerInlineQueryRequest
+ Web.Telegram.API.Bot.Requests: instance GHC.Generics.Selector Web.Telegram.API.Bot.Requests.S1_0_1AnswerInlineQueryRequest
+ Web.Telegram.API.Bot.Requests: instance GHC.Generics.Selector Web.Telegram.API.Bot.Requests.S1_0_2AnswerInlineQueryRequest
+ Web.Telegram.API.Bot.Requests: instance GHC.Generics.Selector Web.Telegram.API.Bot.Requests.S1_0_3AnswerInlineQueryRequest
+ Web.Telegram.API.Bot.Requests: instance GHC.Generics.Selector Web.Telegram.API.Bot.Requests.S1_0_4AnswerInlineQueryRequest
+ Web.Telegram.API.Bot.Requests: instance GHC.Show.Show Web.Telegram.API.Bot.Requests.AnswerInlineQueryRequest
+ Web.Telegram.API.Bot.Responses: InlineQueryResponse :: Bool -> InlineQueryResponse
+ Web.Telegram.API.Bot.Responses: [query_result] :: InlineQueryResponse -> Bool
+ Web.Telegram.API.Bot.Responses: data InlineQueryResponse
+ Web.Telegram.API.Bot.Responses: instance Data.Aeson.Types.Class.FromJSON Web.Telegram.API.Bot.Responses.InlineQueryResponse
+ Web.Telegram.API.Bot.Responses: instance Data.Aeson.Types.Class.ToJSON Web.Telegram.API.Bot.Responses.InlineQueryResponse
+ Web.Telegram.API.Bot.Responses: instance GHC.Generics.Constructor Web.Telegram.API.Bot.Responses.C1_0InlineQueryResponse
+ Web.Telegram.API.Bot.Responses: instance GHC.Generics.Datatype Web.Telegram.API.Bot.Responses.D1InlineQueryResponse
+ Web.Telegram.API.Bot.Responses: instance GHC.Generics.Generic Web.Telegram.API.Bot.Responses.InlineQueryResponse
+ Web.Telegram.API.Bot.Responses: instance GHC.Generics.Selector Web.Telegram.API.Bot.Responses.S1_0_0InlineQueryResponse
+ Web.Telegram.API.Bot.Responses: instance GHC.Show.Show Web.Telegram.API.Bot.Responses.InlineQueryResponse
- Web.Telegram.API.Bot.API: type TelegramBotAPI = (TelegramToken :> ("getMe" :> Get '[JSON] GetMeResponse)) :<|> ((TelegramToken :> ("sendMessage" :> (ReqBody '[JSON] SendMessageRequest :> Post '[JSON] MessageResponse))) :<|> ((TelegramToken :> ("forwardMessage" :> (ReqBody '[JSON] ForwardMessageRequest :> Post '[JSON] MessageResponse))) :<|> ((TelegramToken :> ("sendPhoto" :> (ReqBody '[JSON] SendPhotoRequest :> Post '[JSON] MessageResponse))) :<|> ((TelegramToken :> ("sendAudio" :> (ReqBody '[JSON] SendAudioRequest :> Post '[JSON] MessageResponse))) :<|> ((TelegramToken :> ("sendDocument" :> (ReqBody '[JSON] SendDocumentRequest :> Post '[JSON] MessageResponse))) :<|> ((TelegramToken :> ("sendSticker" :> (ReqBody '[JSON] SendStickerRequest :> Post '[JSON] MessageResponse))) :<|> ((TelegramToken :> ("sendVideo" :> (ReqBody '[JSON] SendVideoRequest :> Post '[JSON] MessageResponse))) :<|> ((TelegramToken :> ("sendVoice" :> (ReqBody '[JSON] SendVoiceRequest :> Post '[JSON] MessageResponse))) :<|> ((TelegramToken :> ("sendLocation" :> (ReqBody '[JSON] SendLocationRequest :> Post '[JSON] MessageResponse))) :<|> ((TelegramToken :> ("sendChatAction" :> (ReqBody '[JSON] SendChatActionRequest :> Post '[JSON] ChatActionResponse))) :<|> ((TelegramToken :> ("getUpdates" :> (QueryParam "offset" Int :> (QueryParam "limit" Int :> (QueryParam "timeout" Int :> Get '[JSON] UpdatesResponse))))) :<|> ((TelegramToken :> ("getFile" :> (QueryParam "file_id" Text :> Get '[JSON] FileResponse))) :<|> ((TelegramToken :> ("getUserProfilePhotos" :> (QueryParam "user_id" Int :> (QueryParam "offset" Int :> (QueryParam "limit" Int :> Get '[JSON] UserProfilePhotosResponse))))) :<|> (TelegramToken :> ("setWebhook" :> (QueryParam "url" Text :> Get '[JSON] SetWebhookResponse))))))))))))))))
+ Web.Telegram.API.Bot.API: type TelegramBotAPI = (TelegramToken :> ("getMe" :> Get '[JSON] GetMeResponse)) :<|> ((TelegramToken :> ("sendMessage" :> (ReqBody '[JSON] SendMessageRequest :> Post '[JSON] MessageResponse))) :<|> ((TelegramToken :> ("forwardMessage" :> (ReqBody '[JSON] ForwardMessageRequest :> Post '[JSON] MessageResponse))) :<|> ((TelegramToken :> ("sendPhoto" :> (ReqBody '[JSON] SendPhotoRequest :> Post '[JSON] MessageResponse))) :<|> ((TelegramToken :> ("sendAudio" :> (ReqBody '[JSON] SendAudioRequest :> Post '[JSON] MessageResponse))) :<|> ((TelegramToken :> ("sendDocument" :> (ReqBody '[JSON] SendDocumentRequest :> Post '[JSON] MessageResponse))) :<|> ((TelegramToken :> ("sendSticker" :> (ReqBody '[JSON] SendStickerRequest :> Post '[JSON] MessageResponse))) :<|> ((TelegramToken :> ("sendVideo" :> (ReqBody '[JSON] SendVideoRequest :> Post '[JSON] MessageResponse))) :<|> ((TelegramToken :> ("sendVoice" :> (ReqBody '[JSON] SendVoiceRequest :> Post '[JSON] MessageResponse))) :<|> ((TelegramToken :> ("sendLocation" :> (ReqBody '[JSON] SendLocationRequest :> Post '[JSON] MessageResponse))) :<|> ((TelegramToken :> ("sendChatAction" :> (ReqBody '[JSON] SendChatActionRequest :> Post '[JSON] ChatActionResponse))) :<|> ((TelegramToken :> ("getUpdates" :> (QueryParam "offset" Int :> (QueryParam "limit" Int :> (QueryParam "timeout" Int :> Get '[JSON] UpdatesResponse))))) :<|> ((TelegramToken :> ("getFile" :> (QueryParam "file_id" Text :> Get '[JSON] FileResponse))) :<|> ((TelegramToken :> ("getUserProfilePhotos" :> (QueryParam "user_id" Int :> (QueryParam "offset" Int :> (QueryParam "limit" Int :> Get '[JSON] UserProfilePhotosResponse))))) :<|> ((TelegramToken :> ("setWebhook" :> (QueryParam "url" Text :> Get '[JSON] SetWebhookResponse))) :<|> (TelegramToken :> ("answerInlineQuery" :> (ReqBody '[JSON] AnswerInlineQueryRequest :> Post '[JSON] InlineQueryResponse)))))))))))))))))
- Web.Telegram.API.Bot.Data: Update :: Int -> Message -> Update
+ Web.Telegram.API.Bot.Data: Update :: Int -> Maybe Message -> Maybe InlineQuery -> Maybe ChosenInlineResult -> Update
- Web.Telegram.API.Bot.Data: [message] :: Update -> Message
+ Web.Telegram.API.Bot.Data: [message] :: Update -> Maybe Message
Files
- README.md +5/−3
- src/Web/Telegram/API/Bot/API.hs +12/−2
- src/Web/Telegram/API/Bot/Data.hs +157/−17
- src/Web/Telegram/API/Bot/Requests.hs +19/−12
- src/Web/Telegram/API/Bot/Responses.hs +15/−2
- telegram-api.cabal +1/−1
- test/Spec.hs +47/−3
README.md view
@@ -7,8 +7,10 @@  High-level bindings to the [Telegram Bots API][telegram-bot-api] based on [servant][servant] library. -Currently supports only one way of receiving updates based on [`getUpdates`](https://core.telegram.org/bots/api#getupdates) method. -Uploading stickers, documents, video, etc is not supported yet, so you can only send items which are already uploaded on the Telegram servers. +Both `getUpdates` request or webhook can be used to receive updates for your bot. +Inline mode is supported. +Uploading stickers, documents, video, etc is not supported yet, but you can send items which are already uploaded on the Telegram servers. + See list of supported methods below in TODO section. ## Usage @@ -80,6 +82,7 @@ * `sendChatAction` * `getUserProfilePhotos` * `setWebhook` - without uploading certificate +* `answerInlineQuery` ##### To be done: @@ -90,7 +93,6 @@ * `sendVideo` - upload video * `sendVoice` - upload voice * `setWebhook` - upload certificate -* `answerInlineQuery` inline bots [telegram-bot-api]: https://core.telegram.org/bots/api [servant]: https://haskell-servant.github.io/
src/Web/Telegram/API/Bot/API.hs view
@@ -22,6 +22,7 @@ , getFile , getUserProfilePhotos , setWebhook + , answerInlineQuery -- * API , TelegramBotAPI , api @@ -109,6 +110,9 @@ :> QueryParam "url" Text :> Get '[JSON] SetWebhookResponse + :<|> TelegramToken :> "answerInlineQuery" + :> ReqBody '[JSON] AnswerInlineQueryRequest + :> Post '[JSON] InlineQueryResponse -- | Proxy for Thelegram Bot API api :: Proxy TelegramBotAPI @@ -129,6 +133,7 @@ getFile_ :: Token -> Maybe Text -> EitherT ServantError IO FileResponse getUserProfilePhotos_ :: Token -> Maybe Int -> Maybe Int -> Maybe Int -> EitherT ServantError IO UserProfilePhotosResponse setWebhook_ :: Token -> Maybe Text -> EitherT ServantError IO SetWebhookResponse +answerInlineQuery_ :: Token -> AnswerInlineQueryRequest -> EitherT ServantError IO InlineQueryResponse getMe_ :<|> sendMessage_ :<|> forwardMessage_ @@ -143,7 +148,8 @@ :<|> getUpdates_ :<|> getFile_ :<|> getUserProfilePhotos_ - :<|> setWebhook_ = + :<|> setWebhook_ + :<|> answerInlineQuery_ = client api (BaseUrl Https "api.telegram.org" 443) -- | A simple method for testing your bot's auth token. Requires no parameters. @@ -199,6 +205,7 @@ getUpdates :: Token -> Maybe Int -> Maybe Int -> Maybe Int -> IO (Either ServantError UpdatesResponse) getUpdates token offset limit timeout = runEitherT $ getUpdates_ token offset limit timeout +-- | Use this method to get basic info about a file and prepare it for downloading. For the moment, bots can download files of up to 20MB in size. On success, a 'File' object is returned. The file can then be downloaded via the link @https://api.telegram.org/file/bot<token>/<file_path>@, where @<file_path>@ is taken from the response. It is guaranteed that the link will be valid for at least 1 hour. When the link expires, a new one can be requested by calling getFile again. getFile :: Token -> Text -> IO (Either ServantError FileResponse) getFile token file_id = runEitherT $ getFile_ token (Just file_id) @@ -212,4 +219,7 @@ setWebhook :: Token -> Maybe Text -- ^ HTTPS url to send updates to. Use an empty string to remove webhook integration -> IO (Either ServantError SetWebhookResponse) -setWebhook token url = runEitherT $ setWebhook_ token url+setWebhook token url = runEitherT $ setWebhook_ token url + +answerInlineQuery :: Token -> AnswerInlineQueryRequest -> IO (Either ServantError InlineQueryResponse) +answerInlineQuery token request = runEitherT $ answerInlineQuery_ token request
src/Web/Telegram/API/Bot/Data.hs view
@@ -8,21 +8,25 @@ -- | This module contains objects which represent data of Telegram Bot API responses module Web.Telegram.API.Bot.Data ( -- * Types - User (..) - , Chat (..) - , Message (..) - , PhotoSize (..) - , Audio (..) - , Document (..) - , Sticker (..) - , Video (..) - , Voice (..) - , Contact (..) - , Location (..) - , Update (..) - , File (..) - , UserProfilePhotos (..) - , ChatType (..) + User (..) + , Chat (..) + , Message (..) + , PhotoSize (..) + , Audio (..) + , Document (..) + , Sticker (..) + , Video (..) + , Voice (..) + , Contact (..) + , Location (..) + , Update (..) + , File (..) + , UserProfilePhotos (..) + , InlineQuery (..) + , ChosenInlineResult (..) + , InlineQueryResult (..) + , ChatType (..) + , ParseMode (..) ) where import Data.Aeson @@ -31,8 +35,10 @@ import Data.Proxy import Data.Text (Text) import qualified Data.Text as T +import qualified Data.Char as Char import GHC.Generics import GHC.TypeLits +import Data.List import Web.Telegram.API.Bot.JsonExt -- | This object represents a Telegram user or bot. @@ -100,6 +106,16 @@ parseJSON "supergroup" = pure Supergroup parseJSON "channel" = pure Channel +-- | Parse mode for text message +data ParseMode = Markdown deriving (Show, Generic) + +instance ToJSON ParseMode where + toJSON Markdown = "Markdown" + +instance FromJSON ParseMode where + parseJSON "Markdown" = pure $ Markdown + parseJSON _ = fail "Failed to parse ParseMode" + -- | This object represents one size of a photo or a 'File' / 'Sticker' thumbnail. data PhotoSize = PhotoSize { @@ -197,12 +213,136 @@ instance FromJSON Voice where parseJSON = parseJsonDrop 6 +-- | This object represents an incoming inline query. When the user sends an empty query, your bot could return some default or trending results. +data InlineQuery = InlineQuery + { + query_id :: Text -- ^ Unique identifier for this query + , query_from :: User -- ^ Sender + , query_query :: Text -- ^ Text of the query + , query_offset :: Text -- ^ Offset of the results to be returned, can be controlled by the bot + } deriving (Show, Generic) + +instance ToJSON InlineQuery where + toJSON = toJsonDrop 6 + +instance FromJSON InlineQuery where + parseJSON = parseJsonDrop 6 + +-- | This object represents a result of an inline query that was chosen by the user and sent to their chat partner. +data ChosenInlineResult = ChosenInlineResult + { + chosen_result_id :: Text -- ^ Unique identifier for this query + , chosen_from :: User -- ^ Sender + , chosen_query :: Text -- ^ Text of the query + } deriving (Show, Generic) + +instance ToJSON ChosenInlineResult where + toJSON = toJsonDrop 7 + +instance FromJSON ChosenInlineResult where + parseJSON = parseJsonDrop 7 + +data InlineQueryResult = + -- | Represents a link to an article or web page. + InlineQueryResultArticle + { + iq_res_id :: Text -- ^ Unique identifier for this result, 1-64 Bytes + , iq_res_title :: Maybe Text -- ^ Title of the result + , iq_res_message_text :: Maybe Text -- ^ Text of the message to be sent + , iq_res_parse_mode :: Maybe ParseMode -- Send 'Markdown', if you want Telegram apps to show bold, italic and inline URLs in your bot's message. + , iq_res_disable_web_page_preview :: Maybe Bool -- ^ Disables link previews for links in the sent message + , iq_res_url :: Maybe Text -- ^ URL of the result + , iq_res_hide_url :: Maybe Bool -- ^ Pass True, if you don't want the URL to be shown in the message + , iq_res_description :: Maybe Text -- ^ Short description of the result + , iq_res_thumb_url :: Maybe Text -- ^ Url of the thumbnail for the result + , iq_res_thumb_width :: Maybe Int -- ^ Thumbnail width + , iq_res_thumb_height :: Maybe Int -- ^ Thumbnail height + } + -- | Represents a link to a photo. By default, this photo will be sent by the user with optional caption. Alternatively, you can provide message_text to send it instead of photo. + | InlineQueryResultPhoto + { + iq_res_id :: Text -- ^ Unique identifier for this result, 1-64 bytes + , iq_res_photo_url :: Text -- ^ A valid URL of the photo. Photo must be in jpeg format. Photo size must not exceed 5MB + , iq_res_photo_width :: Maybe Int -- ^ Optional. Width of the photo + , iq_res_photo_height :: Maybe Int -- ^ Optional. Height of the photo + , iq_res_thumb_url :: Maybe Text -- ^ URL of the thumbnail for the photo + , iq_res_title :: Maybe Text -- ^ Title for the result + , iq_res_description :: Maybe Text -- ^ Short description of the result + , iq_res_caption :: Maybe Text -- ^ Caption of the photo to be sent, 0-200 characters + , iq_res_message_text :: Maybe Text -- ^ Text of a message to be sent instead of the photo, 1-512 characters + , iq_res_parse_mode :: Maybe ParseMode -- ^ Send 'Markdown', if you want Telegram apps to show bold, italic and inline URLs in your bot's message. + , iq_res_disable_web_page_preview :: Maybe Bool -- ^ Disables link previews for links in the sent message + } + -- | Represents a link to an animated GIF file. By default, this animated GIF file will be sent by the user with optional caption. Alternatively, you can provide message_text to send it instead of the animation. + | InlineQueryResultGif + { + iq_res_id :: Text -- ^ Unique identifier for this result, 1-64 bytes + , iq_res_gif_url :: Text -- ^ A valid URL for the GIF file. File size must not exceed 1MB + , iq_res_gif_width :: Maybe Int -- ^ Width of the GIF + , iq_res_gif_height :: Maybe Int -- ^ Height of the GIF + , iq_res_thumb_url :: Maybe Text -- ^ URL of the static thumbnail for the result (jpeg or gif) + , iq_res_title :: Maybe Text -- ^ Title for the result + , iq_res_caption :: Maybe Text -- ^ Caption of the GIF file to be sent, 0-200 characters + , iq_res_message_text :: Maybe Text -- ^ Text of a message to be sent instead of the animation, 1-512 characters + , iq_res_parse_mode :: Maybe ParseMode -- ^ Send 'Markdown', if you want Telegram apps to show bold, italic and inline URLs in your bot's message. + , iq_res_disable_web_page_preview :: Maybe Bool -- ^ Disables link previews for links in the sent message + } + -- | Represents a link to a video animation (H.264/MPEG-4 AVC video without sound). By default, this animated MPEG-4 file will be sent by the user with optional caption. Alternatively, you can provide message_text to send it instead of the animation. + | InlineQueryResultMpeg4Gif + { + iq_res_id :: Text -- ^ Unique identifier for this result, 1-64 bytes + , iq_res_mpeg4_url :: Text -- ^ A valid URL for the MP4 file. File size must not exceed 1MB + , iq_res_mpeg4_width :: Maybe Int -- ^ Video width + , iq_res_mpeg4_height :: Maybe Int -- ^ Video height + , iq_res_thumb_url :: Maybe Text -- ^ URL of the static thumbnail (jpeg or gif) for the result + , iq_res_title :: Maybe Text -- ^ Title for the result + , iq_res_caption :: Maybe Text -- ^ Caption of the MPEG-4 file to be sent, 0-200 characters + , iq_res_message_text :: Maybe Text -- ^ Text of a message to be sent instead of the animation, 1-512 characters + , iq_res_parse_mode :: Maybe ParseMode -- ^ Send 'Markdown', if you want Telegram apps to show bold, italic and inline URLs in your bot's message. + , iq_res_disable_web_page_preview :: Maybe Bool -- ^ Disables link previews for links in the sent message + } + -- | Represents link to a page containing an embedded video player or a video file. + | InlineQueryResultVideo + { + iq_res_id :: Text -- ^ Unique identifier for this result, 1-64 bytes + , iq_res_video_url :: Text -- ^ A valid URL for the embedded video player or video file + , iq_res_mime_type :: Text -- ^ Mime type of the content of video url, “text/html” or “video/mp4” + , iq_res_message_text :: Maybe Text -- ^ Text of the message to be sent with the video, 1-512 characters + , iq_res_parse_mode :: Maybe ParseMode -- ^ Send 'Markdown', if you want Telegram apps to show bold, italic and inline URLs in your bot's message. + , iq_res_disable_web_page_preview :: Maybe Bool -- ^ Disables link previews for links in the sent message + , iq_res_video_width :: Maybe Int -- ^ Video width + , iq_res_video_height :: Maybe Int -- ^ Video height + , iq_res_video_duration :: Maybe Int -- ^ Video duration in seconds + , iq_res_thumb_url :: Maybe Text -- ^ URL of the thumbnail (jpeg only) for the video + , iq_res_title :: Maybe Text -- ^ Title for the result + , iq_res_description :: Maybe Text -- ^ Short description of the result + } deriving (Show, Generic) + +tagModifier "InlineQueryResultMpeg4Gif" = "mpeg4_gif" +tagModifier x = ((drop 17) . (fmap (Char.toLower))) x + +inlineQueryJSONOptions :: Options +inlineQueryJSONOptions = defaultOptions { + fieldLabelModifier = drop 7 + , omitNothingFields = True + , sumEncoding = TaggedObject { tagFieldName = "type" } + , constructorTagModifier = tagModifier + } + +instance ToJSON InlineQueryResult where + toJSON = genericToJSON inlineQueryJSONOptions + +instance FromJSON InlineQueryResult where + parseJSON = genericParseJSON inlineQueryJSONOptions + -- | This object represents an incoming update. -- Only one of the optional parameters can be present in any given update. data Update = Update { - update_id :: Int -- ^ The update's unique identifier. Update identifiers start from a certain positive number and increase sequentially. This ID becomes especially handy if you’re using 'setWebhooks', since it allows you to ignore repeated updates or to restore the correct update sequence, should they get out of order. - , message :: Message -- ^ New incoming message of any kind — text, photo, sticker, etc. + update_id :: Int -- ^ The update's unique identifier. Update identifiers start from a certain positive number and increase sequentially. This ID becomes especially handy if you’re using 'setWebhooks', since it allows you to ignore repeated updates or to restore the correct update sequence, should they get out of order. + , message :: Maybe Message -- ^ New incoming message of any kind — text, photo, sticker, etc. + , inline_query :: Maybe InlineQuery -- ^ New incoming inline query + , chosen_inline_result :: Maybe ChosenInlineResult -- ^ The result of a inline query that was chosen by a user and sent to their chat partner } deriving (FromJSON, ToJSON, Show, Generic) -- | This object represents a point on the map.
src/Web/Telegram/API/Bot/Requests.hs view
@@ -19,8 +19,8 @@ , SendVoiceRequest (..) , SendLocationRequest (..) , SendChatActionRequest (..) - , ParseMode (..) , ChatAction (..) + , AnswerInlineQueryRequest (..) ) where import Data.Aeson @@ -32,16 +32,7 @@ import GHC.Generics import GHC.TypeLits import Web.Telegram.API.Bot.JsonExt - --- | Parse mode for text message -data ParseMode = Markdown deriving (Show, Generic) - -instance ToJSON ParseMode where - toJSON Markdown = "Markdown" - -instance FromJSON ParseMode where - parseJSON "Markdown" = pure $ Markdown - parseJSON _ = fail "Failed to parse ParseMode" +import Web.Telegram.API.Bot.Data -- | This object represents request for 'sendMessage' data SendMessageRequest = SendMessageRequest @@ -220,4 +211,20 @@ toJSON = toJsonDrop 7 instance FromJSON SendChatActionRequest where - parseJSON = parseJsonDrop 7+ parseJSON = parseJsonDrop 7 + + +data AnswerInlineQueryRequest = AnswerInlineQueryRequest + { + query_inline_query_id :: Text -- ^ Unique identifier for the answered query + , query_results :: [InlineQueryResult] -- ^ A JSON-serialized array of results for the inline query + , query_cache_time :: Maybe Int -- ^ The maximum amount of time in seconds that the result of the inline query may be cached on the server. Defaults to 300. + , query_is_personal :: Maybe Bool -- ^ Pass True, if results may be cached on the server side only for the user that sent the query. By default, results may be returned to any user who sends the same query + , query_next_offset :: Maybe Text -- ^ Pass the offset that a client should send in the next query with the same text to receive more results. Pass an empty string if there are no more results or if you don‘t support pagination. Offset length can’t exceed 64 bytes. + } deriving (Show, Generic) + +instance ToJSON AnswerInlineQueryRequest where + toJSON = toJsonDrop 6 + +instance FromJSON AnswerInlineQueryRequest where + parseJSON = parseJsonDrop 6
src/Web/Telegram/API/Bot/Responses.hs view
@@ -16,6 +16,7 @@ , FileResponse (..) , UserProfilePhotosResponse (..) , SetWebhookResponse (..) + , InlineQueryResponse (..) ) where import Data.Aeson @@ -68,7 +69,7 @@ -- | This object represents 'getUpdates' response data UpdatesResponse = UpdatesResponse { - update_result :: [Update ] + update_result :: [Update] } deriving (Show, Generic) instance ToJSON UpdatesResponse where @@ -111,4 +112,16 @@ toJSON = toJsonDrop 8 instance FromJSON SetWebhookResponse where - parseJSON = parseJsonDrop 8+ parseJSON = parseJsonDrop 8 + +-- | This object represents 'answerInlineQuery' response +data InlineQueryResponse = InlineQueryResponse + { + query_result :: Bool + } deriving (Show, Generic) + +instance ToJSON InlineQueryResponse where + toJSON = toJsonDrop 6 + +instance FromJSON InlineQueryResponse where + parseJSON = parseJsonDrop 6
telegram-api.cabal view
@@ -1,5 +1,5 @@ name: telegram-api -version: 0.1.0.1 +version: 0.2.0.0 synopsis: Telegram Bot API bindings description: High-level bindings to the Telegram Bot API homepage: http://github.com/klappvisor/haskell-telegram-api#readme
test/Spec.hs view
@@ -103,8 +103,7 @@ it "should get all messages" $ do Right UpdatesResponse { update_result = updates} <- getUpdates token Nothing Nothing Nothing - (length updates) `shouldSatisfy` (> 0) - ((message_id . message) (head updates)) `shouldSatisfy` (> 0) + (length updates) `shouldSatisfy` (>= 0) describe "/getFile" $ do it "should get file" $ do @@ -132,4 +131,49 @@ it "should remove webhook" $ do Right SetWebhookResponse { webhook_result = res } <- setWebhook token Nothing - res `shouldBe` True+ res `shouldBe` True + +-- describe "/answerInlineQuery" $ do +-- it "should answer with article" $ do +-- Right InlineQueryResponse { query_result = res } <- +-- answerInlineQuery token (AnswerInlineQueryRequest inline_query_id [inline_article] Nothing Nothing Nothing) +-- res `shouldBe` True +-- it "should answer with photo" $ do +-- --Right InlineQueryResponse { query_result = res } <- +-- e <- +-- answerInlineQuery token (AnswerInlineQueryRequest inline_query_id [inline_photo] Nothing Nothing Nothing) +-- --res `shouldBe` True +-- putStrLn (show e) +-- it "should answer with gif" $ do +-- --Right InlineQueryResponse { query_result = res } <- +-- e <- +-- answerInlineQuery token (AnswerInlineQueryRequest inline_query_id [inline_gif] Nothing Nothing Nothing) +-- --res `shouldBe` True +-- putStrLn (show e) +-- it "should answer with mpeg gif" $ do +-- --Right InlineQueryResponse { query_result = res } <- +-- e <- +-- answerInlineQuery token (AnswerInlineQueryRequest inline_query_id [inline_mpeg] Nothing Nothing Nothing) +-- --res `shouldBe` True +-- putStrLn (show e) +-- it "should answer with video" $ do +-- --Right InlineQueryResponse { query_result = res } <- +-- e <- +-- answerInlineQuery token (AnswerInlineQueryRequest inline_query_id [inline_video] Nothing Nothing Nothing) +-- --res `shouldBe` True +-- putStrLn (show e) +-- +-- describe "/answerInlineQuery" $ do +-- it "should get updates and answer" $ do +-- Right UpdatesResponse { update_result = updates} <- +-- getUpdates token Nothing Nothing Nothing +-- Update { inline_query = Just (InlineQuery { query_id = id } ) } <- pure (last updates) +-- e <- +-- answerInlineQuery token (AnswerInlineQueryRequest id [inline_video] Nothing Nothing Nothing) +-- putStrLn (show e) + +--inline_article = InlineQueryResultArticle "2131341" (Just "text article content") Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing +--inline_photo = InlineQueryResultPhoto "1430810" "http://vignette3.wikia.nocookie.net/victorious/images/f/f8/NyanCat.jpg" Nothing Nothing (Just "http://vignette3.wikia.nocookie.net/victorious/images/f/f8/NyanCat.jpg") Nothing Nothing Nothing Nothing Nothing Nothing +--inline_gif = InlineQueryResultGif "131231234" "https://media.giphy.com/media/zEO5eq3ZsEwbS/giphy.gif" Nothing Nothing (Just "https://media.giphy.com/media/zEO5eq3ZsEwbS/100.gif") Nothing Nothing Nothing Nothing Nothing +--inline_mpeg = InlineQueryResultMpeg4Gif "131251234" "https://media.giphy.com/media/zEO5eq3ZsEwbS/giphy.gif" Nothing Nothing (Just "https://media.giphy.com/media/zEO5eq3ZsEwbS/100.gif") Nothing Nothing Nothing Nothing Nothing +--inline_video = InlineQueryResultVideo "123413542" "https://www.youtube.com/embed/TBKN7_vx2xo" "text/html" (Just "Enjoykin — Nyash Myash") Nothing Nothing Nothing Nothing Nothing (Just "https://i.ytimg.com/vi_webp/TBKN7_vx2xo/mqdefault.webp") (Just "Enjoykin — Nyash Myash") Nothing