Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use -Werror on CI (#188) #189

Merged
merged 1 commit into from
Jun 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ jobs:
key: ${{ runner.os }}-v2-${{ matrix.ghc }}-${{ github.run_id }}
restore-keys: ${{ runner.os }}-v2-${{ matrix.ghc }}-
- run: |
cabal build all -fexamples
cabal build all -fexamples --ghc-options=-Werror
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,9 @@ instance ToMultipart Tmp SendDocumentRequest where
= (FileData "file" (T.pack $ takeFileName path) ct path)
: maybe [] (\t -> [FileData "thumbnail" (T.pack $ takeFileName t) "image/jpeg" t]) sendDocumentThumbnail

DocumentFile path ct = sendDocumentDocument
(path, ct) = case sendDocumentDocument of
DocumentFile path' ct' -> (path', ct')
_ -> error "ToMultipart Tmp SendDocumentRequest: cannot use multipart for links or file ids"


instance ToJSON SendDocumentRequest where toJSON = gtoJSON
Expand Down
4 changes: 3 additions & 1 deletion telegram-bot-api/src/Telegram/Bot/API/Methods/SendPhoto.hs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,9 @@ instance ToMultipart Tmp SendPhotoRequest where
= (FileData "file" (T.pack $ takeFileName path) ct path)
: maybe [] (\t -> [FileData "thumb" (T.pack $ takeFileName t) "image/jpeg" t]) sendPhotoThumb

PhotoFile path ct = sendPhotoPhoto
(path, ct) = case sendPhotoPhoto of
PhotoFile path' ct' -> (path', ct')
_ -> error "ToMultipart Tmp SendPhotoRequest: cannot use multipart for links or file ids"

instance ToJSON SendPhotoRequest where toJSON = gtoJSON

Expand Down
4 changes: 2 additions & 2 deletions telegram-bot-simple/examples/EchoBot.hs
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ updateToAction update _
Just $ InlineEcho queryId msg
| isJust $ updateMessageSticker update = do
fileId <- stickerFileId <$> updateMessageSticker update
chatId <- updateChatId update
pure $ StickerEcho (InputFileId fileId) chatId
chatOfUser <- updateChatId update
pure $ StickerEcho (InputFileId fileId) chatOfUser
| otherwise = case updateMessageText update of
Just text -> Just (Echo text)
Nothing -> Nothing
Expand Down
4 changes: 2 additions & 2 deletions telegram-bot-simple/examples/EchoBotWebhook.hs
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ updateToAction update _
Just $ InlineEcho queryId msg
| isJust $ updateMessageSticker update = do
fileId <- stickerFileId <$> updateMessageSticker update
chatId <- updateChatId update
pure $ StickerEcho (InputFileId fileId) chatId
chatOfUser <- updateChatId update
pure $ StickerEcho (InputFileId fileId) chatOfUser
| otherwise = case updateMessageText update of
Just text -> Just (Echo text)
Nothing -> Nothing
Expand Down
7 changes: 5 additions & 2 deletions telegram-bot-simple/examples/GameBot.hs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,11 @@ handleAction BotSettings{..} action model = case action of
{ inlineQueryResultTitle = Just msg
, inlineQueryResultInputMessageContent = Just gameMsg
}
gameMsg = (defaultInputTextMessageContent gameMessageText) { inputMessageContentParseMode = Just "HTML" }
gameMsg = InputTextMessageContent
{ inputMessageContentMessageText = gameMessageText
, inputMessageContentParseMode = Just "HTML"
, inputMessageContentDisableWebPagePrefiew = Nothing
}
inlineQueryResult = InlineQueryResultGame
{ inlineQueryResultGameGeneric = genericResult
, inlineQueryResultGameGameShortName = gameName
Expand Down Expand Up @@ -737,4 +741,3 @@ renderAgainLink settings txt = do
H.div ! A.class_ "position-link" $ do
H.div ! A.class_ "qel-button text-button text-again-button"
$ toMarkup txt

1 change: 1 addition & 0 deletions telegram-bot-simple/src/Telegram/Bot/Simple/Reply.hs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ replyMessageToSendMessageRequest :: SomeChatId -> ReplyMessage -> SendMessageReq
replyMessageToSendMessageRequest someChatId ReplyMessage{..} = SendMessageRequest
{ sendMessageChatId = someChatId
, sendMessageBusinessConnectionId = Nothing
, sendMessageMessageEffectId = Nothing
, sendMessageMessageThreadId = replyMessageMessageThreadId
, sendMessageText = replyMessageText
, sendMessageParseMode = replyMessageParseMode
Expand Down
Loading