mirror of
https://github.com/yagop/node-telegram-bot-api
synced 2025-08-23 10:27:49 +00:00
jsdoc2md class constructor #90
This commit is contained in:
parent
7f278ead1f
commit
b46378d25b
@ -14,23 +14,6 @@ const URL = require('url');
|
|||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const pump = require('pump');
|
const pump = require('pump');
|
||||||
|
|
||||||
/**
|
|
||||||
* Both request method to obtain messages are implemented. To use standard polling, set `polling: true`
|
|
||||||
* on `options`. Notice that [webHook](https://core.telegram.org/bots/api#setwebhook) will need a SSL certificate.
|
|
||||||
* Emits `message` when a message arrives.
|
|
||||||
*
|
|
||||||
* @class TelegramBot
|
|
||||||
* @constructor
|
|
||||||
* @param {String} token Bot Token
|
|
||||||
* @param {Object} [options]
|
|
||||||
* @param {Boolean|Object} [options.polling=false] Set true to enable polling or set options
|
|
||||||
* @param {String|Number} [options.polling.timeout=10] Polling time in seconds
|
|
||||||
* @param {String|Number} [options.polling.interval=2000] Interval between requests in miliseconds
|
|
||||||
* @param {Boolean|Object} [options.webHook=false] Set true to enable WebHook or set options
|
|
||||||
* @param {String} [options.webHook.key] PEM private key to webHook server.
|
|
||||||
* @param {String} [options.webHook.cert] PEM certificate (public) to webHook server.
|
|
||||||
* @see https://core.telegram.org/bots/api
|
|
||||||
*/
|
|
||||||
class TelegramBot extends EventEmitter {
|
class TelegramBot extends EventEmitter {
|
||||||
|
|
||||||
// Telegram message events
|
// Telegram message events
|
||||||
@ -40,6 +23,23 @@ class TelegramBot extends EventEmitter {
|
|||||||
'new_chat_photo', 'delete_chat_photo', 'group_chat_created'
|
'new_chat_photo', 'delete_chat_photo', 'group_chat_created'
|
||||||
];
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Both request method to obtain messages are implemented. To use standard polling, set `polling: true`
|
||||||
|
* on `options`. Notice that [webHook](https://core.telegram.org/bots/api#setwebhook) will need a SSL certificate.
|
||||||
|
* Emits `message` when a message arrives.
|
||||||
|
*
|
||||||
|
* @class TelegramBot
|
||||||
|
* @constructor
|
||||||
|
* @param {String} token Bot Token
|
||||||
|
* @param {Object} [options]
|
||||||
|
* @param {Boolean|Object} [options.polling=false] Set true to enable polling or set options
|
||||||
|
* @param {String|Number} [options.polling.timeout=10] Polling time in seconds
|
||||||
|
* @param {String|Number} [options.polling.interval=2000] Interval between requests in miliseconds
|
||||||
|
* @param {Boolean|Object} [options.webHook=false] Set true to enable WebHook or set options
|
||||||
|
* @param {String} [options.webHook.key] PEM private key to webHook server.
|
||||||
|
* @param {String} [options.webHook.cert] PEM certificate (public) to webHook server.
|
||||||
|
* @see https://core.telegram.org/bots/api
|
||||||
|
*/
|
||||||
constructor(token, options = {}) {
|
constructor(token, options = {}) {
|
||||||
super();
|
super();
|
||||||
this.options = options;
|
this.options = options;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user