From bbac07ad2c730a406fc4ff2a2648c78250cf3ed1 Mon Sep 17 00:00:00 2001 From: GochoMugo Date: Sat, 18 Nov 2017 21:49:34 +0300 Subject: [PATCH] doc: Document TelegramBot.errors, TelegramBot.messageTypes --- CHANGELOG.md | 1 + doc/api.md | 14 ++++++++++++++ src/telegram.js | 9 ++++++++- 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a75a6c0..6035a19 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ Added: 1. Add `metadata` argument in `message` event (and friends e.g. `text`, `audio`, etc.) (#409) (by @jlsjonas, @GochoMugo) 1. Add support for Node.js v9 (by @GochoMugo) +1. Document *TelegramBot.errors*, *TelegramBot.messageTypes* (by @GochoMugo) Changed: diff --git a/doc/api.md b/doc/api.md index 6f3676a..42516c5 100644 --- a/doc/api.md +++ b/doc/api.md @@ -83,6 +83,8 @@ TelegramBot * [.setStickerPositionInSet(sticker, position)](#TelegramBot+setStickerPositionInSet) ⇒ Promise * [.deleteStickerFromSet(sticker)](#TelegramBot+deleteStickerFromSet) ⇒ Promise * _static_ + * [.errors](#TelegramBot.errors) : Object + * [.messageTypes](#TelegramBot.messageTypes) : Array.<String> * [.Promise](#TelegramBot.Promise) @@ -1110,6 +1112,18 @@ Returns True on success. | --- | --- | --- | | sticker | String | File identifier of the sticker | + + +### TelegramBot.errors : Object +The different errors the library uses. + +**Kind**: static property of [TelegramBot](#TelegramBot) + + +### TelegramBot.messageTypes : Array.<String> +The types of message updates the library handles. + +**Kind**: static property of [TelegramBot](#TelegramBot) ### TelegramBot.Promise diff --git a/src/telegram.js b/src/telegram.js index 86c9194..09891a3 100644 --- a/src/telegram.js +++ b/src/telegram.js @@ -74,11 +74,18 @@ if (!process.env.NTBA_FIX_319) { class TelegramBot extends EventEmitter { - + /** + * The different errors the library uses. + * @type {Object} + */ static get errors() { return errors; } + /** + * The types of message updates the library handles. + * @type {String[]} + */ static get messageTypes() { return _messageTypes; }