Safe Haskell | None |
---|---|
Language | Haskell2010 |
- sendMessage :: Token -> SendMessageRequest -> Manager -> IO (Either ServantError MessageResponse)
- sendMessageM :: SendMessageRequest -> TelegramClient MessageResponse
- forwardMessage :: Token -> ForwardMessageRequest -> Manager -> IO (Either ServantError MessageResponse)
- forwardMessageM :: ForwardMessageRequest -> TelegramClient MessageResponse
- uploadPhoto :: Token -> SendPhotoRequest FileUpload -> Manager -> IO (Either ServantError MessageResponse)
- uploadPhotoM :: SendPhotoRequest FileUpload -> TelegramClient MessageResponse
- sendPhoto :: Token -> SendPhotoRequest Text -> Manager -> IO (Either ServantError MessageResponse)
- sendPhotoM :: SendPhotoRequest Text -> TelegramClient MessageResponse
- uploadAudio :: Token -> SendAudioRequest FileUpload -> Manager -> IO (Either ServantError MessageResponse)
- uploadAudioM :: SendAudioRequest FileUpload -> TelegramClient MessageResponse
- sendAudio :: Token -> SendAudioRequest Text -> Manager -> IO (Either ServantError MessageResponse)
- sendAudioM :: SendAudioRequest Text -> TelegramClient MessageResponse
- uploadDocument :: Token -> SendDocumentRequest FileUpload -> Manager -> IO (Either ServantError MessageResponse)
- uploadDocumentM :: SendDocumentRequest FileUpload -> TelegramClient MessageResponse
- sendDocument :: Token -> SendDocumentRequest Text -> Manager -> IO (Either ServantError MessageResponse)
- sendDocumentM :: SendDocumentRequest Text -> TelegramClient MessageResponse
- uploadSticker :: Token -> SendStickerRequest FileUpload -> Manager -> IO (Either ServantError MessageResponse)
- uploadStickerM :: SendStickerRequest FileUpload -> TelegramClient MessageResponse
- sendSticker :: Token -> SendStickerRequest Text -> Manager -> IO (Either ServantError MessageResponse)
- sendStickerM :: SendStickerRequest Text -> TelegramClient MessageResponse
- uploadVideo :: Token -> SendVideoRequest FileUpload -> Manager -> IO (Either ServantError MessageResponse)
- uploadVideoM :: SendVideoRequest FileUpload -> TelegramClient MessageResponse
- sendVideo :: Token -> SendVideoRequest Text -> Manager -> IO (Either ServantError MessageResponse)
- sendVideoM :: SendVideoRequest Text -> TelegramClient MessageResponse
- uploadVoice :: Token -> SendVoiceRequest FileUpload -> Manager -> IO (Either ServantError MessageResponse)
- uploadVoiceM :: SendVoiceRequest FileUpload -> TelegramClient MessageResponse
- sendVoice :: Token -> SendVoiceRequest Text -> Manager -> IO (Either ServantError MessageResponse)
- sendVoiceM :: SendVoiceRequest Text -> TelegramClient MessageResponse
- uploadVideoNote :: Token -> SendVideoNoteRequest FileUpload -> Manager -> IO (Either ServantError MessageResponse)
- uploadVideoNoteM :: SendVideoNoteRequest FileUpload -> TelegramClient MessageResponse
- sendVideoNote :: Token -> SendVideoNoteRequest Text -> Manager -> IO (Either ServantError MessageResponse)
- sendVideoNoteM :: SendVideoNoteRequest Text -> TelegramClient MessageResponse
- sendMediaGroupM :: SendMediaGroupRequest -> TelegramClient (Response [Message])
- sendLocation :: Token -> SendLocationRequest -> Manager -> IO (Either ServantError MessageResponse)
- sendLocationM :: SendLocationRequest -> TelegramClient MessageResponse
- sendVenue :: Token -> SendVenueRequest -> Manager -> IO (Either ServantError MessageResponse)
- sendVenueM :: SendVenueRequest -> TelegramClient MessageResponse
- sendContact :: Token -> SendContactRequest -> Manager -> IO (Either ServantError MessageResponse)
- sendContactM :: SendContactRequest -> TelegramClient MessageResponse
- sendChatAction :: Token -> SendChatActionRequest -> Manager -> IO (Either ServantError ChatActionResponse)
- sendChatActionM :: SendChatActionRequest -> TelegramClient ChatActionResponse
- sendGame :: Token -> SendGameRequest -> Manager -> IO (Either ServantError MessageResponse)
- sendGameM :: SendGameRequest -> TelegramClient MessageResponse
- type TelegramBotMessagesAPI = (TelegramToken :> ("sendMessage" :> (ReqBody '[JSON] SendMessageRequest :> Post '[JSON] MessageResponse))) :<|> ((TelegramToken :> ("forwardMessage" :> (ReqBody '[JSON] ForwardMessageRequest :> Post '[JSON] MessageResponse))) :<|> ((TelegramToken :> ("sendPhoto" :> (MultipartFormDataReqBody (SendPhotoRequest FileUpload) :> Post '[JSON] MessageResponse))) :<|> ((TelegramToken :> ("sendPhoto" :> (ReqBody '[JSON] (SendPhotoRequest Text) :> Post '[JSON] MessageResponse))) :<|> ((TelegramToken :> ("sendAudio" :> (MultipartFormDataReqBody (SendAudioRequest FileUpload) :> Post '[JSON] MessageResponse))) :<|> ((TelegramToken :> ("sendAudio" :> (ReqBody '[JSON] (SendAudioRequest Text) :> Post '[JSON] MessageResponse))) :<|> ((TelegramToken :> ("sendDocument" :> (MultipartFormDataReqBody (SendDocumentRequest FileUpload) :> Post '[JSON] MessageResponse))) :<|> ((TelegramToken :> ("sendDocument" :> (ReqBody '[JSON] (SendDocumentRequest Text) :> Post '[JSON] MessageResponse))) :<|> ((TelegramToken :> ("sendSticker" :> (MultipartFormDataReqBody (SendStickerRequest FileUpload) :> Post '[JSON] MessageResponse))) :<|> ((TelegramToken :> ("sendSticker" :> (ReqBody '[JSON] (SendStickerRequest Text) :> Post '[JSON] MessageResponse))) :<|> ((TelegramToken :> ("sendVideo" :> (MultipartFormDataReqBody (SendVideoRequest FileUpload) :> Post '[JSON] MessageResponse))) :<|> ((TelegramToken :> ("sendVideo" :> (ReqBody '[JSON] (SendVideoRequest Text) :> Post '[JSON] MessageResponse))) :<|> ((TelegramToken :> ("sendVoice" :> (MultipartFormDataReqBody (SendVoiceRequest FileUpload) :> Post '[JSON] MessageResponse))) :<|> ((TelegramToken :> ("sendVoice" :> (ReqBody '[JSON] (SendVoiceRequest Text) :> Post '[JSON] MessageResponse))) :<|> ((TelegramToken :> ("sendVideoNote" :> (MultipartFormDataReqBody (SendVideoNoteRequest FileUpload) :> Post '[JSON] MessageResponse))) :<|> ((TelegramToken :> ("sendVideoNote" :> (ReqBody '[JSON] (SendVideoNoteRequest Text) :> Post '[JSON] MessageResponse))) :<|> ((TelegramToken :> ("sendMediaGroup" :> (ReqBody '[JSON] SendMediaGroupRequest :> Post '[JSON] (Response [Message])))) :<|> ((TelegramToken :> ("sendLocation" :> (ReqBody '[JSON] SendLocationRequest :> Post '[JSON] MessageResponse))) :<|> ((TelegramToken :> ("sendVenue" :> (ReqBody '[JSON] SendVenueRequest :> Post '[JSON] MessageResponse))) :<|> ((TelegramToken :> ("sendContact" :> (ReqBody '[JSON] SendContactRequest :> Post '[JSON] MessageResponse))) :<|> ((TelegramToken :> ("sendChatAction" :> (ReqBody '[JSON] SendChatActionRequest :> Post '[JSON] ChatActionResponse))) :<|> (TelegramToken :> ("sendGame" :> (ReqBody '[JSON] SendGameRequest :> Post '[JSON] MessageResponse)))))))))))))))))))))))
- messagesApi :: Proxy TelegramBotMessagesAPI
Functions
sendMessage :: Token -> SendMessageRequest -> Manager -> IO (Either ServantError MessageResponse) Source #
Use this method to send text messages. On success, the sent Message
is returned.
forwardMessage :: Token -> ForwardMessageRequest -> Manager -> IO (Either ServantError MessageResponse) Source #
Use this method to forward messages of any kind. On success, the sent Message
is returned.
forwardMessageM :: ForwardMessageRequest -> TelegramClient MessageResponse Source #
See forwardMessage
uploadPhoto :: Token -> SendPhotoRequest FileUpload -> Manager -> IO (Either ServantError MessageResponse) Source #
Use this method to upload and send photos. On success, the sent Message
is returned.
uploadPhotoM :: SendPhotoRequest FileUpload -> TelegramClient MessageResponse Source #
See uploadPhoto
sendPhoto :: Token -> SendPhotoRequest Text -> Manager -> IO (Either ServantError MessageResponse) Source #
Use this method to send photos that have already been uploaded. On success, the sent Message
is returned.
uploadAudio :: Token -> SendAudioRequest FileUpload -> Manager -> IO (Either ServantError MessageResponse) Source #
Use this method to upload and send audio files, if you want Telegram clients to display them in the music player. Your audio must be in the .mp3 format. On success, the sent Message
is returned. Bots can currently send audio files of up to 50 MB in size, this limit may be changed in the future.
For backward compatibility, when the fields title and performer are both empty and the mime-type of the file to be sent is not _audio/mpeg_, the file will be sent as a playable voice message. For this to work, the audio must be in an .ogg file encoded with OPUS. This behavior will be phased out in the future. For sending voice messages, use the sendVoice
method instead.
uploadAudioM :: SendAudioRequest FileUpload -> TelegramClient MessageResponse Source #
See uploadAudio
sendAudio :: Token -> SendAudioRequest Text -> Manager -> IO (Either ServantError MessageResponse) Source #
Use this method to send audio files that are already on the Telegram servers, if you want Telegram clients to display them in the music player. Your audio must be in the .mp3 format. On success, the sent Message
is returned. Bots can currently send audio files of up to 50 MB in size, this limit may be changed in the future.
For backward compatibility, when the fields title and performer are both empty and the mime-type of the file to be sent is not _audio/mpeg_, the file will be sent as a playable voice message. For this to work, the audio must be in an .ogg file encoded with OPUS. This behavior will be phased out in the future. For sending voice messages, use the sendVoice
method instead.
uploadDocument :: Token -> SendDocumentRequest FileUpload -> Manager -> IO (Either ServantError MessageResponse) Source #
Use this method to upload and send general files. On success, the sent Message
is returned. Bots can currently send files of any type of up to 50 MB in size, this limit may be changed in the future.
uploadDocumentM :: SendDocumentRequest FileUpload -> TelegramClient MessageResponse Source #
See uploadDocument
sendDocument :: Token -> SendDocumentRequest Text -> Manager -> IO (Either ServantError MessageResponse) Source #
Use this method to send general files that have already been uploaded. On success, the sent Message
is returned. Bots can currently send files of any type of up to 50 MB in size, this limit may be changed in the future.
sendDocumentM :: SendDocumentRequest Text -> TelegramClient MessageResponse Source #
See sendDocument
uploadSticker :: Token -> SendStickerRequest FileUpload -> Manager -> IO (Either ServantError MessageResponse) Source #
Use this method to upload and send .webp stickers. On success, the sent Message
is returned.
uploadStickerM :: SendStickerRequest FileUpload -> TelegramClient MessageResponse Source #
See uploadSticker
sendSticker :: Token -> SendStickerRequest Text -> Manager -> IO (Either ServantError MessageResponse) Source #
Use this method to send .webp stickers that are already on the Telegram servers. On success, the sent Message
is returned.
uploadVideo :: Token -> SendVideoRequest FileUpload -> Manager -> IO (Either ServantError MessageResponse) Source #
uploadVideoM :: SendVideoRequest FileUpload -> TelegramClient MessageResponse Source #
See uploadVideo
sendVideo :: Token -> SendVideoRequest Text -> Manager -> IO (Either ServantError MessageResponse) Source #
uploadVoice :: Token -> SendVoiceRequest FileUpload -> Manager -> IO (Either ServantError MessageResponse) Source #
Use this method to upload and send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .ogg file encoded with OPUS (other formats may be sent as Audio
or Document
). On success, the sent Message
is returned. Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future.
uploadVoiceM :: SendVoiceRequest FileUpload -> TelegramClient MessageResponse Source #
See uploadVoice
sendVoice :: Token -> SendVoiceRequest Text -> Manager -> IO (Either ServantError MessageResponse) Source #
Use this method to send audio files that are already on the telegram server, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .ogg file encoded with OPUS (other formats may be sent as Audio
or Document
). On success, the sent Message
is returned. Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future.
uploadVideoNote :: Token -> SendVideoNoteRequest FileUpload -> Manager -> IO (Either ServantError MessageResponse) Source #
As of v.4.0, Telegram clients support rounded square mp4 videos of up to 1 minute long. Use this method to send video messages. On success, the sent Message is returned.
uploadVideoNoteM :: SendVideoNoteRequest FileUpload -> TelegramClient MessageResponse Source #
See uploadVideoNote
sendVideoNote :: Token -> SendVideoNoteRequest Text -> Manager -> IO (Either ServantError MessageResponse) Source #
As of v.4.0, Telegram clients support rounded square mp4 videos of up to 1 minute long. Use this method to send video messages. On success, the sent Message is returned.
sendLocation :: Token -> SendLocationRequest -> Manager -> IO (Either ServantError MessageResponse) Source #
Use this method to send point on the map. On success, the sent Message
is returned.
sendVenue :: Token -> SendVenueRequest -> Manager -> IO (Either ServantError MessageResponse) Source #
Use this method to send information about a venue. On success, the sent Message
is returned.
sendContact :: Token -> SendContactRequest -> Manager -> IO (Either ServantError MessageResponse) Source #
Use this method to send information about a venue. On success, the sent Message
is returned.
sendChatAction :: Token -> SendChatActionRequest -> Manager -> IO (Either ServantError ChatActionResponse) Source #
Use this method when you need to tell the user that something is happening on the bot's side. The status is set for 5 seconds or less (when a message arrives from your bot, Telegram clients clear its typing status).
sendChatActionM :: SendChatActionRequest -> TelegramClient ChatActionResponse Source #
See sendChatAction
sendGame :: Token -> SendGameRequest -> Manager -> IO (Either ServantError MessageResponse) Source #
Use this method to send a game. On success, the sent Message
is returned.
API
type TelegramBotMessagesAPI = (TelegramToken :> ("sendMessage" :> (ReqBody '[JSON] SendMessageRequest :> Post '[JSON] MessageResponse))) :<|> ((TelegramToken :> ("forwardMessage" :> (ReqBody '[JSON] ForwardMessageRequest :> Post '[JSON] MessageResponse))) :<|> ((TelegramToken :> ("sendPhoto" :> (MultipartFormDataReqBody (SendPhotoRequest FileUpload) :> Post '[JSON] MessageResponse))) :<|> ((TelegramToken :> ("sendPhoto" :> (ReqBody '[JSON] (SendPhotoRequest Text) :> Post '[JSON] MessageResponse))) :<|> ((TelegramToken :> ("sendAudio" :> (MultipartFormDataReqBody (SendAudioRequest FileUpload) :> Post '[JSON] MessageResponse))) :<|> ((TelegramToken :> ("sendAudio" :> (ReqBody '[JSON] (SendAudioRequest Text) :> Post '[JSON] MessageResponse))) :<|> ((TelegramToken :> ("sendDocument" :> (MultipartFormDataReqBody (SendDocumentRequest FileUpload) :> Post '[JSON] MessageResponse))) :<|> ((TelegramToken :> ("sendDocument" :> (ReqBody '[JSON] (SendDocumentRequest Text) :> Post '[JSON] MessageResponse))) :<|> ((TelegramToken :> ("sendSticker" :> (MultipartFormDataReqBody (SendStickerRequest FileUpload) :> Post '[JSON] MessageResponse))) :<|> ((TelegramToken :> ("sendSticker" :> (ReqBody '[JSON] (SendStickerRequest Text) :> Post '[JSON] MessageResponse))) :<|> ((TelegramToken :> ("sendVideo" :> (MultipartFormDataReqBody (SendVideoRequest FileUpload) :> Post '[JSON] MessageResponse))) :<|> ((TelegramToken :> ("sendVideo" :> (ReqBody '[JSON] (SendVideoRequest Text) :> Post '[JSON] MessageResponse))) :<|> ((TelegramToken :> ("sendVoice" :> (MultipartFormDataReqBody (SendVoiceRequest FileUpload) :> Post '[JSON] MessageResponse))) :<|> ((TelegramToken :> ("sendVoice" :> (ReqBody '[JSON] (SendVoiceRequest Text) :> Post '[JSON] MessageResponse))) :<|> ((TelegramToken :> ("sendVideoNote" :> (MultipartFormDataReqBody (SendVideoNoteRequest FileUpload) :> Post '[JSON] MessageResponse))) :<|> ((TelegramToken :> ("sendVideoNote" :> (ReqBody '[JSON] (SendVideoNoteRequest Text) :> Post '[JSON] MessageResponse))) :<|> ((TelegramToken :> ("sendMediaGroup" :> (ReqBody '[JSON] SendMediaGroupRequest :> Post '[JSON] (Response [Message])))) :<|> ((TelegramToken :> ("sendLocation" :> (ReqBody '[JSON] SendLocationRequest :> Post '[JSON] MessageResponse))) :<|> ((TelegramToken :> ("sendVenue" :> (ReqBody '[JSON] SendVenueRequest :> Post '[JSON] MessageResponse))) :<|> ((TelegramToken :> ("sendContact" :> (ReqBody '[JSON] SendContactRequest :> Post '[JSON] MessageResponse))) :<|> ((TelegramToken :> ("sendChatAction" :> (ReqBody '[JSON] SendChatActionRequest :> Post '[JSON] ChatActionResponse))) :<|> (TelegramToken :> ("sendGame" :> (ReqBody '[JSON] SendGameRequest :> Post '[JSON] MessageResponse))))))))))))))))))))))) Source #
Telegram Bot API
messagesApi :: Proxy TelegramBotMessagesAPI Source #
Proxy for Thelegram Bot API