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

Support Bot API 6.8 #165

Merged
merged 1 commit into from
Jan 20, 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
15 changes: 15 additions & 0 deletions telegram-bot-api/src/Telegram/Bot/API/Forum.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions telegram-bot-api/src/Telegram/Bot/API/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
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 @@ -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=<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'.
Expand Down
2 changes: 2 additions & 0 deletions telegram-bot-api/src/Telegram/Bot/API/Types/Message.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion telegram-bot-api/src/Telegram/Bot/API/Types/PollAnswer.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down
17 changes: 17 additions & 0 deletions telegram-bot-api/src/Telegram/Bot/API/Types/Story.hs
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions telegram-bot-api/telegram-bot-api.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading