telegram-bot-simple-0.5.2: Easy to use library for building Telegram bots.
Safe HaskellNone
LanguageHaskell2010

Telegram.Bot.API.InlineMode

Synopsis

Available types

User

data InlineQuery Source #

This object represents an incoming inline query. When the user sends an empty query, your bot could return some default or trending results.

https://core.telegram.org/bots/api#inline-mode

Constructors

InlineQuery 

Fields

Instances

Instances details
Show InlineQuery Source # 
Instance details

Defined in Telegram.Bot.API.InlineMode

Generic InlineQuery Source # 
Instance details

Defined in Telegram.Bot.API.InlineMode

Associated Types

type Rep InlineQuery :: Type -> Type #

FromJSON InlineQuery Source # 
Instance details

Defined in Telegram.Bot.API.InlineMode

Methods

parseJSON :: Value -> Parser InlineQuery

parseJSONList :: Value -> Parser [InlineQuery]

ToJSON InlineQuery Source # 
Instance details

Defined in Telegram.Bot.API.InlineMode

Methods

toJSON :: InlineQuery -> Value

toEncoding :: InlineQuery -> Encoding

toJSONList :: [InlineQuery] -> Value

toEncodingList :: [InlineQuery] -> Encoding

type Rep InlineQuery Source # 
Instance details

Defined in Telegram.Bot.API.InlineMode

type Rep InlineQuery = D1 ('MetaData "InlineQuery" "Telegram.Bot.API.InlineMode" "telegram-bot-simple-0.5.2-inplace" 'False) (C1 ('MetaCons "InlineQuery" 'PrefixI 'True) ((S1 ('MetaSel ('Just "inlineQueryId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 InlineQueryId) :*: (S1 ('MetaSel ('Just "inlineQueryFrom") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 User) :*: S1 ('MetaSel ('Just "inlineQueryLocation") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Location)))) :*: (S1 ('MetaSel ('Just "inlineQueryQuery") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: (S1 ('MetaSel ('Just "inlineQueryOffset") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "inlineQueryChatType") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe ChatType))))))

newtype InlineQueryId Source #

Unique identifier for this query

Constructors

InlineQueryId Text 

Instances

Instances details
Eq InlineQueryId Source # 
Instance details

Defined in Telegram.Bot.API.InlineMode

Show InlineQueryId Source # 
Instance details

Defined in Telegram.Bot.API.InlineMode

Generic InlineQueryId Source # 
Instance details

Defined in Telegram.Bot.API.InlineMode

Associated Types

type Rep InlineQueryId :: Type -> Type #

FromJSON InlineQueryId Source # 
Instance details

Defined in Telegram.Bot.API.InlineMode

Methods

parseJSON :: Value -> Parser InlineQueryId

parseJSONList :: Value -> Parser [InlineQueryId]

ToJSON InlineQueryId Source # 
Instance details

Defined in Telegram.Bot.API.InlineMode

Methods

toJSON :: InlineQueryId -> Value

toEncoding :: InlineQueryId -> Encoding

toJSONList :: [InlineQueryId] -> Value

toEncodingList :: [InlineQueryId] -> Encoding

Hashable InlineQueryId Source # 
Instance details

Defined in Telegram.Bot.API.InlineMode

type Rep InlineQueryId Source # 
Instance details

Defined in Telegram.Bot.API.InlineMode

type Rep InlineQueryId = D1 ('MetaData "InlineQueryId" "Telegram.Bot.API.InlineMode" "telegram-bot-simple-0.5.2-inplace" 'True) (C1 ('MetaCons "InlineQueryId" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))

Available methods

answerInlineQuery

type AnswerInlineQuery = "answerInlineQuery" :> (ReqBody '[JSON] AnswerInlineQueryRequest :> Post '[JSON] (Response Bool)) Source #

data AnswerInlineQueryRequest Source #

Constructors

AnswerInlineQueryRequest 

Fields

  • answerInlineQueryRequestInlineQueryId :: InlineQueryId

    Unique identifier for the answered query.

  • answerInlineQueryRequestResults :: [InlineQueryResult]

    A JSON-serialized array of results for the inline query.

  • answerInlineQueryCacheTime :: Maybe Seconds

    The maximum amount of time in seconds that the result of the inline query may be cached on the server. Defaults to 300.

  • answerInlineQueryIsPersonal :: Maybe Bool

    Pass True, if results may be cached on the server side only for the user that sent the query. By default, results may be returned to any user who sends the same query.

  • answerInlineQueryNextOffset :: Maybe Text

    Pass the offset that a client should send in the next query with the same text to receive more results. Pass an empty string if there are no more results or if you don't support pagination. Offset length can't exceed 64 bytes.

  • answerInlineQuerySwitchPmText :: Maybe Text

    If passed, clients will display a button with specified text that switches the user to a private chat with the bot and sends the bot a start message with the parameter switch_pm_parameter.

  • answerInlineQuerySwitchPmParameter :: Maybe Text

    Deep-linking parameter for the /start message sent to the bot when user presses the switch button. 1-64 characters, only A-Z, a-z, 0-9, _ and - are allowed.

    Example: An inline bot that sends YouTube videos can ask the user to connect the bot to their YouTube account to adapt search results accordingly. To do this, it displays a 'Connect your YouTube account' button above the results, or even before showing any. The user presses the button, switches to a private chat with the bot and, in doing so, passes a start parameter that instructs the bot to return an OAuth link. Once done, the bot can offer a switch_inline button so that the user can easily return to the chat where they wanted to use the bot's inline capabilities.

Instances

Instances details
Generic AnswerInlineQueryRequest Source # 
Instance details

Defined in Telegram.Bot.API.InlineMode

Associated Types

type Rep AnswerInlineQueryRequest :: Type -> Type #

FromJSON AnswerInlineQueryRequest Source # 
Instance details

Defined in Telegram.Bot.API.InlineMode

Methods

parseJSON :: Value -> Parser AnswerInlineQueryRequest

parseJSONList :: Value -> Parser [AnswerInlineQueryRequest]

ToJSON AnswerInlineQueryRequest Source # 
Instance details

Defined in Telegram.Bot.API.InlineMode

type Rep AnswerInlineQueryRequest Source # 
Instance details

Defined in Telegram.Bot.API.InlineMode

type Rep AnswerInlineQueryRequest = D1 ('MetaData "AnswerInlineQueryRequest" "Telegram.Bot.API.InlineMode" "telegram-bot-simple-0.5.2-inplace" 'False) (C1 ('MetaCons "AnswerInlineQueryRequest" 'PrefixI 'True) ((S1 ('MetaSel ('Just "answerInlineQueryRequestInlineQueryId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 InlineQueryId) :*: (S1 ('MetaSel ('Just "answerInlineQueryRequestResults") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [InlineQueryResult]) :*: S1 ('MetaSel ('Just "answerInlineQueryCacheTime") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Seconds)))) :*: ((S1 ('MetaSel ('Just "answerInlineQueryIsPersonal") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Bool)) :*: S1 ('MetaSel ('Just "answerInlineQueryNextOffset") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text))) :*: (S1 ('MetaSel ('Just "answerInlineQuerySwitchPmText") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "answerInlineQuerySwitchPmParameter") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text))))))

data ChosenInlineResult Source #

Constructors

ChosenInlineResult 

Fields

Instances

Instances details
Show ChosenInlineResult Source # 
Instance details

Defined in Telegram.Bot.API.InlineMode

Generic ChosenInlineResult Source # 
Instance details

Defined in Telegram.Bot.API.InlineMode

Associated Types

type Rep ChosenInlineResult :: Type -> Type #

FromJSON ChosenInlineResult Source # 
Instance details

Defined in Telegram.Bot.API.InlineMode

Methods

parseJSON :: Value -> Parser ChosenInlineResult

parseJSONList :: Value -> Parser [ChosenInlineResult]

ToJSON ChosenInlineResult Source # 
Instance details

Defined in Telegram.Bot.API.InlineMode

type Rep ChosenInlineResult Source # 
Instance details

Defined in Telegram.Bot.API.InlineMode

type Rep ChosenInlineResult = D1 ('MetaData "ChosenInlineResult" "Telegram.Bot.API.InlineMode" "telegram-bot-simple-0.5.2-inplace" 'False) (C1 ('MetaCons "ChosenInlineResult" 'PrefixI 'True) ((S1 ('MetaSel ('Just "chosenInlineResultResultId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 InlineQueryResultId) :*: S1 ('MetaSel ('Just "chosenInlineResultFrom") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 User)) :*: (S1 ('MetaSel ('Just "chosenInlineResultLocation") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Location)) :*: (S1 ('MetaSel ('Just "chosenInlineResultInlineMessageId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe MessageId)) :*: S1 ('MetaSel ('Just "chosenInlineResultQuery") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 InlineQueryId)))))