| Safe Haskell | None | 
|---|---|
| Language | Haskell2010 | 
Telegram.Bot.API.Types
Contents
Synopsis
- type RequiredQueryParam = QueryParam' '[Required, Strict]
- 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- = MessageEntityMention
- | MessageEntityHashtag
- | MessageEntityBotCommand
- | MessageEntityUrl
- | MessageEntityEmail
- | MessageEntityBold
- | MessageEntityItalic
- | MessageEntityUnderline
- | MessageEntityStrikethrough
- | MessageEntityCode
- | MessageEntityPre
- | MessageEntityTextLink
- | MessageEntityTextMention
- | MessageEntityCashtag
- | MessageEntityPhoneNumber
 
- 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
type RequiredQueryParam = QueryParam' '[Required, Strict] Source #
Instances
| Eq Seconds Source # | |
| Num Seconds Source # | |
| Show Seconds Source # | |
| FromJSON Seconds Source # | |
| Defined in Telegram.Bot.API.Types | |
| ToJSON Seconds Source # | |
| Defined in Telegram.Bot.API.Types Methods toEncoding :: Seconds -> Encoding toJSONList :: [Seconds] -> Value toEncodingList :: [Seconds] -> Encoding | |
Available types
User
This object represents a Telegram user or bot.
Constructors
| User | |
| Fields 
 | |
Instances
Unique identifier for this user or bot.
Instances
| Eq UserId Source # | |
| Show UserId Source # | |
| FromJSON UserId Source # | |
| Defined in Telegram.Bot.API.Types | |
| ToJSON UserId Source # | |
| Defined in Telegram.Bot.API.Types Methods toEncoding :: UserId -> Encoding toJSONList :: [UserId] -> Value toEncodingList :: [UserId] -> Encoding | |
| ToHttpApiData UserId Source # | |
| Defined in Telegram.Bot.API.Types Methods toUrlPiece :: UserId -> Text toEncodedUrlPiece :: UserId -> Builder toHeader :: UserId -> ByteString toQueryParam :: UserId -> Text | |
Chat
This object represents a chat.
Constructors
| Chat | |
| Fields 
 | |
Instances
Unique identifier for this chat.
Instances
| Eq ChatId Source # | |
| Show ChatId Source # | |
| FromJSON ChatId Source # | |
| Defined in Telegram.Bot.API.Types | |
| ToJSON ChatId Source # | |
| Defined in Telegram.Bot.API.Types Methods toEncoding :: ChatId -> Encoding toJSONList :: [ChatId] -> Value toEncodingList :: [ChatId] -> Encoding | |
| Hashable ChatId Source # | |
| Defined in Telegram.Bot.API.Types | |
| ToHttpApiData ChatId Source # | |
| Defined in Telegram.Bot.API.Types Methods toUrlPiece :: ChatId -> Text toEncodedUrlPiece :: ChatId -> Builder toHeader :: ChatId -> ByteString toQueryParam :: ChatId -> Text | |
Type of chat.
Instances
| Show ChatType Source # | |
| Generic ChatType Source # | |
| FromJSON ChatType Source # | |
| Defined in Telegram.Bot.API.Types | |
| ToJSON ChatType Source # | |
| Defined in Telegram.Bot.API.Types Methods toEncoding :: ChatType -> Encoding toJSONList :: [ChatType] -> Value toEncodingList :: [ChatType] -> Encoding | |
| type Rep ChatType Source # | |
| Defined in Telegram.Bot.API.Types type Rep ChatType = D1 (MetaData "ChatType" "Telegram.Bot.API.Types" "telegram-bot-simple-0.3.0-inplace" 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.
Instances
| Eq MessageId Source # | |
| Show MessageId Source # | |
| FromJSON MessageId Source # | |
| Defined in Telegram.Bot.API.Types | |
| ToJSON MessageId Source # | |
| Defined in Telegram.Bot.API.Types Methods toEncoding :: MessageId -> Encoding toJSONList :: [MessageId] -> Value toEncodingList :: [MessageId] -> Encoding | |
| ToHttpApiData MessageId Source # | |
| Defined in Telegram.Bot.API.Types Methods toUrlPiece :: MessageId -> Text toEncodedUrlPiece :: MessageId -> Builder toHeader :: MessageId -> ByteString toQueryParam :: MessageId -> Text | |
newtype MediaGroupId Source #
The unique identifier of a media message group a message belongs to.
Constructors
| MediaGroupId Text | 
Instances
| Eq MediaGroupId Source # | |
| Defined in Telegram.Bot.API.Types | |
| Show MediaGroupId Source # | |
| Defined in Telegram.Bot.API.Types Methods showsPrec :: Int -> MediaGroupId -> ShowS # show :: MediaGroupId -> String # showList :: [MediaGroupId] -> ShowS # | |
| FromJSON MediaGroupId Source # | |
| Defined in Telegram.Bot.API.Types | |
| ToJSON MediaGroupId Source # | |
| Defined in Telegram.Bot.API.Types Methods toJSON :: MediaGroupId -> Value toEncoding :: MediaGroupId -> Encoding toJSONList :: [MediaGroupId] -> Value toEncodingList :: [MediaGroupId] -> Encoding | |
MessageEntity
data MessageEntity Source #
This object represents one special entity in a text message. For example, hashtags, usernames, URLs, etc.
Constructors
| MessageEntity | |
| Fields 
 | |
Instances
data MessageEntityType Source #
Type of the entity. Can be mention (@username), hashtag, bot_command, url, email, bold (bold text), italic (italic text), underline (underlined text), strikethrough, code (monowidth string), pre (monowidth block), text_link (for clickable text URLs), text_mention (for users without usernames), cashtag, phone_number
Constructors
Instances
PhotoSize
This object represents one size of a photo or a file / sticker thumbnail.
Constructors
| PhotoSize | |
| Fields 
 | |
Instances
| Show PhotoSize Source # | |
| Generic PhotoSize Source # | |
| FromJSON PhotoSize Source # | |
| Defined in Telegram.Bot.API.Types | |
| ToJSON PhotoSize Source # | |
| Defined in Telegram.Bot.API.Types Methods toEncoding :: PhotoSize -> Encoding toJSONList :: [PhotoSize] -> Value toEncodingList :: [PhotoSize] -> Encoding | |
| type Rep PhotoSize Source # | |
| Defined in Telegram.Bot.API.Types type Rep PhotoSize = D1 (MetaData "PhotoSize" "Telegram.Bot.API.Types" "telegram-bot-simple-0.3.0-inplace" 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.
Instances
| Eq FileId Source # | |
| Show FileId Source # | |
| FromJSON FileId Source # | |
| Defined in Telegram.Bot.API.Types | |
| ToJSON FileId Source # | |
| Defined in Telegram.Bot.API.Types Methods toEncoding :: FileId -> Encoding toJSONList :: [FileId] -> Value toEncodingList :: [FileId] -> Encoding | |
Audio
This object represents an audio file to be treated as music by the Telegram clients.
Constructors
| Audio | |
| Fields 
 | |
Instances
Document
This object represents a general file (as opposed to photos, voice messages and audio files).
Constructors
| Document | |
| Fields 
 | |
Instances
Video
This object represents a video file.
Constructors
| Video | |
| Fields 
 | |
Instances
Voice
This object represents a voice note.
Constructors
| Voice | |
| Fields 
 | |
Instances
| Show Voice Source # | |
| Generic Voice Source # | |
| FromJSON Voice Source # | |
| Defined in Telegram.Bot.API.Types | |
| ToJSON Voice Source # | |
| Defined in Telegram.Bot.API.Types Methods toEncoding :: Voice -> Encoding toJSONList :: [Voice] -> Value toEncodingList :: [Voice] -> Encoding | |
| type Rep Voice Source # | |
| Defined in Telegram.Bot.API.Types type Rep Voice = D1 (MetaData "Voice" "Telegram.Bot.API.Types" "telegram-bot-simple-0.3.0-inplace" 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
Contact
This object represents a phone contact.
Constructors
| Contact | |
| Fields 
 | |
Instances
| Show Contact Source # | |
| Generic Contact Source # | |
| FromJSON Contact Source # | |
| Defined in Telegram.Bot.API.Types | |
| ToJSON Contact Source # | |
| Defined in Telegram.Bot.API.Types Methods toEncoding :: Contact -> Encoding toJSONList :: [Contact] -> Value toEncodingList :: [Contact] -> Encoding | |
| type Rep Contact Source # | |
| Defined in Telegram.Bot.API.Types type Rep Contact = D1 (MetaData "Contact" "Telegram.Bot.API.Types" "telegram-bot-simple-0.3.0-inplace" 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 Source # | |
| Generic Location Source # | |
| FromJSON Location Source # | |
| Defined in Telegram.Bot.API.Types | |
| ToJSON Location Source # | |
| Defined in Telegram.Bot.API.Types Methods toEncoding :: Location -> Encoding toJSONList :: [Location] -> Value toEncodingList :: [Location] -> Encoding | |
| type Rep Location Source # | |
| Defined in Telegram.Bot.API.Types type Rep Location = D1 (MetaData "Location" "Telegram.Bot.API.Types" "telegram-bot-simple-0.3.0-inplace" 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 Source # | |
| Generic Venue Source # | |
| FromJSON Venue Source # | |
| Defined in Telegram.Bot.API.Types | |
| ToJSON Venue Source # | |
| Defined in Telegram.Bot.API.Types Methods toEncoding :: Venue -> Encoding toJSONList :: [Venue] -> Value toEncodingList :: [Venue] -> Encoding | |
| type Rep Venue Source # | |
| Defined in Telegram.Bot.API.Types type Rep Venue = D1 (MetaData "Venue" "Telegram.Bot.API.Types" "telegram-bot-simple-0.3.0-inplace" 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 Source #
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 Source # | |
| Generic File Source # | |
| FromJSON File Source # | |
| Defined in Telegram.Bot.API.Types | |
| ToJSON File Source # | |
| Defined in Telegram.Bot.API.Types Methods toEncoding :: File -> Encoding toJSONList :: [File] -> Value toEncodingList :: [File] -> Encoding | |
| type Rep File Source # | |
| Defined in Telegram.Bot.API.Types type Rep File = D1 (MetaData "File" "Telegram.Bot.API.Types" "telegram-bot-simple-0.3.0-inplace" 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 Source #
This object represents a custom keyboard with reply options (see Introduction to bots for details and examples).
Constructors
| ReplyKeyboardMarkup | |
| Fields 
 | |
Instances
KeyboardButton
data KeyboardButton Source #
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 Source #
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 Source #
This object represents an inline keyboard that appears right next to the message it belongs to.
Constructors
| InlineKeyboardMarkup | |
| Fields 
 | |
Instances
InlineKeyboardButton
data InlineKeyboardButton Source #
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 Source #
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 Source #
Constructors
| CallbackQueryId Text | 
Instances
ForceReply
data ForceReply Source #
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
Chat photo
Chat photo. Returned only in getChat.
Constructors
| ChatPhoto | |
| Fields 
 | |
Instances
| Show ChatPhoto Source # | |
| Generic ChatPhoto Source # | |
| FromJSON ChatPhoto Source # | |
| Defined in Telegram.Bot.API.Types | |
| ToJSON ChatPhoto Source # | |
| Defined in Telegram.Bot.API.Types Methods toEncoding :: ChatPhoto -> Encoding toJSONList :: [ChatPhoto] -> Value toEncodingList :: [ChatPhoto] -> Encoding | |
| type Rep ChatPhoto Source # | |
| Defined in Telegram.Bot.API.Types type Rep ChatPhoto = D1 (MetaData "ChatPhoto" "Telegram.Bot.API.Types" "telegram-bot-simple-0.3.0-inplace" 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 Source #
This object contains information about one member of a chat.
Constructors
| ChatMember | |
| Fields 
 | |
Instances
ResponseParameters
data ResponseParameters Source #
Contains information about why a request was unsuccessful.
Constructors
| ResponseParameters | |
| Fields 
 | |