Module

TelegramBot

Package
purescript-node-telegram-bot-api
Repository
justinwoo/purescript-node-telegram-bot-api

#Token Source

type Token = String

The Telegram Bot API Token.

#Options Source

type Options = { polling :: Boolean }

The Telegram Bot options.

#Message Source

type Message = { chat :: Chat, date :: Int, from :: Maybe User, location :: Maybe Location, message_id :: Int, text :: Maybe String }

The Telegram Message type. See https://core.telegram.org/bots/api#message

#User Source

type User = { first_name :: Maybe String, id :: Int, last_name :: Maybe String, username :: Maybe String }

The Telegram User type. See https://core.telegram.org/bots/api#user

#Chat Source

type Chat = { first_name :: Maybe String, id :: Int, last_name :: Maybe String, type :: String, username :: Maybe String }

The Telegram Chat type. See https://core.telegram.org/bots/api#chat

#Location Source

type Location = { latitude :: Number, longitude :: Number }

The Telegram Location type. See https://core.telegram.org/bots/api#location

#Bot Source

data Bot :: Type

#defaultOptions Source

#sendMessage Source

#onText Source

onText :: Bot -> Regex -> (F Message -> F Matches -> Effect Unit) -> (Effect Unit)

For adding a callback for on text matching a regex pattern.

#onText' Source

onText' :: Bot -> Regex -> (Foreign -> Foreign -> Effect Unit) -> (Effect Unit)

For getting the Foreign values directly. The callback is Message -> Matches -> Effect _ Unit.

#onMessage Source

onMessage :: Bot -> (F Message -> Effect Unit) -> (Effect Unit)

For adding a callback for all messages.

#onMessage' Source

onMessage' :: Bot -> (Foreign -> Effect Unit) -> (Effect Unit)

For getting the Foreign value directly from onMessage

#Promise Source

data Promise :: Type -> Type

#runPromise Source

#getMe Source

getMe :: Bot -> (Aff (F User))

For adding a callback for all messages.

Modules
TelegramBot