Class: BotAPI

bot-api~BotAPI(token) → {BotAPI}

new BotAPI(token) → {BotAPI}

JavaScript implemention for Telegram Bot API.

Parameters:
Name Type Description
token String

Telegram Bot token.

Source:
Returns:
Type
BotAPI
Example
new BotAPI(token)

Members

token

Properties:
Name Type Description
token String

Telegram Bot token.

version String

Telegram Bot API version.

Source:

Methods

addStickerToSet(userID, name, pngSticker, tgsSticker, emojis, optsopt) → {Promise.<Boolean>}

Parameters:
Name Type Attributes Description
userID Number

Telegram user ID for sticker set owner.

name String
pngSticker String | Object

File ID, sticker URL or InputFile.

tgsSticker String | Object

InputFile.

emojis String

One or more emoji corresponding to the sticker.

opts Object <optional>

Optional Telegram patameters.

Properties
Name Type Attributes Description
maskPosition String <optional>

JSON-serialized MaskPosition.

Source:
See:
Returns:
Type
Promise.<Boolean>

answerCallbackQuery(callbackQueryID) → {Promise.<Boolean>}

Parameters:
Name Type Description
callbackQueryID String

Target Telegram callback query ID.

Source:
See:
Returns:
Type
Promise.<Boolean>

answerInlineQuery(inlineQueryID, results, optsopt) → {Promise.<Boolean>}

Parameters:
Name Type Attributes Description
inlineQueryID String

Target inline query ID.

results String

JSON-serialized Array of InlineQueryResult.

opts Object <optional>

Optional Telegram patameters.

Source:
See:
Returns:
Type
Promise.<Boolean>

answerPreCheckoutQuery(preCheckoutQueryID, ok, optsopt) → {Promise.<Boolean>}

Parameters:
Name Type Attributes Description
preCheckoutQueryID String

Target pre checkout query ID.

ok Boolean
opts Object <optional>

Optional Telegram patameters.

Source:
See:
Returns:
Type
Promise.<Boolean>

answerShippingQuery(shippingQueryID, ok, optsopt) → {Promise.<Boolean>}

Parameters:
Name Type Attributes Description
shippingQueryID String

Target shipping query ID.

ok Boolean
opts Object <optional>

Optional Telegram patameters.

Properties
Name Type Attributes Description
shippingOptions String <optional>

JSON-serialized Array of ShippingOption.

Source:
See:
Returns:
Type
Promise.<Boolean>

createNewStickerSet(userID, name, title, pngSticker, tgsSticker, emojis, optsopt) → {Promise.<Boolean>}

Parameters:
Name Type Attributes Description
userID Number

Telegram user ID for created sticker set owner.

name String

Short name of sticker set.

title String

Sticker set title.

pngSticker String | Object

File ID, sticker URL or InputFile.

tgsSticker String | Object

InputFile.

emojis String

One or more emoji corresponding to the sticker.

opts Object <optional>

Optional Telegram patameters.

Properties
Name Type Attributes Description
maskPosition String <optional>

JSON-serialized MaskPosition.

Source:
See:
Returns:
Type
Promise.<Boolean>

deleteChatPhoto(chatID) → {Promise.<Boolean>}

Parameters:
Name Type Description
chatID Number | String

Target Telegram chat ID.

Source:
See:
Returns:
Type
Promise.<Boolean>

deleteChatStickerSet(chatID) → {Promise.<Boolean>}

Parameters:
Name Type Description
chatID Number | String

Target Telegram chat ID.

Source:
See:
Returns:
Type
Promise.<Boolean>

deleteMessage(chatID, messageID) → {Promise.<Boolean>}

Parameters:
Name Type Description
chatID Number | String

Target Telegram chat ID.

messageID Number | String

Target Telegram message ID.

Source:
See:
Returns:
Type
Promise.<Boolean>

deleteStickerFromSet(sticker) → {Promise.<Boolean>}

Parameters:
Name Type Description
sticker String

File ID of the sticker.

Source:
See:
Returns:
Type
Promise.<Boolean>

deleteWebhook() → {Promise.<Boolean>}

Source:
See:
Returns:
Type
Promise.<Boolean>

editMessageCaption(optsopt) → {Promise.<Message>}

Parameters:
Name Type Attributes Description
opts Object <optional>

Optional Telegram patameters.

Properties
Name Type Attributes Description
replyMarkup String <optional>

JSON-serialized InlineKeyboardMarkupp .

chatID Number <optional>

Required if inlineMessageID is not given.

messageID Number <optional>

Required if inlineMessageID is not given.

inlineMessageID String <optional>

Required if chatID and inlineMessageID are not given.

Source:
See:
Returns:
Type
Promise.<Message>

editMessageLiveLocation(latitude, longitude, optsopt) → {Promise.<Message>}

Parameters:
Name Type Attributes Description
latitude Number
longitude Number
opts Object <optional>

Optional Telegram patameters.

Properties
Name Type Attributes Description
replyMarkup String <optional>

JSON-serialized InlineKeyboardMarkupp.

chatID Number <optional>

Required if inlineMessageID is not given.

messageID Number <optional>

Required if inlineMessageID is not given.

inlineMessageID String <optional>

Required if chatID and inlineMessageID are not given.

Source:
See:
Returns:
Type
Promise.<Message>

editMessageMedia(media, optsopt) → {Promise.<Message>}

Parameters:
Name Type Attributes Description
media InputMedia

Set InputMedia.media or InputMedia.thumb to Buffer for uploading a file.

opts Object <optional>

Optional Telegram patameters.

Properties
Name Type Attributes Description
replyMarkup String <optional>

JSON-serialized InlineKeyboardMarkupp.

chatID Number <optional>

Required if inlineMessageID is not given.

messageID Number <optional>

Required if inlineMessageID is not given.

inlineMessageID String <optional>

Required if chatID and inlineMessageID are not given.

Source:
See:
Returns:
Type
Promise.<Message>

editMessageReplyMarkup(optsopt) → {Promise.<Message>}

Parameters:
Name Type Attributes Description
opts Object <optional>

Optional Telegram patameters.

Properties
Name Type Attributes Description
replyMarkup String <optional>

JSON-serialized InlineKeyboardMarkupp.

chatID Number <optional>

Required if inlineMessageID is not given.

messageID Number <optional>

Required if inlineMessageID is not given.

inlineMessageID String <optional>

Required if chatID and inlineMessageID are not given.

Source:
See:
Returns:
Type
Promise.<Message>

editMessageText(text, opts) → {Promise.<Message>}

Parameters:
Name Type Description
text String

Message content.

opts Object

Optional Telegram patameters.

Properties
Name Type Attributes Description
replyMarkup String <optional>

JSON-serialized InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply.

chatID Number <optional>

Required if inlineMessageID is not given.

messageID Number <optional>

Required if inlineMessageID is not given.

inlineMessageID String <optional>

Required if chatID and inlineMessageID are not given.

Source:
See:
Returns:
Type
Promise.<Message>
Parameters:
Name Type Description
chatID Number | String

Target Telegram chat ID.

Source:
See:
Returns:
Type
Promise.<String>

forwardMessage(chatID, fromChatID, messageID, optsopt) → {Promise.<Message>}

Parameters:
Name Type Attributes Description
chatID Number | String

Target Telegram chat ID.

fromChatID Number | String

Source Telegram chat ID.

messageID Number

Message ID.

opts Object <optional>

Optional Telegram patameters.

Source:
See:
Returns:
Type
Promise.<Message>

getChat(chatID) → {Promise.<Chat>}

Parameters:
Name Type Description
chatID Number | String

Target Telegram chat ID.

Source:
See:
Returns:
Type
Promise.<Chat>

getChatAdministrators(chatID) → {Promise.<Array.<ChatMember>>}

Parameters:
Name Type Description
chatID Number | String

Target Telegram chat ID.

Source:
See:
Returns:
Type
Promise.<Array.<ChatMember>>

getChatMember(chatID, userID) → {Promise.<ChatMember>}

Parameters:
Name Type Description
chatID Number | String

Target Telegram chat ID.

userID Number

Target Telegram user ID.

Source:
See:
Returns:
Type
Promise.<ChatMember>

getChatMembersCount(chatID) → {Promise.<Number>}

Parameters:
Name Type Description
chatID Number | String

Target Telegram chat ID.

Source:
See:
Returns:
Type
Promise.<Number>

getFile(fileID) → {Promise.<File>}

Parameters:
Name Type Description
fileID Number | String

Target Telegram file ID.

Source:
See:
Returns:
Type
Promise.<File>

getGameHighScores(userID, optsopt) → {Promise.<Array.<GameHighScore>>}

Parameters:
Name Type Attributes Description
userID Number

Target Telegram user ID.

opts Object <optional>

Optional Telegram patameters.

Properties
Name Type Attributes Description
chatID Number <optional>

Required if inlineMessageID is not given.

messageID Number <optional>

Required if inlineMessageID is not given.

inlineMessageID String <optional>

Required if chatID and inlineMessageID are not given.

Source:
See:
Returns:
Type
Promise.<Array.<GameHighScore>>

getMe() → {Promise.<User>}

Source:
See:
Returns:
Type
Promise.<User>

getMyCommands() → {Promise.<Array.<BotCommand>>}

Source:
See:
Returns:
Type
Promise.<Array.<BotCommand>>

getStickerSet(name) → {Promise.<StickerSet>}

Parameters:
Name Type Description
name String
Source:
See:
Returns:
Type
Promise.<StickerSet>

getUpdates(optsopt) → {Promise.<Array.<Update>>}

Parameters:
Name Type Attributes Description
opts Object <optional>

Optional Telegram patameters.

Source:
See:
Returns:
Type
Promise.<Array.<Update>>

getUserProfilePhotos(userID, optsopt) → {Promise.<UserProfilePhotos>}

Parameters:
Name Type Attributes Description
userID Number

Target Telegram user ID.

opts Object <optional>

Optional Telegram patameters.

Source:
See:
Returns:
Type
Promise.<UserProfilePhotos>

getWebhookInfo() → {Promise.<WebHookInfo>}

Source:
See:
Returns:
Type
Promise.<WebHookInfo>

isBotAPI(o) → {Boolean}

Parameters:
Name Type Description
o *
Source:
Returns:
Type
Boolean

kickChatMember(chatID, userID, optsopt) → {Promise.<Boolean>}

Parameters:
Name Type Attributes Description
chatID Number | String

Target Telegram chat ID.

userID Number

Target Telegram user ID.

opts Object <optional>

Optional Telegram patameters.

Source:
See:
Returns:
Type
Promise.<Boolean>

leaveChat(chatID) → {Promise.<Boolean>}

Parameters:
Name Type Description
chatID Number | String

Target Telegram chat ID.

Source:
See:
Returns:
Type
Promise.<Boolean>

pinChatMessage(chatID, messageID, optsopt) → {Promise.<Boolean>}

Parameters:
Name Type Attributes Description
chatID Number | String

Target Telegram chat ID.

messageID Number | String

Target Telegram message ID.

opts Object <optional>

Optional Telegram patameters.

Source:
See:
Returns:
Type
Promise.<Boolean>

promoteChatMember(chatID, userID, optsopt) → {Promise.<Boolean>}

Parameters:
Name Type Attributes Description
chatID Number | String

Target Telegram chat ID.

userID Number

Target Telegram user ID.

opts Object <optional>

Optional Telegram patameters.

Source:
See:
Returns:
Type
Promise.<Boolean>

restrictChatMember(chatID, userID, permissions, optsopt) → {Promise.<Boolean>}

Parameters:
Name Type Attributes Description
chatID Number | String

Target Telegram chat ID.

userID Number

Target Telegram user ID.

permissions String

JSON-serialized ChatPermissions.

opts Object <optional>

Optional Telegram patameters.

Source:
See:
Returns:
Type
Promise.<Boolean>

sendAnimation(chatID, animation, optsopt) → {Promise.<Message>}

Parameters:
Name Type Attributes Description
chatID Number | String

Target Telegram chat ID.

animation String | Object

File ID, animation URL or InputFile.

opts Object <optional>

Optional Telegram patameters.

Properties
Name Type Attributes Description
replyMarkup String <optional>

JSON-serialized InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply.

thumb String | Object <optional>

Thumb URL or InputFile.

Source:
See:
Returns:
Type
Promise.<Message>

sendAudio(chatID, audio, optsopt) → {Promise.<Message>}

Parameters:
Name Type Attributes Description
chatID Number | String

Target Telegram chat ID.

audio String | Object

File ID, audio URL or InputFile.

opts Object <optional>

Optional Telegram patameters.

Properties
Name Type Attributes Description
replyMarkup String <optional>

JSON-serialized InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply.

thumb String | Object <optional>

Thumb URL or InputFile.

Source:
See:
Returns:
Type
Promise.<Message>

sendChatAction(chatID, action) → {Promise.<Message>}

Parameters:
Name Type Description
chatID Number | String

Target Telegram chat ID.

action String
Source:
See:
Returns:
Type
Promise.<Message>

sendContact(chatID, phoneNumber, firstName, optsopt) → {Promise.<Message>}

Parameters:
Name Type Attributes Description
chatID Number | String

Target Telegram chat ID.

phoneNumber String

User's phone number.

firstName String

User's first name.

opts Object <optional>

Optional Telegram patameters.

Properties
Name Type Attributes Description
replyMarkup String <optional>

JSON-serialized InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply.

Source:
See:
Returns:
Type
Promise.<Message>

sendDice(chatID, optsopt) → {Promise.<Message>}

Parameters:
Name Type Attributes Description
chatID Number | String

Target Telegram chat ID.

opts Object <optional>

Optional Telegram patameters.

Properties
Name Type Attributes Description
replyMarkup String <optional>

JSON-serialized InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply.

Source:
See:
Returns:
Type
Promise.<Message>

sendDocument(chatID, document, optsopt) → {Promise.<Message>}

Parameters:
Name Type Attributes Description
chatID Number | String

Target Telegram chat ID.

document String | Object

File ID, document URL or InputFile.

opts Object <optional>

Optional Telegram patameters.

Properties
Name Type Attributes Description
replyMarkup String <optional>

JSON-serialized InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply.

thumb String | Object <optional>

Thumb URL or InputFile.

Source:
See:
Returns:
Type
Promise.<Message>

sendGame(chatID, gameShortName, optsopt) → {Promise.<Message>}

Parameters:
Name Type Attributes Description
chatID Number | String

Target Telegram chat ID.

gameShortName String

Short name of the game.

opts Object <optional>

Optional Telegram patameters.

Properties
Name Type Attributes Description
replyMarkup String <optional>

JSON-serialized InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply.

Source:
See:
Returns:
Type
Promise.<Message>

sendInvoice(chatID, title, description, payload, providerToken, startParameter, currency, prices, optsopt) → {Promise.<Message>}

Parameters:
Name Type Attributes Description
chatID Number | String

Target Telegram chat ID.

title String

Product name.

description String

Product description.

payload String

Bot-defined internal invoice payload.

providerToken String

Payments provider token.

startParameter String

Unique deep-linking parameter used to generate this invoice as a start parameter.

currency String

Three-letter ISO 4217 currency code.

prices String

Price breakdown, a list of components.

opts Object <optional>

Optional Telegram patameters.

Properties
Name Type Attributes Description
replyMarkup String <optional>

JSON-serialized InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply.

Source:
See:
Returns:
Type
Promise.<Message>

sendLocation(chatID, latitude, longitude, optsopt) → {Promise.<Message>}

Parameters:
Name Type Attributes Description
chatID Number | String

Target Telegram chat ID.

latitude Number
longitude Number
opts Object <optional>

Optional Telegram patameters.

Properties
Name Type Attributes Description
replyMarkup String <optional>

JSON-serialized InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply.

Source:
See:
Returns:
Type
Promise.<Message>

sendMediaGroup(chatID, media, optsopt) → {Promise.<Message>}

Parameters:
Name Type Attributes Description
chatID Number | String

Target Telegram chat ID.

media Array.<InputMedia>

Set InputMedia.media or InputMedia.thumb to InputFile for uploading a file.

opts Object <optional>

Optional Telegram patameters.

Source:
See:
Returns:
Type
Promise.<Message>

sendMessage(chatID, text, optsopt) → {Promise.<Message>}

Parameters:
Name Type Attributes Description
chatID Number | String

Telegram chat ID.

text String

Message content.

opts Object <optional>

Optional Telegram patameters.

Properties
Name Type Attributes Description
replyMarkup String <optional>

JSON-serialized InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply.

Source:
See:
Returns:
Type
Promise.<Message>

sendPhoto(chatID, photo, optsopt) → {Promise.<Message>}

Parameters:
Name Type Attributes Description
chatID Number | String

Target Telegram chat ID.

photo String | Object

File ID, photo URL or InputFile.

opts Object <optional>

Optional Telegram patameters.

Properties
Name Type Attributes Description
replyMarkup String <optional>

JSON-serialized InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply.

Source:
See:
Returns:
Type
Promise.<Message>

sendPoll(chatID, question, options, optsopt) → {Promise.<Message>}

Parameters:
Name Type Attributes Description
chatID Number | String

Target Telegram chat ID.

question String
options String

JSON-serialized Array of String.

opts Object <optional>

Optional Telegram patameters.

Properties
Name Type Attributes Description
replyMarkup String <optional>

JSON-serialized InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply.

Source:
See:
Returns:
Type
Promise.<Message>

sendSticker(chatID, sticker, optsopt) → {Promise.<Message>}

Parameters:
Name Type Attributes Description
chatID Number | String

Target Telegram chat ID.

sticker String | Object

File ID, sticker URL or InputFile.

opts Object <optional>

Optional Telegram patameters.

Properties
Name Type Attributes Description
replyMarkup String <optional>

JSON-serialized InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply.

Source:
See:
Returns:
Type
Promise.<Message>

sendVenue(chatID, latitude, longitude, title, address, optsopt) → {Promise.<Message>}

Parameters:
Name Type Attributes Description
chatID Number | String

Target Telegram chat ID.

latitude Number
longitude Number
title String
address String
opts Object <optional>

Optional Telegram patameters.

Properties
Name Type Attributes Description
replyMarkup String <optional>

JSON-serialized InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply.

Source:
See:
Returns:
Type
Promise.<Message>

sendVideo(chatID, video, optsopt) → {Promise.<Message>}

Parameters:
Name Type Attributes Description
chatID Number | String

Target Telegram chat ID.

video String | Object

File ID, video URL or InputFile.

opts Object <optional>

Optional Telegram patameters.

Properties
Name Type Attributes Description
replyMarkup String <optional>

JSON-serialized InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply.

thumb String | Object <optional>

Thumb URL or InputFile.

Source:
See:
Returns:
Type
Promise.<Message>

sendVideoNote(chatID, videoNote, optsopt) → {Promise.<Message>}

Parameters:
Name Type Attributes Description
chatID Number | String

Target Telegram chat ID.

videoNote String | Object

File ID, video note URL or InputFile.

opts Object <optional>

Optional Telegram patameters.

Properties
Name Type Attributes Description
replyMarkup String <optional>

JSON-serialized InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply.

thumb String | Object <optional>

Thumb URL or InputFile.

Source:
See:
Returns:
Type
Promise.<Message>

sendVoice(chatID, voice, optsopt) → {Promise.<Message>}

Parameters:
Name Type Attributes Description
chatID Number | String

Target Telegram chat ID.

voice String | Object

File ID, voice URL or InputFile.

opts Object <optional>

Optional Telegram patameters.

Properties
Name Type Attributes Description
replyMarkup String <optional>

JSON-serialized InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply.

Source:
See:
Returns:
Type
Promise.<Message>

setChatAdministratorCustomTitle(chatID, userID, customTitle) → {Promise.<Boolean>}

Parameters:
Name Type Description
chatID Number | String

Target Telegram chat ID.

userID Number

Target Telegram user ID.

customTitle String
Source:
See:
Returns:
Type
Promise.<Boolean>

setChatDescription(chatID, description) → {Promise.<Boolean>}

Parameters:
Name Type Description
chatID Number | String

Target Telegram chat ID.

description String
Source:
See:
Returns:
Type
Promise.<Boolean>

setChatPermissions(chatID, permissions) → {Promise.<Boolean>}

Parameters:
Name Type Description
chatID Number | String

Target Telegram chat ID.

permissions String

JSON-serialized ChatPermissions.

Source:
See:
Returns:
Type
Promise.<Boolean>

setChatPhoto(chatID, photo) → {Promise.<Boolean>}

Parameters:
Name Type Description
chatID Number | String

Target Telegram chat ID.

photo Object

InputFile.

Source:
See:
Returns:
Type
Promise.<Boolean>

setChatStickerSet(chatID, stickerSetName) → {Promise.<Boolean>}

Parameters:
Name Type Description
chatID Number | String

Target Telegram chat ID.

stickerSetName String
Source:
See:
Returns:
Type
Promise.<Boolean>

setChatTitle(chatID, title) → {Promise.<Boolean>}

Parameters:
Name Type Description
chatID Number | String

Target Telegram chat ID.

title String
Source:
See:
Returns:
Type
Promise.<Boolean>

setGameScore(userID, score, optsopt) → {Promise.<(Message|Boolean|Error)>}

Parameters:
Name Type Attributes Description
userID Number

Target Telegram user ID.

score Number

New non-negative score.

opts Object <optional>

Optional Telegram patameters.

Properties
Name Type Attributes Description
chatID Number <optional>

Required if inlineMessageID is not given.

messageID Number <optional>

Required if inlineMessageID is not given.

inlineMessageID String <optional>

Required if chatID and inlineMessageID are not given.

Source:
See:
Returns:
Type
Promise.<(Message|Boolean|Error)>

setMyCommands(commands) → {Promise.<Boolean>}

Parameters:
Name Type Description
commands String

JSON-serialized Array of BotCommand.

Source:
See:
Returns:
Type
Promise.<Boolean>

setPassportDataErrors(userID, errors) → {Promise.<Boolean>}

Parameters:
Name Type Description
userID String

Target Telegram user ID.

errors String

JSON-serialized Array of PassportElementError.

Source:
See:
Returns:
Type
Promise.<Boolean>

setStickerPositionInSet(sticker, position) → {Promise.<Boolean>}

Parameters:
Name Type Description
sticker String

File ID of the sticker.

position Number

New sticker position in the set, zero-based.

Source:
See:
Returns:
Type
Promise.<Boolean>

setStickerSetThumb(name, userID, thumb) → {Promise.<Boolean>}

Parameters:
Name Type Description
name String

Sticker set name.

userID Number

Telegram user ID of the sticker set owner.

thumb String | Object

File ID, sticker URL or InputFile.

Source:
See:
Returns:
Type
Promise.<Boolean>

setWebhook(url, optsopt) → {Promise.<Boolean>}

Parameters:
Name Type Attributes Description
url String
opts Object <optional>

Optional Telegram patameters.

Source:
See:
Returns:
Type
Promise.<Boolean>

stopMessageLiveLocation(optsopt) → {Promise.<Message>}

Parameters:
Name Type Attributes Description
opts Object <optional>

Optional Telegram patameters.

Properties
Name Type Attributes Description
replyMarkup String <optional>

JSON-serialized InlineKeyboardMarkupp.

chatID Number <optional>

Required if inlineMessageID is not given.

messageID Number <optional>

Required if inlineMessageID is not given.

inlineMessageID String <optional>

Required if chatID and inlineMessageID are not given.

Source:
See:
Returns:
Type
Promise.<Message>

stopPoll(chatID, messageID, optsopt) → {Promise.<Poll>}

Parameters:
Name Type Attributes Description
chatID Number | String

Target Telegram chat ID.

messageID Number | String

Target Telegram message ID.

opts Object <optional>

Optional Telegram patameters.

Properties
Name Type Attributes Description
replyMarkup String <optional>

JSON-serialized InlineKeyboardMarkupp.

Source:
See:
Returns:
Type
Promise.<Poll>

unbanChatMember(chatID, userID) → {Promise.<Boolean>}

Parameters:
Name Type Description
chatID Number | String

Target Telegram chat ID.

userID Number

Target Telegram user ID.

Source:
See:
Returns:
Type
Promise.<Boolean>

unpinChatMessage(chatID) → {Promise.<Boolean>}

Parameters:
Name Type Description
chatID Number | String

Target Telegram chat ID.

Source:
See:
Returns:
Type
Promise.<Boolean>

uploadStickerFile(userID, pngSticker) → {Promise.<Message>}

Parameters:
Name Type Description
userID Number

Telegram user ID of sticker file.

pngSticker Object

Sticker InputFile.

Source:
See:
Returns:
Type
Promise.<Message>