| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Telegram.Bot.API.Types
Contents
Synopsis
- newtype Seconds = Seconds Int32
- data User = User {}
- newtype UserId = UserId Int32
- data Chat = Chat {
- chatId :: ChatId
- chatType :: ChatType
- chatTitle :: Maybe Text
- chatUsername :: Maybe Text
- chatFirstName :: Maybe Text
- chatLastName :: Maybe Text
- chatAllMembersAreAdministrators :: Maybe Bool
- chatPhoto :: Maybe ChatPhoto
- chatDescription :: Maybe Text
- chatInviteLink :: Maybe Text
- chatPinnedMessage :: Maybe Message
- chatStickerSetName :: Maybe Text
- chatCanSetStickerSet :: Maybe Bool
- newtype ChatId = ChatId Integer
- data ChatType
- data Message = Message {
- messageMessageId :: MessageId
- messageFrom :: Maybe User
- messageDate :: POSIXTime
- messageChat :: Chat
- messageForwardFrom :: Maybe User
- messageForwardFromChat :: Maybe Chat
- messageForwardFromMessageId :: Maybe MessageId
- messageForwardSignature :: Maybe Text
- messageForwardDate :: Maybe POSIXTime
- messageReplyToMessage :: Maybe Message
- messageEditDate :: Maybe POSIXTime
- messageMediaGroupId :: Maybe MediaGroupId
- messageAuthorSignature :: Maybe Text
- messageText :: Maybe Text
- messageEntities :: Maybe [MessageEntity]
- messageCaptionEntities :: Maybe [MessageEntity]
- messageAudio :: Maybe Audio
- messageDocument :: Maybe Document
- messagePhoto :: Maybe [PhotoSize]
- messageVideo :: Maybe Video
- messageVoice :: Maybe Voice
- messageVideoNote :: Maybe VideoNote
- messageCaption :: Maybe Text
- messageContact :: Maybe Contact
- messageLocation :: Maybe Location
- messageVenue :: Maybe Venue
- messageNewChatMembers :: Maybe [User]
- messageLeftChatMember :: Maybe User
- messageNewChatTitle :: Maybe Text
- messageNewChatPhoto :: Maybe [PhotoSize]
- messageDeleteChatPhoto :: Maybe Bool
- messageGroupChatCreated :: Maybe Bool
- messageSupergroupChatCreated :: Maybe Bool
- messageChannelChatCreated :: Maybe Bool
- messageMigrateToChatId :: Maybe ChatId
- messageMigrateFromChatId :: Maybe ChatId
- messagePinnedMessage :: Maybe Message
- newtype MessageId = MessageId Int32
- newtype MediaGroupId = MediaGroupId Text
- data MessageEntity = MessageEntity {}
- data MessageEntityType
- data PhotoSize = PhotoSize {}
- newtype FileId = FileId Text
- data Audio = Audio {}
- data Document = Document {}
- data Video = Video {}
- data Voice = Voice {}
- data VideoNote = VideoNote {}
- data Contact = Contact {}
- data Location = Location {}
- data Venue = Venue {}
- data UserProfilePhotos = UserProfilePhotos {}
- data File = File {}
- data ReplyKeyboardMarkup = ReplyKeyboardMarkup {}
- data KeyboardButton = KeyboardButton {}
- data ReplyKeyboardRemove = ReplyKeyboardRemove {}
- data InlineKeyboardMarkup = InlineKeyboardMarkup {}
- data InlineKeyboardButton = InlineKeyboardButton {}
- labeledInlineKeyboardButton :: Text -> InlineKeyboardButton
- data CallbackQuery = CallbackQuery {}
- newtype CallbackQueryId = CallbackQueryId Text
- data ForceReply = ForceReply {}
- data ChatPhoto = ChatPhoto {}
- data ChatMember = ChatMember {
- chatMemberUser :: User
- chatMemberStatus :: Text
- chatMemberUntilDate :: Maybe POSIXTime
- chatMemberCanBeEdited :: Maybe Bool
- chatMemberCanChangeInfo :: Maybe Bool
- chatMemberCanPostMessages :: Maybe Bool
- chatMemberCanEditMessages :: Maybe Bool
- chatMemberCanDeleteMessages :: Maybe Bool
- chatMemberCanInviteUsers :: Maybe Bool
- chatMemberCanRestrictMembers :: Maybe Bool
- chatMemberCanPinMessages :: Maybe Bool
- chatMemberCanPromoteMembers :: Maybe Bool
- chatMemberCanSendMessages :: Maybe Bool
- chatMemberCanSendMediaMessages :: Maybe Bool
- chatMemberCanSendOtherMessages :: Maybe Bool
- chatMemberCanAddWebPagePreviews :: Maybe Bool
- data ResponseParameters = ResponseParameters {}
Documentation
Available types
User
This object represents a Telegram user or bot.
Constructors
| User | |
Fields
| |
Instances
| Show User # | |
| Generic User # | |
| ToJSON User # | |
Defined in Telegram.Bot.API.Types | |
| FromJSON User # | |
| type Rep User # | |
Defined in Telegram.Bot.API.Types type Rep User = D1 (MetaData "User" "Telegram.Bot.API.Types" "telegram-bot-simple-0.2.0-31t24Pyt0AQxG6B783GY3" False) (C1 (MetaCons "User" PrefixI True) ((S1 (MetaSel (Just "userId") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 UserId) :*: (S1 (MetaSel (Just "userIsBot") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Bool) :*: S1 (MetaSel (Just "userFirstName") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Text))) :*: (S1 (MetaSel (Just "userLastName") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe Text)) :*: (S1 (MetaSel (Just "userUsername") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe Text)) :*: S1 (MetaSel (Just "userLanguageCode") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe Text)))))) | |
Unique identifier for this user or bot.
Chat
This object represents a chat.
Constructors
| Chat | |
Fields
| |
Instances
Unique identifier for this chat.
Type of chat.
Instances
| Show ChatType # | |
| Generic ChatType # | |
| ToJSON ChatType # | |
Defined in Telegram.Bot.API.Types | |
| FromJSON ChatType # | |
| type Rep ChatType # | |
Defined in Telegram.Bot.API.Types type Rep ChatType = D1 (MetaData "ChatType" "Telegram.Bot.API.Types" "telegram-bot-simple-0.2.0-31t24Pyt0AQxG6B783GY3" False) ((C1 (MetaCons "ChatTypePrivate" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "ChatTypeGroup" PrefixI False) (U1 :: Type -> Type)) :+: (C1 (MetaCons "ChatTypeSupergroup" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "ChatTypeChannel" PrefixI False) (U1 :: Type -> Type))) | |
Message
This object represents a message.
Constructors
| Message | |
Fields
| |
Instances
Unique message identifier inside this chat.
newtype MediaGroupId #
The unique identifier of a media message group a message belongs to.
Constructors
| MediaGroupId Text |
Instances
| Eq MediaGroupId # | |
Defined in Telegram.Bot.API.Types | |
| Show MediaGroupId # | |
Defined in Telegram.Bot.API.Types Methods showsPrec :: Int -> MediaGroupId -> ShowS # show :: MediaGroupId -> String # showList :: [MediaGroupId] -> ShowS # | |
| ToJSON MediaGroupId # | |
Defined in Telegram.Bot.API.Types Methods toJSON :: MediaGroupId -> Value # toEncoding :: MediaGroupId -> Encoding # toJSONList :: [MediaGroupId] -> Value # toEncodingList :: [MediaGroupId] -> Encoding # | |
| FromJSON MediaGroupId # | |
Defined in Telegram.Bot.API.Types | |
MessageEntity
data MessageEntity #
This object represents one special entity in a text message. For example, hashtags, usernames, URLs, etc.
Constructors
| MessageEntity | |
Fields
| |
Instances
data MessageEntityType #
Type of the entity. Can be mention (@username), hashtag, bot_command, url, email, bold (bold text), italic (italic text), code (monowidth string), pre (monowidth block), text_link (for clickable text URLs), text_mention (for users without usernames)
Constructors
Instances
PhotoSize
This object represents one size of a photo or a file / sticker thumbnail.
Constructors
| PhotoSize | |
Fields
| |
Instances
| Show PhotoSize # | |
| Generic PhotoSize # | |
| ToJSON PhotoSize # | |
Defined in Telegram.Bot.API.Types | |
| FromJSON PhotoSize # | |
| type Rep PhotoSize # | |
Defined in Telegram.Bot.API.Types type Rep PhotoSize = D1 (MetaData "PhotoSize" "Telegram.Bot.API.Types" "telegram-bot-simple-0.2.0-31t24Pyt0AQxG6B783GY3" False) (C1 (MetaCons "PhotoSize" PrefixI True) ((S1 (MetaSel (Just "photoSizeFileId") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 FileId) :*: S1 (MetaSel (Just "photoSizeWidth") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Int32)) :*: (S1 (MetaSel (Just "photoSizeHeight") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Int32) :*: S1 (MetaSel (Just "photoSizeFileSize") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe Int32))))) | |
Unique identifier for this file.
Audio
This object represents an audio file to be treated as music by the Telegram clients.
Constructors
| Audio | |
Fields
| |
Instances
| Show Audio # | |
| Generic Audio # | |
| ToJSON Audio # | |
Defined in Telegram.Bot.API.Types | |
| FromJSON Audio # | |
| type Rep Audio # | |
Defined in Telegram.Bot.API.Types type Rep Audio = D1 (MetaData "Audio" "Telegram.Bot.API.Types" "telegram-bot-simple-0.2.0-31t24Pyt0AQxG6B783GY3" False) (C1 (MetaCons "Audio" PrefixI True) ((S1 (MetaSel (Just "audioFileId") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 FileId) :*: (S1 (MetaSel (Just "audioDuration") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Seconds) :*: S1 (MetaSel (Just "audioPerformer") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe Text)))) :*: (S1 (MetaSel (Just "audioTitle") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe Text)) :*: (S1 (MetaSel (Just "audioMimeType") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe Text)) :*: S1 (MetaSel (Just "audioFileSize") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe Int32)))))) | |
Document
This object represents a general file (as opposed to photos, voice messages and audio files).
Constructors
| Document | |
Fields
| |
Instances
| Show Document # | |
| Generic Document # | |
| ToJSON Document # | |
Defined in Telegram.Bot.API.Types | |
| FromJSON Document # | |
| type Rep Document # | |
Defined in Telegram.Bot.API.Types type Rep Document = D1 (MetaData "Document" "Telegram.Bot.API.Types" "telegram-bot-simple-0.2.0-31t24Pyt0AQxG6B783GY3" False) (C1 (MetaCons "Document" PrefixI True) ((S1 (MetaSel (Just "documentFileId") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 FileId) :*: S1 (MetaSel (Just "documentThumb") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe PhotoSize))) :*: (S1 (MetaSel (Just "documentFileName") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe Text)) :*: (S1 (MetaSel (Just "documentMimeType") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe Text)) :*: S1 (MetaSel (Just "documentFileSize") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe Int32)))))) | |
Video
This object represents a video file.
Constructors
| Video | |
Fields
| |
Instances
Voice
This object represents a voice note.
Constructors
| Voice | |
Fields
| |
Instances
| Show Voice # | |
| Generic Voice # | |
| ToJSON Voice # | |
Defined in Telegram.Bot.API.Types | |
| FromJSON Voice # | |
| type Rep Voice # | |
Defined in Telegram.Bot.API.Types type Rep Voice = D1 (MetaData "Voice" "Telegram.Bot.API.Types" "telegram-bot-simple-0.2.0-31t24Pyt0AQxG6B783GY3" False) (C1 (MetaCons "Voice" PrefixI True) ((S1 (MetaSel (Just "voiceFileId") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 FileId) :*: S1 (MetaSel (Just "voiceDuration") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Seconds)) :*: (S1 (MetaSel (Just "voiceMimeType") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe Text)) :*: S1 (MetaSel (Just "voiceFileSize") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe Int32))))) | |
VideoNote
This object represents a video message (available in Telegram apps as of v.4.0).
Constructors
| VideoNote | |
Fields
| |
Instances
| Show VideoNote # | |
| Generic VideoNote # | |
| ToJSON VideoNote # | |
Defined in Telegram.Bot.API.Types | |
| FromJSON VideoNote # | |
| type Rep VideoNote # | |
Defined in Telegram.Bot.API.Types type Rep VideoNote = D1 (MetaData "VideoNote" "Telegram.Bot.API.Types" "telegram-bot-simple-0.2.0-31t24Pyt0AQxG6B783GY3" False) (C1 (MetaCons "VideoNote" PrefixI True) ((S1 (MetaSel (Just "videoNoteFileId") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Text) :*: S1 (MetaSel (Just "videoNoteLength") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Int32)) :*: (S1 (MetaSel (Just "videoNoteDuration") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Seconds) :*: (S1 (MetaSel (Just "videoNoteThumb") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe PhotoSize)) :*: S1 (MetaSel (Just "videoNoteFileSize") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe Int32)))))) | |
Contact
This object represents a phone contact.
Constructors
| Contact | |
Fields
| |
Instances
| Show Contact # | |
| Generic Contact # | |
| ToJSON Contact # | |
Defined in Telegram.Bot.API.Types | |
| FromJSON Contact # | |
| type Rep Contact # | |
Defined in Telegram.Bot.API.Types type Rep Contact = D1 (MetaData "Contact" "Telegram.Bot.API.Types" "telegram-bot-simple-0.2.0-31t24Pyt0AQxG6B783GY3" False) (C1 (MetaCons "Contact" PrefixI True) ((S1 (MetaSel (Just "contactPhoneNumber") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Text) :*: S1 (MetaSel (Just "contactFirstName") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Text)) :*: (S1 (MetaSel (Just "contactLastName") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe Text)) :*: S1 (MetaSel (Just "contactUserId") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe UserId))))) | |
Location
This object represents a point on the map.
Constructors
| Location | |
Fields
| |
Instances
| Show Location # | |
| Generic Location # | |
| ToJSON Location # | |
Defined in Telegram.Bot.API.Types | |
| FromJSON Location # | |
| type Rep Location # | |
Defined in Telegram.Bot.API.Types type Rep Location = D1 (MetaData "Location" "Telegram.Bot.API.Types" "telegram-bot-simple-0.2.0-31t24Pyt0AQxG6B783GY3" False) (C1 (MetaCons "Location" PrefixI True) (S1 (MetaSel (Just "locationLongitude") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Float) :*: S1 (MetaSel (Just "locationLatitude") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Float))) | |
Venue
This object represents a venue.
Constructors
| Venue | |
Fields
| |
Instances
| Show Venue # | |
| Generic Venue # | |
| ToJSON Venue # | |
Defined in Telegram.Bot.API.Types | |
| FromJSON Venue # | |
| type Rep Venue # | |
Defined in Telegram.Bot.API.Types type Rep Venue = D1 (MetaData "Venue" "Telegram.Bot.API.Types" "telegram-bot-simple-0.2.0-31t24Pyt0AQxG6B783GY3" False) (C1 (MetaCons "Venue" PrefixI True) ((S1 (MetaSel (Just "venueLocation") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Location) :*: S1 (MetaSel (Just "venueTitle") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Text)) :*: (S1 (MetaSel (Just "venueAddress") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Text) :*: S1 (MetaSel (Just "venueFoursquareId") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe Text))))) | |
UserProfilePhotos
data UserProfilePhotos #
This object represent a user's profile pictures.
Constructors
| UserProfilePhotos | |
Fields
| |
Instances
File
This object represents a file ready to be downloaded.
The file can be downloaded via the link https://api.telegram.org/file/bot<token>/<file_path>.
It is guaranteed that the link will be valid for at least 1 hour.
When the link expires, a new one can be requested by calling getFile.
Constructors
| File | |
Fields
| |
Instances
| Show File # | |
| Generic File # | |
| ToJSON File # | |
Defined in Telegram.Bot.API.Types | |
| FromJSON File # | |
| type Rep File # | |
Defined in Telegram.Bot.API.Types type Rep File = D1 (MetaData "File" "Telegram.Bot.API.Types" "telegram-bot-simple-0.2.0-31t24Pyt0AQxG6B783GY3" False) (C1 (MetaCons "File" PrefixI True) (S1 (MetaSel (Just "fileFileId") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 FileId) :*: (S1 (MetaSel (Just "fileFileSize") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe Int32)) :*: S1 (MetaSel (Just "fileFilePath") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe Text))))) | |
ReplyKeyboardMarkup
data ReplyKeyboardMarkup #
This object represents a custom keyboard with reply options (see Introduction to bots for details and examples).
Constructors
| ReplyKeyboardMarkup | |
Fields
| |
Instances
KeyboardButton
data KeyboardButton #
This object represents one button of the reply keyboard. For simple text buttons String can be used instead of this object to specify text of the button. Optional fields are mutually exclusive.
Constructors
| KeyboardButton | |
Fields
| |
Instances
ReplyKeyboardRemove
data ReplyKeyboardRemove #
Upon receiving a message with this object, Telegram clients will remove the current custom keyboard and display the default letter-keyboard.
By default, custom keyboards are displayed until a new keyboard is sent by a bot.
An exception is made for one-time keyboards that are hidden immediately after
the user presses a button (see ReplyKeyboardMarkup).
Constructors
| ReplyKeyboardRemove | |
Fields
| |
Instances
InlineKeyboardMarkup
data InlineKeyboardMarkup #
This object represents an inline keyboard that appears right next to the message it belongs to.
Constructors
| InlineKeyboardMarkup | |
Fields
| |
Instances
InlineKeyboardButton
data InlineKeyboardButton #
This object represents one button of an inline keyboard. You must use exactly one of the optional fields.
Constructors
| InlineKeyboardButton | |
Fields
| |
Instances
CallbackQuery
data CallbackQuery #
This object represents an incoming callback query from a callback button
in an inline keyboard. If the button that originated the query was attached
to a message sent by the bot, the field message will be present.
If the button was attached to a message sent via the bot (in inline mode),
the field inline_message_id will be present.
Exactly one of the fields data or game_short_name will be present.
Constructors
| CallbackQuery | |
Fields
| |
Instances
newtype CallbackQueryId #
Constructors
| CallbackQueryId Text |
Instances
ForceReply
data ForceReply #
Upon receiving a message with this object, Telegram clients will display a reply interface to the user (act as if the user has selected the bot‘s message and tapped ’Reply'). This can be extremely useful if you want to create user-friendly step-by-step interfaces without having to sacrifice privacy mode.
Constructors
| ForceReply | |
Fields
| |
Instances
| Show ForceReply # | |
Defined in Telegram.Bot.API.Types Methods showsPrec :: Int -> ForceReply -> ShowS # show :: ForceReply -> String # showList :: [ForceReply] -> ShowS # | |
| Generic ForceReply # | |
Defined in Telegram.Bot.API.Types Associated Types type Rep ForceReply :: Type -> Type # | |
| ToJSON ForceReply # | |
Defined in Telegram.Bot.API.Types Methods toJSON :: ForceReply -> Value # toEncoding :: ForceReply -> Encoding # toJSONList :: [ForceReply] -> Value # toEncodingList :: [ForceReply] -> Encoding # | |
| FromJSON ForceReply # | |
Defined in Telegram.Bot.API.Types | |
| type Rep ForceReply # | |
Defined in Telegram.Bot.API.Types type Rep ForceReply = D1 (MetaData "ForceReply" "Telegram.Bot.API.Types" "telegram-bot-simple-0.2.0-31t24Pyt0AQxG6B783GY3" False) (C1 (MetaCons "ForceReply" PrefixI True) (S1 (MetaSel (Just "forceReplyForceReply") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Bool) :*: S1 (MetaSel (Just "forceReplySelective") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe Bool)))) | |
Chat photo
Chat photo. Returned only in getChat.
Constructors
| ChatPhoto | |
Fields
| |
Instances
| Show ChatPhoto # | |
| Generic ChatPhoto # | |
| ToJSON ChatPhoto # | |
Defined in Telegram.Bot.API.Types | |
| FromJSON ChatPhoto # | |
| type Rep ChatPhoto # | |
Defined in Telegram.Bot.API.Types type Rep ChatPhoto = D1 (MetaData "ChatPhoto" "Telegram.Bot.API.Types" "telegram-bot-simple-0.2.0-31t24Pyt0AQxG6B783GY3" False) (C1 (MetaCons "ChatPhoto" PrefixI True) (S1 (MetaSel (Just "chatPhotoSmallFileId") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 FileId) :*: S1 (MetaSel (Just "chatPhotoBigFileId") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 FileId))) | |
ChatMember
data ChatMember #
This object contains information about one member of a chat.
Constructors
| ChatMember | |
Fields
| |
Instances
ResponseParameters
data ResponseParameters #
Contains information about why a request was unsuccessful.
Constructors
| ResponseParameters | |
Fields
| |