telegram-bot-min

1.0.1 • Public • Published

Telegram Bot API

Install

npm i --save telegram-bot-min

Usage

const TelegramBot = require('telegram-bot-min')
const tgbot = new TelegramBot(token)
const botInfo = await tgbot.getMe()

Init

new TelegramBot(token)

Methods

request(method, data, options[agent]?)

getMe()

getWebhookInfo()

getUpdates(options[offset, limit, timeout, allowedUpdates]?)

getFile(fileId)

getUserProfilePhotos(userId, options[offset, limit]?)

getChat(chatId)

getChatAdministrators(chatId)

getChatMembersCount(chatId)

getChatMember(chatId, userId)

getMyCommands()

getStickerSet(name)

getGameHighScores(chatId, messageId, userId)

getInlineGameHighScores(inlineMessageId, userId)

setWebhook(url, options[certificate, maxConnections, allowedUpdates]?)

deleteWebhook()

sendChatAction(chatId, action)

kickChatMember(chatId, userId, options[untilDate]?)

unbanChatMember(chatId, userId)

restrictChatMember(chatId, userId, permissions, options[untilDate]?)

promoteChatMember(chatId, userId, options[canChangeInfo, canPostMessages, canEditMessages, canDeleteMessages, canInviteUsers, canRestrictMembers, canPinMessages, canPromoteMembers]?)

setChatAdministratorCustomTitle(chatId, userId, customTitle)

removeChatAdministratorCustomTitle(chatId, userId)

setChatPermissions(chatId, permissions)

setChatPhoto(chatId, photo)

deleteChatPhoto(chatId)

setChatTitle(chatId, title)

setChatDescription(chatId, description)

removeChatDescription(chatId)

pinChatMessage(chatId, messageId, options[disableNotification]?)

unpinChatMessage(chatId)

leaveChat(chatId)

setChatStickerSet(chatId, stickerSetName)

deleteChatStickerSet(chatId)

answerCallbackQuery(callbackQueryId, options[text, showAlert, url, cacheTime]?)

setMyCommands(commands)

deleteMessage(chatId, messageId)

createNewStickerSet(userId, name, title, pngSticker, emojis, options[containsMasks, maskPosition]?)

createNewAnimatedStickerSet(userId, name, title, tgsSticker, emojis, options[containsMasks, maskPosition]?)

addStickerToSet(userId, name, pngSticker, emojis, options[maskPosition]?)

addAnimatedStickerToSet(userId, name, tgsSticker, emojis, options[maskPosition]?)

setStickerPositionInSet(sticker, position)

deleteStickerFromSet(sticker)

setStickerSetThumb(userId, name, thumb)

answerInlineQuery(inlineQueryId, results, options[cacheTime, isPersonal, nextOffset, switchPmText, switchPmParameter]?)

answerShippingQuery(shippingQueryId, shippingOptions)

answerShippingQueryError(shippingQueryId, errorMessage)

answerPreCheckoutQuery(preCheckoutQueryId)

answerPreCheckoutQueryError(preCheckoutQueryId, errorMessage)

setPassportDataErrors(userId, errors)

setGameScore(chatId, messageId, userId, score, options[force, disableEditMessage]?)

setInlineGameScore(inlineMessageId, userId, score, options[force, disableEditMessage]?)

sendMessage(chatId, text, options[parseMode, disableWebPagePreview, disableNotification, replyToMessageId, replyMarkup]?)

forwardMessage(fromChatId, messageId, chatId, options[disableNotification]?)

sendPhoto(chatId, photo, options[caption, parseMode, disableNotification, replyToMessageId, replyMarkup]?)

sendAudio(chatId, audio, options[thumb, caption, parseMode, duration, performer, title, disableNotification, replyToMessageId, replyMarkup]?)

sendDocument(chatId, document, options[thumb, caption, parseMode, disableNotification, replyToMessageId, replyMarkup]?)

sendVideo(chatId, video, options[thumb, caption, parseMode, duration, width, height, supportsStreaming, disableNotification, replyToMessageId, replyMarkup]?)

sendAnimation(chatId, animation, options[thumb, caption, parseMode, duration, width, height, disableNotification, replyToMessageId, replyMarkup]?)

sendVoice(chatId, voice, options[caption, parseMode, duration, disableNotification, replyToMessageId, replyMarkup]?)

sendVideoNote(chatId, videoNote, options[thumb, duration, length, disableNotification, replyToMessageId, replyMarkup]?)

sendMediaGroup(chatId, media, options[disableNotification, replyToMessageId]?)

sendLocation(chatId, latitude, longitude, options[livePeriod, disableNotification, replyToMessageId, replyMarkup]?)

editMessageLiveLocation(chatId, messageId, latitude, longitude, options[replyMarkup]?)

editInlineMessageLiveLocation(inlineMessageId, latitude, longitude, options[replyMarkup]?)

stopMessageLiveLocation(chatId, messageId, options[replyMarkup]?)

stopInlineMessageLiveLocation(inlineMessageId, options[replyMarkup]?)

sendVenue(chatId, latitude, longitude, title, address, options[foursquareId, foursquareType, disableNotification, replyToMessageId, replyMarkup]?)

sendContact(chatId, phoneNumber, firstName, options[lastName, vcard, disableNotification, replyToMessageId, replyMarkup]?)

sendPoll(chatId, question, pollOptions, options[isAnonymous, type, allowsMultipleAnswers, correctOptionId, isClosed, disableNotification, replyToMessageId, replyMarkup]?)

sendDice(chatId, options[disableNotification, replyToMessageId, replyMarkup]?)

exportChatInviteLink(chatId)

editMessageText(chatId, messageId, text, options[parseMode, disableWebPagePreview, replyMarkup]?)

editInlineMessageText(inlineMessageId, text, options[parseMode, disableWebPagePreview, replyMarkup]?)

editMessageCaption(chatId, messageId, caption, options[parseMode, replyMarkup]?)

removeMessageCaption(chatId, messageId, options[replyMarkup]?)

editInlineMessageCaption(inlineMessageId, caption, options[parseMode, replyMarkup]?)

removeInlineMessageCaption(inlineMessageId, options[replyMarkup]?)

editMessageMedia(chatId, messageId, media, options[replyMarkup]?)

editInlineMessageMedia(inlineMessageId, media, options[replyMarkup]?)

editMessageReplyMarkup(chatId, messageId, replyMarkup)

removeMessageReplyMarkup(chatId, messageId)

editInlineMessageReplyMarkup(inlineMessageId, replyMarkup)

removeInlineMessageReplyMarkup(inlineMessageId)

stopPoll(chatId, messageId, options[replyMarkup]?)

sendSticker(chatId, sticker, options[disableNotification, replyToMessageId, replyMarkup]?)

uploadStickerFile(userId, pngSticker)

sendInvoice(chatId, title, description, options[payload, providerToken, startParameter, currency, prices, providerData, photoUrl, photoSize, photoWidth, photoHeight, needName, needPhoneNumber, needEmail, needShippingAddress, sendPhoneNumberToProvider, sendEmailToProvider, isFlexible, disableNotification, replyToMessageId, replyMarkup])

sendGame(chatId, gameShortName, options[disableNotification, replyToMessageId, replyMarkup]?)

serialize(data) // from camelCase to snake_case

deserialize(data) // from snake_case to camelCase

Package Sidebar

Install

npm i telegram-bot-min

Weekly Downloads

0

Version

1.0.1

License

MIT

Unpacked Size

40.5 kB

Total Files

6

Last publish

Collaborators

  • pavelwolfdark