mirror of
https://github.com/yagop/node-telegram-bot-api
synced 2025-08-29 13:27:44 +00:00
Generate Docs from /src directly
This commit is contained in:
parent
1b2afa71fd
commit
b117a5b5ae
@ -17,7 +17,7 @@
|
||||
"prepublish": "./node_modules/.bin/babel -d ./lib src",
|
||||
"test": "./node_modules/.bin/mocha test/index.js --timeout 10000",
|
||||
"test-cov": "./node_modules/.bin/istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- -R spec && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage",
|
||||
"gen-doc": "./node_modules/.bin/babel --no-babelrc --plugins transform-es2015-spread,transform-es2015-destructuring,transform-strict-mode,transform-es2015-parameters,transform-es2015-shorthand-properties,transform-object-rest-spread,transform-class-properties -d lib-doc src && ./node_modules/.bin/jsdoc2md --src lib-doc/telegram.js -t README.hbs > README.md",
|
||||
"gen-doc": "./node_modules/.bin/jsdoc2md --src src/telegram.js -t README.hbs > README.md",
|
||||
"eslint": "./node_modules/.bin/eslint ./src"
|
||||
},
|
||||
"author": "Yago Pérez <yagoperezs@gmail.com>",
|
||||
|
@ -14,14 +14,17 @@ const URL = require('url');
|
||||
const fs = require('fs');
|
||||
const pump = require('pump');
|
||||
|
||||
class TelegramBot extends EventEmitter {
|
||||
|
||||
// Telegram message events
|
||||
static messageTypes = [
|
||||
const _messageTypes = [
|
||||
'text', 'audio', 'document', 'photo', 'sticker', 'video', 'voice', 'contact',
|
||||
'location', 'new_chat_participant', 'left_chat_participant', 'new_chat_title',
|
||||
'new_chat_photo', 'delete_chat_photo', 'group_chat_created'
|
||||
];
|
||||
];
|
||||
|
||||
class TelegramBot extends EventEmitter {
|
||||
|
||||
static get messageTypes() {
|
||||
return _messageTypes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Both request method to obtain messages are implemented. To use standard polling, set `polling: true`
|
||||
@ -64,7 +67,7 @@ class TelegramBot extends EventEmitter {
|
||||
this._polling = new TelegramBotPolling(this.token, this.options.polling, this.processUpdate);
|
||||
}
|
||||
|
||||
processUpdate = (update) => {
|
||||
processUpdate(update) {
|
||||
debug('Process Update %j', update);
|
||||
const message = update.message;
|
||||
const inlineQuery = update.inline_query;
|
||||
|
Loading…
x
Reference in New Issue
Block a user