// Type definitions for node-telegram-bot-api 0.28 // Project: https://github.com/yagop/node-telegram-bot-api // Definitions by: Alex Muench // Agadar // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.1 /// import { EventEmitter } from 'events'; import { Stream } from "stream"; declare class TelegramBot extends EventEmitter { constructor(token: string, opts?: any); startPolling(options?: any): Promise; initPolling(options?: any): Promise; stopPolling(): Promise; isPolling(): boolean; openWebHook(): Promise; closeWebHook(): Promise; hasOpenWebHook(): boolean; getMe(): Promise; setWebHook(url: string, options?: any): Promise; deleteWebHook(): Promise; getWebHookInfo(): Promise; getUpdates(options?: any): Promise; processUpdate(update: any): void; sendMessage(chatId: number | string, text: string, options?: any): Promise; answerInlineQuery(inlineQueryId: string, results: any[], options?: any): Promise; forwardMessage(chatId: number | string, fromChatId: number | string, messageId: number | string, options?: any): Promise; sendPhoto(chatId: number | string, photo: string | Stream | Buffer, options?: any): Promise; sendAudio(chatId: number | string, audio: string | Stream | Buffer, options?: any): Promise; sendDocument(chatId: number | string, doc: string | Stream | Buffer, options?: any, fileOpts?: any): Promise; sendSticker(chatId: number | string, sticker: string | Stream | Buffer, options?: any): Promise; sendVideo(chatId: number | string, video: string | Stream | Buffer, options?: any): Promise; sendVideoNote(chatId: number | string, videoNote: string | Stream | Buffer, options?: any): Promise; sendVoice(chatId: number | string, voice: string | Stream | Buffer, options?: any): Promise; sendChatAction(chatId: number | string, action: string): Promise; kickChatMember(chatId: number | string, userId: string): Promise; unbanChatMember(chatId: number | string, userId: string): Promise; restrictChatMember(chatId: number | string, userId: string, options?: any): Promise; promoteChatMember(chatId: number | string, userId: string, options?: any): Promise; exportChatInviteLink(chatId: number | string): Promise; sendChatPhoto(chatId: number | string, photo: string | Stream | Buffer): Promise; deleteChatPhoto(chatId: number | string): Promise; setChatTitle(chatId: number | string, title: string): Promise; setChatDescription(chatId: number | string, description: string): Promise; pinChatMessage(chatId: number | string, messageId: string): Promise; unpinChatMessage(chatId: number | string): Promise; answerCallbackQuery(options?: any): Promise; editMessageText(text: string, options?: any): Promise; editMessageCaption(caption: string, options?: any): Promise; editMessageReplyMarkup(replyMarkup: any, options?: any): Promise; getUserProfilePhotos(userId: number | string, options?: any): Promise; sendLocation(chatId: number | string, latitude: number, longitude: number, options?: any): Promise; sendVenue(chatId: number | string, latitude: number, longitude: number, title: string, address: string, options?: any): Promise; sendContact(chatId: number | string, phoneNumber: string, firstName: string, options?: any): Promise; getFile(fileId: string): Promise; getFileLink(fileId: string): Promise; downloadFile(fileId: string, downloadDir: string): Promise; onText(regexp: RegExp, callback: ((msg: any, match: any[]) => void)): void; removeTextListener(regexp: RegExp): any; onReplyToMessage(chatId: number | string, messageId: number | string, callback: ((msg: any) => void)): number; removeReplyListener(replyListenerId: number): any; getChat(chatId: number | string): Promise; getChatAdministrators(chatId: number | string): Promise; getChatMembersCount(chatId: number | string): Promise; getChatMember(chatId: number | string, userId: string): Promise; leaveChat(chatId: number | string): Promise; sendGame(chatId: number | string, gameShortName: string, options?: any): Promise; setGameScore(userId: string, score: number, options?: any): Promise; getGameHighScores(userId: string, options?: any): Promise; deleteMessage(chatId: number | string, messageId: string, options?: any): Promise; sendInvoice(chatId: number | string, title: string, description: string, payload: string, providerToken: string, startParameter: string, currency: string, prices: any[], options?: any): Promise; answerShippingQuery(shippingQueryId: string, ok: boolean, options?: any): Promise; answerPreCheckoutQuery(preCheckoutQueryId: string, ok: boolean, options?: any): Promise; } export = TelegramBot;