1.0.41 • Published 4 years ago

viva-telegram v1.0.41

Weekly downloads
1
License
MIT
Repository
gitlab
Last release
4 years ago

Classes

Typedefs

Telegram

(license MIT) library for work with telegram, full example - see example.js

Kind: global class

telegram.bot_name : string

Kind: instance property of Telegram

telegram.cache : lib_cache

Kind: instance property of Telegram

telegram.message_text_markdown_escape(text) ⇒ string

escaping service markdown characters

Kind: instance method of Telegram

ParamType
textstring

telegram.launch(token, option, callback)

main function for launch bot

Kind: instance method of Telegram

ParamTypeDescription
tokenstring
optiontype_option
callbackfunctionerror

telegram.keyboard(notice, message, keyboard, option, callback)

send message and create keyboard, located under the text entry field

Kind: instance method of Telegram

ParamTypeDescription
noticetype_notice
messagestring
keyboardArray.<Array.<type_send_keyboardmenu_option>>
optiontype_send_keyboard_option
callbackfunctionmessage_id - number

telegram.message(notice, message, buttons, option, callback)

send message with buttons below this message

Kind: instance method of Telegram

ParamTypeDescription
noticetype_notice
messagestring
buttonsArray.<Array.<type_send_button>>
optiontype_send_message_option
callbackfunctionmessage_id - number

telegram.image(notice, image, message, buttons, option, callback)

send image with buttons below this message

Kind: instance method of Telegram

ParamTypeDescription
noticetype_notice
imageBuffer
messagestring
buttonsArray.<Array.<type_send_button>>
optiontype_send_image_option
callbackfunctionmessage_id - number

telegram.delete(notice, message_id, callback)

delete previously sent message or image

Kind: instance method of Telegram

ParamTypeDescription
noticetype_notice
message_idnumber
callbackfunctionis_deleted - boolean

telegram.load_from_cashe(account, message_id, callback)

from cashe load previously saved message or image

Kind: instance method of Telegram

ParamTypeDescription
accountstring
message_idnumber
callbackfunction(error, result = {message, buttons, option, image})

telegram.queue(notice, items, callback)

send many messages

Kind: instance method of Telegram

ParamTypeDescription
noticetype_notice
itemsArray.<type_send_queue_message>
callbackfunctionmessage_ids - number[]

type_option

Kind: global typedef
Properties

NameTypeDescription
cashe_callback_datastringcashed callback data subsystem: default mode work (can be specified explicitly in each message), variants - 'manual', 'all', 'auto', default - 'manual'
cashe_callback_data_pathstringcashed callback data subsystem: path for save cache
cashe_callback_data_path_bot_namebooleancashed callback data subsystem: add to option "cashe_callback_data_path" bot name, default - true
cashe_callback_data_timelivenumbercashed callback data subsystem: timelive for cashed data live, in minutes
cashe_messagebooleancashed message subsystem: default mode work (can be specified explicitly in each message) - default - false
cashe_message_pathstringcashed message subsystem: path for save cache
cashe_message_path_bot_namebooleancashed message subsystem: add to option "cashe_message_path" bot name, default - true
cashe_message_timelivenumbercashed message subsystem: timelive for cashed data live, in minutes

type_send_keyboardmenu_option

Kind: global typedef
Properties

NameType
textstring
is_request_contactboolean
is_request_locationboolean

type_send_message_option

Kind: global typedef
Properties

NameType
is_message_format_markdownboolean
is_keyboard_removeboolean
is_reply_to_message_from_noticeboolean
cashe_messageboolean

type_send_image_option

Kind: global typedef
Properties

NameType
is_message_format_markdownboolean
is_keyboard_removeboolean
is_reply_to_message_from_noticeboolean
cashe_messageboolean

type_send_button

Kind: global typedef
Properties

NameType
textstring
callback_datastring | Object
cashe_callback_databoolean

type_send_queue_message

Kind: global typedef
Properties

NameType
messagestring
buttonsArray.<Array.<type_send_button>>
optiontype_send_message_option
1.0.41

4 years ago

1.0.39

4 years ago

1.0.38

5 years ago

1.0.37

5 years ago

1.0.36

5 years ago

1.0.35

5 years ago

1.0.34

5 years ago

1.0.32

5 years ago

1.0.31

5 years ago

1.0.30

5 years ago

1.0.25

5 years ago

1.0.24

5 years ago

1.0.23

5 years ago

1.0.22

5 years ago

1.0.21

5 years ago

1.0.20

5 years ago

1.0.19

5 years ago

1.0.18

5 years ago

1.0.17

5 years ago

1.0.16

5 years ago

1.0.15

5 years ago

1.0.12

5 years ago

1.0.11

5 years ago

1.0.10

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago