Module

TelegramBot

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

#TelegramEffects Source

type TelegramEffects e = (telegram :: TELEGRAM | e)

#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 :: NullOrUndefined User, location :: NullOrUndefined Location, message_id :: Int, text :: NullOrUndefined String }

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

#User Source

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

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

#Chat Source

type Chat = { first_name :: NullOrUndefined String, id :: Int, last_name :: NullOrUndefined String, type :: String, username :: NullOrUndefined 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

#TELEGRAM Source

#Bot Source

data Bot :: Type

#defaultOptions Source

#_connect Source

#connect Source

connect :: forall e. Token -> Eff (TelegramEffects e) Bot

#_sendMessage Source

#sendMessage Source

sendMessage :: forall e. Bot -> Int -> String -> Eff (TelegramEffects e) Unit

#onText Source

onText :: forall e. Bot -> Regex -> (F Message -> F Matches -> Eff (TelegramEffects e) Unit) -> (Eff (TelegramEffects e) Unit)

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

#onText' Source

onText' :: forall e. Bot -> Regex -> (Foreign -> Foreign -> Eff (TelegramEffects e) Unit) -> (Eff (TelegramEffects e) Unit)

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

#onMessage Source

onMessage :: forall e. Bot -> (F Message -> Eff (TelegramEffects e) Unit) -> (Eff (TelegramEffects e) Unit)

For adding a callback for all messages.

#onMessage' Source

onMessage' :: forall e. Bot -> (Foreign -> Eff (TelegramEffects e) Unit) -> (Eff (TelegramEffects e) Unit)

For getting the Foreign value directly from onMessage

#Promise Source

data Promise :: Type -> Type

#runPromise Source

runPromise :: forall a e. (EffFn1 e Error Unit) -> (EffFn1 e a Unit) -> Promise a -> Eff e Unit

#_getMe Source

#getMe Source

getMe :: forall e. Bot -> (Aff (TelegramEffects e) (F User))

For adding a callback for all messages.

Modules
TelegramBot