packages feed

telegram-bot-simple 0.3.1 → 0.3.2

raw patch · 3 files changed

+28/−2 lines, 3 files

Files

CHANGELOG.md view
@@ -1,3 +1,8 @@+0.3.2+---++- Implement forwardMessage API method (see [#35]( https://github.com/fizruk/telegram-bot-simple/pull/35 ));+- Add MarkdownV2 parse mode (see [#33]( https://github.com/fizruk/telegram-bot-simple/pull/33 )); 0.3.1 --- 
src/Telegram/Bot/API/Methods.hs view
@@ -60,6 +60,16 @@ sendMessage :: SendMessageRequest -> ClientM (Response Message) sendMessage = client (Proxy @SendMessage) +-- ** 'forwardMessage'+type ForwardMessage+  = "forwardMessage" :> ReqBody '[JSON] ForwardMessageRequest :> Post '[JSON] (Response Message)++-- | Use this method to forward messages of any kind.+-- On success, the sent 'Message' is returned.++forwardMessage :: ForwardMessageRequest -> ClientM (Response Message)+forwardMessage = client (Proxy @ForwardMessage)+ -- | Unique identifier for the target chat -- or username of the target channel (in the format @\@channelusername@). data SomeChatId@@ -86,6 +96,7 @@ data ParseMode   = Markdown   | HTML+  | MarkdownV2   deriving (Generic)  instance ToJSON   ParseMode@@ -105,8 +116,18 @@ instance ToJSON   SendMessageRequest where toJSON = gtoJSON instance FromJSON SendMessageRequest where parseJSON = gparseJSON --- ** 'sendMessage'+-- | Request parameters for 'forwardMessage'.+data ForwardMessageRequest = ForwardMessageRequest+  { forwardMessageChatId              :: SomeChatId -- ^ Unique identifier for the target chat or username of the target channel (in the format @\@channelusername).+  , forwardMessageFromChatId          :: SomeChatId -- ^ Unique identifier for the chat where the original message was sent (or channel username in the format @\@channelusername)+  , forwardMessageDisableNotification :: Maybe Bool -- ^ Sends the message silently. Users will receive a notification with no sound.+  , forwardMessageMessageId           :: MessageId -- ^ Message identifier in the chat specified in from_chat_id+  } deriving (Generic) +instance ToJSON   ForwardMessageRequest where toJSON = gtoJSON+instance FromJSON ForwardMessageRequest where parseJSON = gparseJSON++-- ** 'sendMessage' type SendDocumentContent   = "sendDocument"   :> MultipartForm Tmp SendDocumentRequest
telegram-bot-simple.cabal view
@@ -7,7 +7,7 @@ -- hash: 815631caa1274f24031eaa1ec3c4ea08c75d46b660a0b266eeea28b0f123c325  name:           telegram-bot-simple-version:        0.3.1+version:        0.3.2 synopsis:       Easy to use library for building Telegram bots. description:    Please see the README on Github at <https://github.com/fizruk/telegram-bot-simple#readme> category:       Web