npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

viva-telegram

v1.0.41

Published

helpers for telegram bot

Downloads

11

Readme

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

| Param | Type | | --- | --- | | text | string |

telegram.launch(token, [option], callback)

main function for launch bot

Kind: instance method of Telegram

| Param | Type | Description | | --- | --- | --- | | token | string | | | [option] | type_option | | | callback | function | error |

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

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

Kind: instance method of Telegram

| Param | Type | Description | | --- | --- | --- | | notice | type_notice | | | message | string | | | keyboard | Array.<Array.<type_send_keyboardmenu_option>> | | | [option] | type_send_keyboard_option | | | [callback] | function | message_id - number |

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

send message with buttons below this message

Kind: instance method of Telegram

| Param | Type | Description | | --- | --- | --- | | notice | type_notice | | | message | string | | | [buttons] | Array.<Array.<type_send_button>> | | | [option] | type_send_message_option | | | [callback] | function | message_id - number |

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

send image with buttons below this message

Kind: instance method of Telegram

| Param | Type | Description | | --- | --- | --- | | notice | type_notice | | | image | Buffer | | | [message] | string | | | [buttons] | Array.<Array.<type_send_button>> | | | [option] | type_send_image_option | | | [callback] | function | message_id - number |

telegram.delete(notice, message_id, [callback])

delete previously sent message or image

Kind: instance method of Telegram

| Param | Type | Description | | --- | --- | --- | | notice | type_notice | | | message_id | number | | | [callback] | function | is_deleted - boolean |

telegram.load_from_cashe(account, message_id, callback)

from cashe load previously saved message or image

Kind: instance method of Telegram

| Param | Type | Description | | --- | --- | --- | | account | string | | | message_id | number | | | callback | function | (error, result = {message, buttons, option, image}) |

telegram.queue(notice, items, [callback])

send many messages

Kind: instance method of Telegram

| Param | Type | Description | | --- | --- | --- | | notice | type_notice | | | items | Array.<type_send_queue_message> | | | [callback] | function | message_ids - number[] |

type_option

Kind: global typedef
Properties

| Name | Type | Description | | --- | --- | --- | | [cashe_callback_data] | string | cashed callback data subsystem: default mode work (can be specified explicitly in each message), variants - 'manual', 'all', 'auto', default - 'manual' | | [cashe_callback_data_path] | string | cashed callback data subsystem: path for save cache | | [cashe_callback_data_path_bot_name] | boolean | cashed callback data subsystem: add to option "cashe_callback_data_path" bot name, default - true | | [cashe_callback_data_timelive] | number | cashed callback data subsystem: timelive for cashed data live, in minutes | | [cashe_message] | boolean | cashed message subsystem: default mode work (can be specified explicitly in each message) - default - false | | [cashe_message_path] | string | cashed message subsystem: path for save cache | | [cashe_message_path_bot_name] | boolean | cashed message subsystem: add to option "cashe_message_path" bot name, default - true | | [cashe_message_timelive] | number | cashed message subsystem: timelive for cashed data live, in minutes |

type_send_keyboardmenu_option

Kind: global typedef
Properties

| Name | Type | | --- | --- | | text | string | | [is_request_contact] | boolean | | [is_request_location] | boolean |

type_send_message_option

Kind: global typedef
Properties

| Name | Type | | --- | --- | | [is_message_format_markdown] | boolean | | [is_keyboard_remove] | boolean | | [is_reply_to_message_from_notice] | boolean | | [cashe_message] | boolean |

type_send_image_option

Kind: global typedef
Properties

| Name | Type | | --- | --- | | [is_message_format_markdown] | boolean | | [is_keyboard_remove] | boolean | | [is_reply_to_message_from_notice] | boolean | | [cashe_message] | boolean |

type_send_button

Kind: global typedef
Properties

| Name | Type | | --- | --- | | text | string | | [callback_data] | string | Object | | [cashe_callback_data] | boolean |

type_send_queue_message

Kind: global typedef
Properties

| Name | Type | | --- | --- | | message | string | | [buttons] | Array.<Array.<type_send_button>> | | [option] | type_send_message_option |