-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #180 from fizruk/173-missing-update-types
Add missing update types
- Loading branch information
Showing
5 changed files
with
78 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
telegram-bot-api/src/Telegram/Bot/API/Types/BusinessConnection.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{-# LANGUAGE DeriveGeneric #-} | ||
module Telegram.Bot.API.Types.BusinessConnection where | ||
|
||
import Data.Aeson (FromJSON (..), ToJSON (..)) | ||
import Data.Text (Text) | ||
import Data.Time.Clock.POSIX (POSIXTime) | ||
import GHC.Generics (Generic) | ||
|
||
import Telegram.Bot.API.Types.Common | ||
import Telegram.Bot.API.Types.User | ||
import Telegram.Bot.API.Internal.Utils | ||
|
||
-- ** 'BusinessConnection' | ||
|
||
-- | Describes the connection of the bot with a business account. | ||
data BusinessConnection = BusinessConnection | ||
{ businessConnectionId :: Text -- ^ Unique identifier of the business connection. | ||
, businessConnectionUser :: User -- ^ Business account user that created the business connection. | ||
, businessConnectionUserChatId :: ChatId -- ^ Identifier of a private chat with the user who created the business connection. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier. | ||
, businessConnectionDate :: POSIXTime -- ^ Date the connection was established in Unix time. | ||
, businessConnectionCanReply :: Bool -- ^ 'True', if the bot can act on behalf of the business account in chats that were active in the last 24 hours. | ||
, businessConnectionIsEnabled :: Bool -- ^ 'True', if the connection is active. | ||
} | ||
deriving (Generic, Show) | ||
|
||
instance ToJSON BusinessConnection where toJSON = gtoJSON | ||
instance FromJSON BusinessConnection where parseJSON = gparseJSON |
23 changes: 23 additions & 0 deletions
23
telegram-bot-api/src/Telegram/Bot/API/Types/BusinessMessagesDeleted.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{-# LANGUAGE DeriveGeneric #-} | ||
module Telegram.Bot.API.Types.BusinessMessagesDeleted where | ||
|
||
import Data.Aeson (FromJSON (..), ToJSON (..)) | ||
import Data.Text (Text) | ||
import GHC.Generics (Generic) | ||
|
||
import Telegram.Bot.API.Types.Chat | ||
import Telegram.Bot.API.Types.Common | ||
import Telegram.Bot.API.Internal.Utils | ||
|
||
-- ** 'BusinessMessagesDeleted' | ||
|
||
-- | This object is received when messages are deleted from a connected business account. | ||
data BusinessMessagesDeleted = BusinessMessagesDeleted | ||
{ businessMessagesDeletedBusinessConnectionId :: Text -- ^ Unique identifier of the business connection. | ||
, businessMessagesDeletedChat :: Chat -- ^ Information about a chat in the business account. The bot may not have access to the chat or the corresponding user. | ||
, businessMessagesDeletedMessageIds :: [MessageId] -- ^ The list of identifiers of deleted messages in the chat of the business account. | ||
} | ||
deriving (Generic, Show) | ||
|
||
instance ToJSON BusinessMessagesDeleted where toJSON = gtoJSON | ||
instance FromJSON BusinessMessagesDeleted where parseJSON = gparseJSON |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters