-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Easy to use library for building Telegram bots. -- -- Please see the README on Github at -- https://github.com/fizruk/telegram-bot-simple#readme @package telegram-bot-simple @version 0.13 module Telegram.Bot.Simple.Eff -- | Bot handler context. -- -- The context may include an Update the bot is handling at the -- moment. newtype BotM a BotM :: ReaderT BotContext ClientM a -> BotM a [_runBotM] :: BotM a -> ReaderT BotContext ClientM a data BotContext BotContext :: User -> Maybe Update -> BotContext [botContextUser] :: BotContext -> User [botContextUpdate] :: BotContext -> Maybe Update liftClientM :: ClientM a -> BotM a runBotM :: BotContext -> BotM a -> ClientM a newtype Eff action model Eff :: Writer [BotM (Maybe action)] model -> Eff action model [_runEff] :: Eff action model -> Writer [BotM (Maybe action)] model -- | The idea behind following type class is to allow you defining the type -- ret you want to return from BotM action. You can -- create your own return-types via new instances. Here action -- is a botAction type, that will be used further in -- botHandler function. If you don't want to return action use -- Nothing instead. -- -- See Telegram.Bot.Simple.Instances for more commonly useful -- instances. - GetAction a a - for simple making finite -- automata of BotM actions. (For example you can log every update and -- then return new action to answer at messagesend -- stickeretc) - GetAction () a - to use pure () -- instead of dealing with Nothing. - GetAction Text a -- - to add some sugar over the replyText function. -- OverloadedStrings breaks type inference, so we advise to use -- replyText "message" instead of pure @_ @Text -- "message". class GetAction return action getNextAction :: GetAction return action => BotM return -> BotM (Maybe action) runEff :: Eff action model -> (model, [BotM (Maybe action)]) eff :: GetAction a b => BotM a -> Eff b () withEffect :: GetAction a action => BotM a -> model -> Eff action model (<#) :: GetAction a action => model -> BotM a -> Eff action model -- | Set a specific Update in a BotM context. setBotMUpdate :: Maybe Update -> BotM a -> BotM a -- | Set a specific Update in every effect of Eff context. setEffUpdate :: Maybe Update -> Eff action model -> Eff action model instance Control.Monad.IO.Class.MonadIO Telegram.Bot.Simple.Eff.BotM instance Control.Monad.Reader.Class.MonadReader Telegram.Bot.Simple.Eff.BotContext Telegram.Bot.Simple.Eff.BotM instance GHC.Base.Monad Telegram.Bot.Simple.Eff.BotM instance GHC.Base.Applicative Telegram.Bot.Simple.Eff.BotM instance GHC.Base.Functor Telegram.Bot.Simple.Eff.BotM instance GHC.Base.Monad (Telegram.Bot.Simple.Eff.Eff action) instance GHC.Base.Applicative (Telegram.Bot.Simple.Eff.Eff action) instance GHC.Base.Functor (Telegram.Bot.Simple.Eff.Eff action) instance Data.Bifunctor.Bifunctor Telegram.Bot.Simple.Eff.Eff module Telegram.Bot.Simple.BotApp.Internal -- | A bot application. data BotApp model action BotApp :: model -> (Update -> model -> Maybe action) -> (action -> model -> Eff action model) -> [BotJob model action] -> BotApp model action -- | Initial bot state. [botInitialModel] :: BotApp model action -> model -- | How to convert incoming Updates into actions. See -- Telegram.Bot.Simple.UpdateParser for some helpers. [botAction] :: BotApp model action -> Update -> model -> Maybe action -- | How to handle actions. [botHandler] :: BotApp model action -> action -> model -> Eff action model -- | Background bot jobs. [botJobs] :: BotApp model action -> [BotJob model action] -- | A background bot job. data BotJob model action BotJob :: Text -> (model -> Eff action model) -> BotJob model action -- | Cron schedule for the job. [botJobSchedule] :: BotJob model action -> Text -- | Job function. [botJobTask] :: BotJob model action -> model -> Eff action model -- | An environment actual bot runs in. data BotEnv model action BotEnv :: TVar model -> TQueue (Maybe Update, action) -> ClientEnv -> User -> BotEnv model action -- | A transactional variable with bot's current state. [botModelVar] :: BotEnv model action -> TVar model -- | A queue of actions to process (with associated -- Updates). [botActionsQueue] :: BotEnv model action -> TQueue (Maybe Update, action) -- | HTTP client environment (where and how exactly to make requests to -- Telegram Bot API). This includes Token. [botClientEnv] :: BotEnv model action -> ClientEnv -- | Information about the bot in the form of User. [botUser] :: BotEnv model action -> User -- | Run bot job task once. runJobTask :: BotEnv model action -> (model -> Eff action model) -> IO () -- | Schedule a cron-like bot job. scheduleBotJob :: BotEnv model action -> BotJob model action -> IO [ThreadId] -- | Schedule all bot jobs. scheduleBotJobs :: BotEnv model action -> [BotJob model action] -> IO [ThreadId] -- | Construct a default BotEnv model action for a bot. defaultBotEnv :: BotApp model action -> ClientEnv -> IO (BotEnv model action) -- | Issue a new action for the bot to process. issueAction :: BotEnv model action -> Maybe Update -> Maybe action -> IO () -- | Process one action. processAction :: BotApp model action -> BotEnv model action -> Maybe Update -> action -> ClientM () -- | A job to wait for the next action and process it. processActionJob :: BotApp model action -> BotEnv model action -> ClientM () -- | Process incoming actions indefinitely. processActionsIndefinitely :: BotApp model action -> BotEnv model action -> IO ThreadId -- | Start Update polling for a bot. startBotPolling :: BotApp model action -> BotEnv model action -> ClientM () -- | Start Update polling with a given update handler. startPolling :: (Update -> ClientM a) -> ClientM a -- | Instead of forkIO which hides exceptions, allow users to -- handle those exceptions separately. -- -- See https://github.com/fizruk/telegram-bot-simple/issues/159. asyncLink :: IO a -> IO (Async a) instance GHC.Base.Functor (Telegram.Bot.Simple.BotApp.Internal.BotJob model) module Telegram.Bot.Simple.InlineKeyboard urlButton :: Text -> Text -> InlineKeyboardButton callbackButton :: Text -> Text -> InlineKeyboardButton actionButton :: Show action => Text -> action -> InlineKeyboardButton module Telegram.Bot.Simple.RunTG -- | The most preferrable way to run telegram requests. -- -- E.g. instead of invoking liftClientM $ methodName -- MethodNameRequest {..}, you just need to specify runTG $ -- defMethodName params. See examples for more details. class RunTG a b | a -> b runTG :: RunTG a b => a -> BotM b instance Telegram.Bot.Simple.RunTG.RunTG (Servant.Client.Internal.HttpClient.ClientM (Telegram.Bot.API.MakingRequests.Response a)) (Telegram.Bot.API.MakingRequests.Response a) instance Telegram.Bot.Simple.RunTG.RunTG Telegram.Bot.API.InlineMode.AnswerInlineQueryRequest (Telegram.Bot.API.MakingRequests.Response GHC.Types.Bool) instance Telegram.Bot.Simple.RunTG.RunTG Telegram.Bot.API.WebApps.AnswerWebAppQueryRequest (Telegram.Bot.API.MakingRequests.Response Telegram.Bot.API.WebApps.SentWebAppMessage) instance Telegram.Bot.Simple.RunTG.RunTG Telegram.Bot.API.Payments.SendInvoiceRequest (Telegram.Bot.API.MakingRequests.Response Telegram.Bot.API.Types.Message.Message) instance Telegram.Bot.Simple.RunTG.RunTG Telegram.Bot.API.Payments.CreateInvoiceLinkRequest (Telegram.Bot.API.MakingRequests.Response Data.Text.Internal.Text) instance Telegram.Bot.Simple.RunTG.RunTG Telegram.Bot.API.Payments.AnswerShippingQueryRequest (Telegram.Bot.API.MakingRequests.Response GHC.Types.Bool) instance Telegram.Bot.Simple.RunTG.RunTG Telegram.Bot.API.Payments.AnswerPreCheckoutQueryRequest (Telegram.Bot.API.MakingRequests.Response GHC.Types.Bool) instance Telegram.Bot.Simple.RunTG.RunTG Telegram.Bot.API.GettingUpdates.GetUpdatesRequest (Telegram.Bot.API.MakingRequests.Response [Telegram.Bot.API.GettingUpdates.Update]) instance Telegram.Bot.Simple.RunTG.RunTG Telegram.Bot.API.Games.SendGameRequest (Telegram.Bot.API.MakingRequests.Response Telegram.Bot.API.Types.Message.Message) instance Telegram.Bot.Simple.RunTG.RunTG Telegram.Bot.API.Games.SetGameScoreRequest (Telegram.Bot.API.MakingRequests.Response Telegram.Bot.API.Games.SetGameScoreResult) instance Telegram.Bot.Simple.RunTG.RunTG Telegram.Bot.API.Stickers.SendStickerRequest (Telegram.Bot.API.MakingRequests.Response Telegram.Bot.API.Types.Message.Message) instance Telegram.Bot.Simple.RunTG.RunTG Telegram.Bot.API.Stickers.UploadStickerFileRequest (Telegram.Bot.API.MakingRequests.Response Telegram.Bot.API.Types.File.File) instance Telegram.Bot.Simple.RunTG.RunTG Telegram.Bot.API.Stickers.CreateNewStickerSetRequest (Telegram.Bot.API.MakingRequests.Response GHC.Types.Bool) instance Telegram.Bot.Simple.RunTG.RunTG Telegram.Bot.API.Stickers.AddStickerToSetRequest (Telegram.Bot.API.MakingRequests.Response GHC.Types.Bool) instance Telegram.Bot.Simple.RunTG.RunTG Telegram.Bot.API.Stickers.SetStickerSetThumbnailRequest (Telegram.Bot.API.MakingRequests.Response GHC.Types.Bool) instance Telegram.Bot.Simple.RunTG.RunTG Telegram.Bot.API.UpdatingMessages.EditMessageTextRequest (Telegram.Bot.API.MakingRequests.Response Telegram.Bot.API.UpdatingMessages.EditMessageResponse) instance Telegram.Bot.Simple.RunTG.RunTG Telegram.Bot.API.UpdatingMessages.EditMessageCaptionRequest (Telegram.Bot.API.MakingRequests.Response Telegram.Bot.API.UpdatingMessages.EditMessageResponse) instance Telegram.Bot.Simple.RunTG.RunTG Telegram.Bot.API.UpdatingMessages.EditMessageMediaRequest (Telegram.Bot.API.MakingRequests.Response Telegram.Bot.API.UpdatingMessages.EditMessageResponse) instance Telegram.Bot.Simple.RunTG.RunTG Telegram.Bot.API.UpdatingMessages.EditMessageReplyMarkupRequest (Telegram.Bot.API.MakingRequests.Response Telegram.Bot.API.UpdatingMessages.EditMessageResponse) instance Telegram.Bot.Simple.RunTG.RunTG Telegram.Bot.API.UpdatingMessages.StopPollRequest (Telegram.Bot.API.MakingRequests.Response Telegram.Bot.API.Types.Poll.Poll) instance Telegram.Bot.Simple.RunTG.RunTG Telegram.Bot.API.Forum.CreateForumTopicRequest (Telegram.Bot.API.MakingRequests.Response Telegram.Bot.API.Types.ForumTopic.ForumTopic) instance Telegram.Bot.Simple.RunTG.RunTG Telegram.Bot.API.Forum.EditForumTopicRequest (Telegram.Bot.API.MakingRequests.Response GHC.Types.Bool) instance Telegram.Bot.Simple.RunTG.RunTG Telegram.Bot.API.Forum.CloseForumTopicRequest (Telegram.Bot.API.MakingRequests.Response GHC.Types.Bool) instance Telegram.Bot.Simple.RunTG.RunTG Telegram.Bot.API.Forum.ReopenForumTopicRequest (Telegram.Bot.API.MakingRequests.Response GHC.Types.Bool) instance Telegram.Bot.Simple.RunTG.RunTG Telegram.Bot.API.Forum.DeleteForumTopicRequest (Telegram.Bot.API.MakingRequests.Response GHC.Types.Bool) instance Telegram.Bot.Simple.RunTG.RunTG Telegram.Bot.API.Forum.UnpinAllForumTopicMessagesRequest (Telegram.Bot.API.MakingRequests.Response GHC.Types.Bool) instance Telegram.Bot.Simple.RunTG.RunTG Telegram.Bot.API.Forum.EditGeneralForumTopicRequest (Telegram.Bot.API.MakingRequests.Response GHC.Types.Bool) instance Telegram.Bot.Simple.RunTG.RunTG Telegram.Bot.API.Forum.CloseGeneralForumTopicRequest (Telegram.Bot.API.MakingRequests.Response GHC.Types.Bool) instance Telegram.Bot.Simple.RunTG.RunTG Telegram.Bot.API.Forum.ReopenGeneralForumTopicRequest (Telegram.Bot.API.MakingRequests.Response GHC.Types.Bool) instance Telegram.Bot.Simple.RunTG.RunTG Telegram.Bot.API.Forum.HideGeneralForumTopicRequest (Telegram.Bot.API.MakingRequests.Response GHC.Types.Bool) instance Telegram.Bot.Simple.RunTG.RunTG Telegram.Bot.API.Forum.UnhideGeneralForumTopicRequest (Telegram.Bot.API.MakingRequests.Response GHC.Types.Bool) instance Telegram.Bot.Simple.RunTG.RunTG Telegram.Bot.API.Methods.ForwardMessage.ForwardMessageRequest (Telegram.Bot.API.MakingRequests.Response Telegram.Bot.API.Types.Message.Message) instance Telegram.Bot.Simple.RunTG.RunTG Telegram.Bot.API.Methods.SendDice.SendDiceRequest (Telegram.Bot.API.MakingRequests.Response Telegram.Bot.API.Types.Message.Message) instance Telegram.Bot.Simple.RunTG.RunTG Telegram.Bot.API.Methods.UnbanChatMember.UnbanChatMemberRequest (Telegram.Bot.API.MakingRequests.Response GHC.Types.Bool) instance Telegram.Bot.Simple.RunTG.RunTG Telegram.Bot.API.Methods.SendLocation.SendLocationRequest (Telegram.Bot.API.MakingRequests.Response Telegram.Bot.API.Types.Message.Message) instance Telegram.Bot.Simple.RunTG.RunTG Telegram.Bot.API.Methods.SendVoice.SendVoiceRequest (Telegram.Bot.API.MakingRequests.Response Telegram.Bot.API.Types.Message.Message) instance Telegram.Bot.Simple.RunTG.RunTG Telegram.Bot.API.Methods.SendAudio.SendAudioRequest (Telegram.Bot.API.MakingRequests.Response Telegram.Bot.API.Types.Message.Message) instance Telegram.Bot.Simple.RunTG.RunTG Telegram.Bot.API.Methods.SendVideo.SendVideoRequest (Telegram.Bot.API.MakingRequests.Response Telegram.Bot.API.Types.Message.Message) instance Telegram.Bot.Simple.RunTG.RunTG Telegram.Bot.API.Methods.SetChatPhoto.SetChatPhotoRequest (Telegram.Bot.API.MakingRequests.Response GHC.Types.Bool) instance Telegram.Bot.Simple.RunTG.RunTG Telegram.Bot.API.Methods.DeleteMyCommands.DeleteMyCommandsRequest (Telegram.Bot.API.MakingRequests.Response GHC.Types.Bool) instance Telegram.Bot.Simple.RunTG.RunTG Telegram.Bot.API.Methods.EditMessageLiveLocation.EditMessageLiveLocationRequest (Telegram.Bot.API.MakingRequests.Response (Data.Either.Either GHC.Types.Bool Telegram.Bot.API.Types.Message.Message)) instance Telegram.Bot.Simple.RunTG.RunTG Telegram.Bot.API.Methods.SetChatMenuButton.SetChatMenuButtonRequest (Telegram.Bot.API.MakingRequests.Response GHC.Types.Bool) instance Telegram.Bot.Simple.RunTG.RunTG Telegram.Bot.API.Methods.SetMyCommands.SetMyCommandsRequest (Telegram.Bot.API.MakingRequests.Response GHC.Types.Bool) instance Telegram.Bot.Simple.RunTG.RunTG Telegram.Bot.API.Methods.SetCustomEmojiStickerSetThumbnail.SetCustomEmojiStickerSetThumbnailRequest (Telegram.Bot.API.MakingRequests.Response GHC.Types.Bool) instance Telegram.Bot.Simple.RunTG.RunTG Telegram.Bot.API.Methods.CopyMessage.CopyMessageRequest (Telegram.Bot.API.MakingRequests.Response Telegram.Bot.API.Types.CopyMessageId.CopyMessageId) instance Telegram.Bot.Simple.RunTG.RunTG Telegram.Bot.API.Methods.SendMessage.SendMessageRequest (Telegram.Bot.API.MakingRequests.Response Telegram.Bot.API.Types.Message.Message) instance Telegram.Bot.Simple.RunTG.RunTG Telegram.Bot.API.Methods.EditChatInviteLink.EditChatInviteLinkRequest (Telegram.Bot.API.MakingRequests.Response Telegram.Bot.API.Types.ChatInviteLink.ChatInviteLink) instance Telegram.Bot.Simple.RunTG.RunTG Telegram.Bot.API.Methods.SendPhoto.SendPhotoRequest (Telegram.Bot.API.MakingRequests.Response Telegram.Bot.API.Types.Message.Message) instance Telegram.Bot.Simple.RunTG.RunTG Telegram.Bot.API.Methods.StopMessageLiveLocation.StopMessageLiveLocationRequest (Telegram.Bot.API.MakingRequests.Response (Data.Either.Either GHC.Types.Bool Telegram.Bot.API.Types.Message.Message)) instance Telegram.Bot.Simple.RunTG.RunTG Telegram.Bot.API.Methods.SendDocument.SendDocumentRequest (Telegram.Bot.API.MakingRequests.Response Telegram.Bot.API.Types.Message.Message) instance Telegram.Bot.Simple.RunTG.RunTG Telegram.Bot.API.Methods.SendAnimation.SendAnimationRequest (Telegram.Bot.API.MakingRequests.Response Telegram.Bot.API.Types.Message.Message) instance Telegram.Bot.Simple.RunTG.RunTG Telegram.Bot.API.Methods.RestrictChatMember.RestrictChatMemberRequest (Telegram.Bot.API.MakingRequests.Response GHC.Types.Bool) instance Telegram.Bot.Simple.RunTG.RunTG Telegram.Bot.API.Methods.AnswerCallbackQuery.AnswerCallbackQueryRequest (Telegram.Bot.API.MakingRequests.Response GHC.Types.Bool) instance Telegram.Bot.Simple.RunTG.RunTG Telegram.Bot.API.Methods.SetMyDefaultAdministratorRights.SetMyDefaultAdministratorRightsRequest (Telegram.Bot.API.MakingRequests.Response GHC.Types.Bool) instance Telegram.Bot.Simple.RunTG.RunTG Telegram.Bot.API.Methods.SetMyDescription.SetMyDescriptionRequest (Telegram.Bot.API.MakingRequests.Response GHC.Types.Bool) instance Telegram.Bot.Simple.RunTG.RunTG Telegram.Bot.API.Methods.SetMyShortDescription.SetMyShortDescriptionRequest (Telegram.Bot.API.MakingRequests.Response GHC.Types.Bool) instance Telegram.Bot.Simple.RunTG.RunTG Telegram.Bot.API.Methods.CreateChatInviteLink.CreateChatInviteLinkRequest (Telegram.Bot.API.MakingRequests.Response Telegram.Bot.API.Types.ChatInviteLink.ChatInviteLink) instance Telegram.Bot.Simple.RunTG.RunTG Telegram.Bot.API.Methods.PinChatMessage.PinChatMessageRequest (Telegram.Bot.API.MakingRequests.Response GHC.Types.Bool) instance Telegram.Bot.Simple.RunTG.RunTG Telegram.Bot.API.Methods.SetChatPermissions.SetChatPermissionsRequest (Telegram.Bot.API.MakingRequests.Response GHC.Types.Bool) instance Telegram.Bot.Simple.RunTG.RunTG Telegram.Bot.API.Methods.PromoteChatMember.PromoteChatMemberRequest (Telegram.Bot.API.MakingRequests.Response GHC.Types.Bool) instance Telegram.Bot.Simple.RunTG.RunTG Telegram.Bot.API.Methods.GetMyDefaultAdministratorRights.GetMyDefaultAdministratorRightsRequest (Telegram.Bot.API.MakingRequests.Response Telegram.Bot.API.Types.ChatAdministratorRights.ChatAdministratorRights) instance Telegram.Bot.Simple.RunTG.RunTG Telegram.Bot.API.Methods.GetMyDescription.GetMyDescriptionRequest (Telegram.Bot.API.MakingRequests.Response Telegram.Bot.API.Types.BotDescription.BotDescription) instance Telegram.Bot.Simple.RunTG.RunTG Telegram.Bot.API.Methods.GetMyShortDescription.GetMyShortDescriptionRequest (Telegram.Bot.API.MakingRequests.Response Telegram.Bot.API.Types.BotShortDescription.BotShortDescription) instance Telegram.Bot.Simple.RunTG.RunTG Telegram.Bot.API.Methods.BanChatMember.BanChatMemberRequest (Telegram.Bot.API.MakingRequests.Response GHC.Types.Bool) instance Telegram.Bot.Simple.RunTG.RunTG Telegram.Bot.API.Methods.GetChatMenuButton.GetChatMenuButtonRequest (Telegram.Bot.API.MakingRequests.Response Telegram.Bot.API.Types.MenuButton.MenuButton) instance Telegram.Bot.Simple.RunTG.RunTG Telegram.Bot.API.Methods.SendPoll.SendPollRequest (Telegram.Bot.API.MakingRequests.Response Telegram.Bot.API.Types.Message.Message) instance Telegram.Bot.Simple.RunTG.RunTG Telegram.Bot.API.Methods.GetMyCommands.GetMyCommandsRequest (Telegram.Bot.API.MakingRequests.Response [Telegram.Bot.API.Types.BotCommand.BotCommand]) instance Telegram.Bot.Simple.RunTG.RunTG Telegram.Bot.API.Methods.SendVenue.SendVenueRequest (Telegram.Bot.API.MakingRequests.Response Telegram.Bot.API.Types.Message.Message) instance Telegram.Bot.Simple.RunTG.RunTG Telegram.Bot.API.Methods.SendMediaGroup.SendMediaGroupRequest (Telegram.Bot.API.MakingRequests.Response [Telegram.Bot.API.Types.Message.Message]) instance Telegram.Bot.Simple.RunTG.RunTG Telegram.Bot.API.Methods.SetChatAdministratorCustomTitle.SetChatAdministratorCustomTitleRequest (Telegram.Bot.API.MakingRequests.Response GHC.Types.Bool) instance Telegram.Bot.Simple.RunTG.RunTG Telegram.Bot.API.Methods.SendVideoNote.SendVideoNoteRequest (Telegram.Bot.API.MakingRequests.Response Telegram.Bot.API.Types.Message.Message) instance Telegram.Bot.Simple.RunTG.RunTG Telegram.Bot.API.Methods.SendContact.SendContactRequest (Telegram.Bot.API.MakingRequests.Response Telegram.Bot.API.Types.Message.Message) instance Telegram.Bot.Simple.RunTG.RunTG Telegram.Bot.API.Methods.GetUserProfilePhotos.GetUserProfilePhotosRequest (Telegram.Bot.API.MakingRequests.Response Telegram.Bot.API.Types.UserProfilePhotos.UserProfilePhotos) module Telegram.Bot.Simple.Reply -- | Get current ChatId if possible. currentChatId :: BotM (Maybe ChatId) getEditMessageId :: BotM (Maybe EditMessageId) updateEditMessageId :: Update -> Maybe EditMessageId -- | Reply message parameters. This is just like SendMessageRequest -- but without SomeChatId specified. data ReplyMessage ReplyMessage :: Text -> Maybe MessageThreadId -> Maybe ParseMode -> Maybe [MessageEntity] -> Maybe LinkPreviewOptions -> Maybe Bool -> Maybe Bool -> Maybe MessageId -> Maybe ReplyParameters -> Maybe SomeReplyMarkup -> ReplyMessage -- | Text of the message to be sent. [replyMessageText] :: ReplyMessage -> Text -- | Unique identifier for the target message thread (topic) of the forum; -- for forum supergroups only. [replyMessageMessageThreadId] :: ReplyMessage -> Maybe MessageThreadId -- | Send MarkdownV2, HTML or Markdown (legacy), if -- you want Telegram apps to show bold, italic, fixed-width text or -- inline URLs in your bot's message. [replyMessageParseMode] :: ReplyMessage -> Maybe ParseMode -- | A JSON-serialized list of special entities that appear in message -- text, which can be specified instead of parse_mode. [replyMessageEntities] :: ReplyMessage -> Maybe [MessageEntity] -- | Link preview generation options for the message. [replyMessageLinkPreviewOptions] :: ReplyMessage -> Maybe LinkPreviewOptions -- | Sends the message silently. Users will receive a notification with no -- sound. [replyMessageDisableNotification] :: ReplyMessage -> Maybe Bool -- | Protects the contents of the sent message from forwarding and saving. [replyMessageProtectContent] :: ReplyMessage -> Maybe Bool -- | If the message is a reply, ID of the original message. [replyMessageReplyToMessageId] :: ReplyMessage -> Maybe MessageId -- | Description of the message to reply to. [replyMessageReplyParameters] :: ReplyMessage -> Maybe ReplyParameters -- | Additional interface options. A JSON-serialized object for an inline -- keyboard, custom reply keyboard, instructions to remove reply keyboard -- or to force a reply from the user. [replyMessageReplyMarkup] :: ReplyMessage -> Maybe SomeReplyMarkup -- | Create a ReplyMessage with just some Text message. toReplyMessage :: Text -> ReplyMessage replyMessageToSendMessageRequest :: SomeChatId -> ReplyMessage -> SendMessageRequest -- | Reply in a chat with a given SomeChatId. replyTo :: SomeChatId -> ReplyMessage -> BotM () -- | Reply in the current chat (if possible). reply :: ReplyMessage -> BotM () -- | Reply with a text. replyText :: Text -> BotM () data EditMessage EditMessage :: Text -> Maybe ParseMode -> Maybe LinkPreviewOptions -> Maybe SomeReplyMarkup -> EditMessage [editMessageText] :: EditMessage -> Text [editMessageParseMode] :: EditMessage -> Maybe ParseMode [editMessageLinkPreviewOptions] :: EditMessage -> Maybe LinkPreviewOptions [editMessageReplyMarkup] :: EditMessage -> Maybe SomeReplyMarkup data EditMessageId EditChatMessageId :: SomeChatId -> MessageId -> EditMessageId EditInlineMessageId :: MessageId -> EditMessageId toEditMessage :: Text -> EditMessage editMessageToEditMessageTextRequest :: EditMessageId -> EditMessage -> EditMessageTextRequest editMessageToReplyMessage :: EditMessage -> ReplyMessage editMessage :: EditMessageId -> EditMessage -> BotM () editUpdateMessage :: EditMessage -> BotM () editUpdateMessageText :: Text -> BotM () replyOrEdit :: EditMessage -> BotM () instance GHC.Generics.Generic Telegram.Bot.Simple.Reply.ReplyMessage instance Data.String.IsString Telegram.Bot.Simple.Reply.EditMessage instance Data.String.IsString Telegram.Bot.Simple.Reply.ReplyMessage module Telegram.Bot.Simple.Instances instance Telegram.Bot.Simple.Eff.GetAction a a instance Telegram.Bot.Simple.Eff.GetAction () a instance Telegram.Bot.Simple.Eff.GetAction Data.Text.Internal.Text a module Telegram.Bot.Simple.UpdateParser newtype UpdateParser a UpdateParser :: (Update -> Maybe a) -> UpdateParser a [runUpdateParser] :: UpdateParser a -> Update -> Maybe a mkParser :: (Update -> Maybe a) -> UpdateParser a parseUpdate :: UpdateParser a -> Update -> Maybe a text :: UpdateParser Text plainText :: UpdateParser Text command :: Text -> UpdateParser Text commandWithBotName :: Text -> Text -> UpdateParser Text -- | Obtain CallbackQuery data associated with the callback -- button in an inline keyboard if present in Update message. callbackQueryDataRead :: Read a => UpdateParser a updateMessageText :: Update -> Maybe Text updateMessageSticker :: Update -> Maybe Sticker instance GHC.Base.Functor Telegram.Bot.Simple.UpdateParser.UpdateParser instance GHC.Base.Applicative Telegram.Bot.Simple.UpdateParser.UpdateParser instance GHC.Base.Alternative Telegram.Bot.Simple.UpdateParser.UpdateParser instance GHC.Base.Monad Telegram.Bot.Simple.UpdateParser.UpdateParser instance Control.Monad.Fail.MonadFail Telegram.Bot.Simple.UpdateParser.UpdateParser module Telegram.Bot.Simple.Webhook webhookApp :: BotApp model action -> BotEnv model action -> Application module Telegram.Bot.Simple.BotApp -- | A bot application. data BotApp model action BotApp :: model -> (Update -> model -> Maybe action) -> (action -> model -> Eff action model) -> [BotJob model action] -> BotApp model action -- | Initial bot state. [botInitialModel] :: BotApp model action -> model -- | How to convert incoming Updates into actions. See -- Telegram.Bot.Simple.UpdateParser for some helpers. [botAction] :: BotApp model action -> Update -> model -> Maybe action -- | How to handle actions. [botHandler] :: BotApp model action -> action -> model -> Eff action model -- | Background bot jobs. [botJobs] :: BotApp model action -> [BotJob model action] -- | A background bot job. data BotJob model action BotJob :: Text -> (model -> Eff action model) -> BotJob model action -- | Cron schedule for the job. [botJobSchedule] :: BotJob model action -> Text -- | Job function. [botJobTask] :: BotJob model action -> model -> Eff action model data WebhookConfig WebhookConfig :: TLSSettings -> Settings -> SetWebhookRequest -> WebhookConfig [webhookConfigTlsSettings] :: WebhookConfig -> TLSSettings [webhookConfigTlsWarpSettings] :: WebhookConfig -> Settings [webhookConfigSetWebhookRequest] :: WebhookConfig -> SetWebhookRequest -- | Start bot with update polling in the main thread. startBot :: BotApp model action -> ClientEnv -> IO (Either ClientError ()) -- | Like startBot, but ignores result. startBot_ :: BotApp model action -> ClientEnv -> IO () -- | Start bot with asynchronous polling. The result is a function that -- allows you to send actions directly to the bot. startBotAsync :: BotApp model action -> ClientEnv -> IO (action -> IO ()) -- | Like startBotAsync, but ignores result. startBotAsync_ :: BotApp model action -> ClientEnv -> IO () -- | Start bot with webhook on update in the main thread. Port must be one -- of 443, 80, 88, 8443 certPath must be provided if using self signed -- certificate. startBotWebhook :: BotApp model action -> WebhookConfig -> ClientEnv -> IO (Either ClientError ()) -- | Like startBotWebhook, but ignores result. startBotWebhook_ :: BotApp model action -> WebhookConfig -> ClientEnv -> IO () -- | Get a Token from environment variable. -- -- Common use: -- --
--   getEnvToken TELEGRAM_BOT_TOKEN
--   
getEnvToken :: String -> IO Token module Telegram.Bot.Simple.Debug -- | This a default bot tracing modifier that relies on -- -- traceBotDefault :: (Show model, Show action) => BotApp model action -> BotApp model action -- | Trace (debug print) every Update before parsing it. traceTelegramUpdatesWith :: (Update -> String) -> BotApp model action -> BotApp model action -- | Trace (debug print) every update as pretty JSON value. traceTelegramUpdatesJSON :: BotApp model action -> BotApp model action -- | Trace (debug print) every update using Show instance. traceTelegramUpdatesShow :: BotApp model action -> BotApp model action -- | A type of an action to trace. data TracedAction action -- | An action that's about to be handled. TracedIncomingAction :: action -> TracedAction action -- | An action that's just been issued by some handler. TracedIssuedAction :: action -> TracedAction action -- | Pretty print TraceActionType. ppTracedAction :: Show action => TracedAction action -> String -- | Trace (debug print) every incoming and issued action. traceBotActionsWith :: (TracedAction action -> String) -> BotApp model action -> BotApp model action -- | Trace (debug print) bot actions using Show instance. traceBotActionsShow :: Show action => BotApp model action -> BotApp model action -- | Trace (debug print) bot model. traceBotModelWith :: (model -> String) -> BotApp model action -> BotApp model action -- | Trace (debug print) bot model using Show instance. traceBotModelShow :: Show model => BotApp model action -> BotApp model action -- | Trace (debug print) bot model using Show instance. traceBotModelJSON :: ToJSON model => BotApp model action -> BotApp model action -- | Pretty print a value as JSON. ppAsJSON :: ToJSON a => a -> String instance GHC.Show.Show action => GHC.Show.Show (Telegram.Bot.Simple.Debug.TracedAction action) instance GHC.Classes.Eq action => GHC.Classes.Eq (Telegram.Bot.Simple.Debug.TracedAction action) module Telegram.Bot.Simple.Conversation -- | Make bot to have a separate state for each conversation. -- -- Common use (to have a separate state for each chat): -- --
--   conversationBot updateChatId bot
--   
conversationBot :: (Eq conversation, Hashable conversation) => (Update -> Maybe conversation) -> BotApp model action -> BotApp (HashMap (Maybe conversation) model) (Maybe conversation, action) -- | Pass latest Update to all bot jobs. -- -- This enables jobs to easily send notifications. useLatestUpdateInJobs :: BotApp model action -> BotApp (Maybe Update, model) (Maybe Update, action) module Telegram.Bot.Simple