Skip to content

Commit

Permalink
Merge pull request #157 from fetsh-edu/inline-mode
Browse files Browse the repository at this point in the history
Inline mode
  • Loading branch information
swamp-agr authored Jun 22, 2023
2 parents 23a580f + a74df3f commit 5fa96c4
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The supplementary materials for the workshop is available at https://github.com/

## Examples

See bot examples here: https://github.com/fizruk/telegram-bot-simple/tree/master/examples
See bot examples here: https://github.com/fizruk/telegram-bot-simple/tree/master/telegram-bot-simple/examples

Use `cabal build all -fexamples` to build it.
If you are building with stack then use `stack build --flag telegram-bot-simple:examples`.
Expand Down
6 changes: 5 additions & 1 deletion telegram-bot-api/src/Telegram/Bot/API/Internal/Utils.hs
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,13 @@ instance (GSomeJSON f, GSomeJSON g) => GSomeJSON (f :+: g) where
<|> R1 <$> gsomeParseJSON js

addJsonFields :: Value -> [Pair] -> Value
addJsonFields (Object obj) pairs = Object $ Map.union obj (Map.fromList pairs)
addJsonFields (Object obj) pairs = Object $ Map.union obj $ Map.fromList (filter (not . isNull) pairs)
addJsonFields x _ = x

isNull :: Pair -> Bool
isNull (_, Null) = True
isNull _ = False

addMultipartFields :: [Input] -> MultipartData tag -> MultipartData tag
addMultipartFields newFields (MultipartData currenFields files)
= MultipartData (newFields <> currenFields) files
1 change: 1 addition & 0 deletions telegram-bot-api/src/Telegram/Bot/API/Types/Chat.hs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ data ChatType
| ChatTypeGroup
| ChatTypeSupergroup
| ChatTypeChannel
| ChatTypeSender
deriving (Generic, Show)

instance ToJSON ChatType where
Expand Down
2 changes: 1 addition & 1 deletion telegram-bot-simple/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The supplementary materials for the workshop is available at https://github.com/

## Examples

See bot examples here: https://github.com/fizruk/telegram-bot-simple/tree/master/examples
See bot examples here: https://github.com/fizruk/telegram-bot-simple/tree/master/telegram-bot-simple/examples

Use `cabal build all -fexamples` to build it.
If you are building with stack then use `stack build --flag telegram-bot-simple:examples`.
Expand Down

0 comments on commit 5fa96c4

Please sign in to comment.