diff --git a/telegram-bot-api/src/Telegram/Bot/API/Forum.hs b/telegram-bot-api/src/Telegram/Bot/API/Forum.hs index 4978390..9e67ec3 100644 --- a/telegram-bot-api/src/Telegram/Bot/API/Forum.hs +++ b/telegram-bot-api/src/Telegram/Bot/API/Forum.hs @@ -152,6 +152,21 @@ type UnpinAllForumTopicMessages unpinAllForumTopicMessages :: UnpinAllForumTopicMessagesRequest -> ClientM (Response Bool) unpinAllForumTopicMessages = client (Proxy @UnpinAllForumTopicMessages) +-- ** 'unpinAllGeneralForumTopicMessages' + +type UnpinAllGeneralForumTopicMessages = "unpinAllGeneralForumTopicMessages" + :> RequiredQueryParam "chat_id" SomeChatId -- ^ Unique identifier for the target chat or username of the target @supergroup@ (in the format \@supergroupusername) + :> Post '[JSON] (Response Bool) + +-- | Use this method to clear the list of pinned messages +-- in a @General@ forum topic. The bot must be an administrator +-- in the chat for this to work and must have the 'can_pin_messages' administrator right +-- in the supergroup. Returns 'True' on success. +unpinAllGeneralForumTopicMessages :: SomeChatId -- ^ Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) + -> ClientM (Response Bool) +unpinAllGeneralForumTopicMessages = client (Proxy @UnpinAllGeneralForumTopicMessages) + + -- ** 'editGeneralForumTopic' data EditGeneralForumTopicRequest = EditGeneralForumTopicRequest diff --git a/telegram-bot-api/src/Telegram/Bot/API/Types.hs b/telegram-bot-api/src/Telegram/Bot/API/Types.hs index 2d0bf16..893aa80 100644 --- a/telegram-bot-api/src/Telegram/Bot/API/Types.hs +++ b/telegram-bot-api/src/Telegram/Bot/API/Types.hs @@ -83,6 +83,7 @@ module Telegram.Bot.API.Types , module Telegram.Bot.API.Types.ShippingOption , module Telegram.Bot.API.Types.ShippingQuery , module Telegram.Bot.API.Types.Sticker + , module Telegram.Bot.API.Types.Story , module Telegram.Bot.API.Types.SuccessfulPayment , module Telegram.Bot.API.Types.User , module Telegram.Bot.API.Types.UserProfilePhotos @@ -171,6 +172,7 @@ import Telegram.Bot.API.Types.ShippingAddress import Telegram.Bot.API.Types.ShippingOption import Telegram.Bot.API.Types.ShippingQuery import Telegram.Bot.API.Types.Sticker +import Telegram.Bot.API.Types.Story import Telegram.Bot.API.Types.SuccessfulPayment import Telegram.Bot.API.Types.User import Telegram.Bot.API.Types.UserProfilePhotos diff --git a/telegram-bot-api/src/Telegram/Bot/API/Types/Chat.hs b/telegram-bot-api/src/Telegram/Bot/API/Types/Chat.hs index a82a0b4..8b1afc4 100644 --- a/telegram-bot-api/src/Telegram/Bot/API/Types/Chat.hs +++ b/telegram-bot-api/src/Telegram/Bot/API/Types/Chat.hs @@ -29,6 +29,7 @@ data Chat = Chat , chatPhoto :: Maybe ChatPhoto -- ^ Chat photo. Returned only in getChat. , chatActiveUsernames :: Maybe Text -- ^ If non-empty, the list of all active chat usernames; for private chats, supergroups and channels. Returned only in 'getChat'. , chatEmojiStatusCustomEmojiId :: Maybe Text -- ^ Custom emoji identifier of emoji status of the other party in a private chat. Returned only in 'getChat'. + , chatEmojiStatusExpirationDate :: Maybe Int -- ^ Expiration date of the emoji status of the chat or the other party in a private chat, in Unix time, if any. Returned only in 'getChat'. , chatBio :: Maybe Text -- ^ Bio of the other party in a private chat. Returned only in `getChat`. , chatHasPrivateForwards :: Maybe Bool -- ^ 'True', if privacy settings of the other party in the private chat allows to use `tg://user?id=` links only in chats with the user. Returned only in getChat. , chatHasRestrictedVoiceAndVideoMessages :: Maybe Bool -- ^ 'True', if the privacy settings of the other party restrict sending voice and video note messages in the private chat. Returned only in 'getChat'. diff --git a/telegram-bot-api/src/Telegram/Bot/API/Types/Message.hs b/telegram-bot-api/src/Telegram/Bot/API/Types/Message.hs index cb7c3f6..ca732fa 100644 --- a/telegram-bot-api/src/Telegram/Bot/API/Types/Message.hs +++ b/telegram-bot-api/src/Telegram/Bot/API/Types/Message.hs @@ -29,6 +29,7 @@ import Telegram.Bot.API.Types.PhotoSize import Telegram.Bot.API.Types.Poll import Telegram.Bot.API.Types.ProximityAlertTriggered import Telegram.Bot.API.Types.Sticker +import Telegram.Bot.API.Types.Story import Telegram.Bot.API.Types.SuccessfulPayment import Telegram.Bot.API.Types.User import Telegram.Bot.API.Types.UserShared @@ -74,6 +75,7 @@ data Message = Message , messageDocument :: Maybe Document -- ^ Message is a general file, information about the file. , messagePhoto :: Maybe [PhotoSize] -- ^ Message is a photo, available sizes of the photo , messageSticker :: Maybe Sticker -- ^ Message is a sticker, information about the sticker + , messageStory :: Maybe Story -- ^ Message is a forwarded story. , messageVideo :: Maybe Video -- ^ Message is a video, information about the video , messageVideoNote :: Maybe VideoNote -- ^ Message is a video note, information about the video message , messageVoice :: Maybe Voice -- ^ Message is a voice message, information about the file diff --git a/telegram-bot-api/src/Telegram/Bot/API/Types/PollAnswer.hs b/telegram-bot-api/src/Telegram/Bot/API/Types/PollAnswer.hs index c17ef5b..dd3ffb7 100644 --- a/telegram-bot-api/src/Telegram/Bot/API/Types/PollAnswer.hs +++ b/telegram-bot-api/src/Telegram/Bot/API/Types/PollAnswer.hs @@ -4,6 +4,7 @@ module Telegram.Bot.API.Types.PollAnswer where import Data.Aeson (FromJSON (..), ToJSON (..)) import GHC.Generics (Generic) +import Telegram.Bot.API.Types.Chat import Telegram.Bot.API.Types.Common import Telegram.Bot.API.Types.User import Telegram.Bot.API.Internal.Utils @@ -13,7 +14,8 @@ import Telegram.Bot.API.Internal.Utils -- | This object represents an answer of a user in a non-anonymous poll. data PollAnswer = PollAnswer { pollAnswerPollId :: PollId -- ^ Unique poll identifier. - , pollAnswerUser :: User -- ^ The user, who changed the answer to the poll. + , pollAnswerVoterChat :: Maybe Chat -- ^ The chat that changed the answer to the poll, if the voter is anonymous. + , pollAnswerUser :: Maybe User -- ^ The user that changed the answer to the poll, if the voter isn't anonymous. For backward compatibility, the field user in such objects will contain the user @136817688@ (\@Channel_Bot). , pollAnswerOptionIds :: [Int] -- ^ 0-based identifiers of answer options, chosen by the user. May be empty if the user retracted their vote. } deriving (Generic, Show) diff --git a/telegram-bot-api/src/Telegram/Bot/API/Types/Story.hs b/telegram-bot-api/src/Telegram/Bot/API/Types/Story.hs new file mode 100644 index 0000000..7dfb475 --- /dev/null +++ b/telegram-bot-api/src/Telegram/Bot/API/Types/Story.hs @@ -0,0 +1,17 @@ +{-# LANGUAGE DeriveGeneric #-} +module Telegram.Bot.API.Types.Story where + +import Data.Aeson (FromJSON (..), ToJSON (..)) +import GHC.Generics (Generic) + +import Telegram.Bot.API.Internal.Utils + +-- ** 'Story' + +-- | This object represents a message about a forwarded story in the chat. Currently holds no information. + +data Story = Story + deriving (Generic, Show) + +instance ToJSON Story where toJSON = gtoJSON +instance FromJSON Story where parseJSON = gparseJSON diff --git a/telegram-bot-api/telegram-bot-api.cabal b/telegram-bot-api/telegram-bot-api.cabal index c2dba08..b0005ba 100644 --- a/telegram-bot-api/telegram-bot-api.cabal +++ b/telegram-bot-api/telegram-bot-api.cabal @@ -187,6 +187,7 @@ library Telegram.Bot.API.Types.ShippingQuery Telegram.Bot.API.Types.SomeReplyMarkup Telegram.Bot.API.Types.Sticker + Telegram.Bot.API.Types.Story Telegram.Bot.API.Types.SuccessfulPayment Telegram.Bot.API.Types.SwitchInlineQueryChosenChat Telegram.Bot.API.Types.User