Comparing version 4.8.2 to 4.9.0-canary.1
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Context = void 0; | ||
const util_1 = require("./util"); | ||
class Context { | ||
@@ -210,7 +211,14 @@ constructor(update, tg, botInfo) { | ||
*/ | ||
reply(...args) { | ||
this.assert(this.chat, 'reply'); | ||
respond(...args) { | ||
this.assert(this.chat, 'respond'); | ||
return this.telegram.sendMessage(this.chat.id, ...args); | ||
} | ||
/** | ||
* @see https://core.telegram.org/bots/api#sendmessage | ||
*/ | ||
reply(...args) { | ||
(0, util_1.deprecate)('ctx.reply', 'reply', 'respond', 'https://telegraf.js.org/experimental#new-reply'); | ||
return this.respond(...args); | ||
} | ||
/** | ||
* @see https://core.telegram.org/bots/api#getchat | ||
@@ -386,3 +394,3 @@ */ | ||
*/ | ||
replyWithPhoto(...args) { | ||
respondWithPhoto(...args) { | ||
this.assert(this.chat, 'replyWithPhoto'); | ||
@@ -392,5 +400,12 @@ return this.telegram.sendPhoto(this.chat.id, ...args); | ||
/** | ||
* @see https://core.telegram.org/bots/api#replywithphoto | ||
*/ | ||
replyWithPhoto(...args) { | ||
(0, util_1.deprecate)('ctx.replyWithPhoto', 'reply', 'respondWithPhoto', 'https://telegraf.js.org/experimental#new-reply'); | ||
return this.respondWithPhoto(...args); | ||
} | ||
/** | ||
* @see https://core.telegram.org/bots/api#replywithmediagroup | ||
*/ | ||
replyWithMediaGroup(...args) { | ||
respondWithMediaGroup(...args) { | ||
this.assert(this.chat, 'replyWithMediaGroup'); | ||
@@ -400,26 +415,54 @@ return this.telegram.sendMediaGroup(this.chat.id, ...args); | ||
/** | ||
* @see https://core.telegram.org/bots/api#replywithmediagroup | ||
*/ | ||
replyWithMediaGroup(...args) { | ||
(0, util_1.deprecate)('ctx.replyWithMediaGroup', 'reply', 'respondWithMediaGroup', 'https://telegraf.js.org/experimental#new-reply'); | ||
return this.respondWithMediaGroup(...args); | ||
} | ||
/** | ||
* @see https://core.telegram.org/bots/api#replywithaudio | ||
*/ | ||
replyWithAudio(...args) { | ||
this.assert(this.chat, 'replyWithAudio'); | ||
respondWithAudio(...args) { | ||
this.assert(this.chat, 'respondWithAudio'); | ||
return this.telegram.sendAudio(this.chat.id, ...args); | ||
} | ||
/** | ||
* @see https://core.telegram.org/bots/api#replywithaudio | ||
*/ | ||
replyWithAudio(...args) { | ||
(0, util_1.deprecate)('ctx.replyWithAudio', 'reply', 'respondWithAudio', 'https://telegraf.js.org/experimental#new-reply'); | ||
return this.respondWithAudio(...args); | ||
} | ||
/** | ||
* @see https://core.telegram.org/bots/api#replywithdice | ||
*/ | ||
replyWithDice(...args) { | ||
this.assert(this.chat, 'replyWithDice'); | ||
respondWithDice(...args) { | ||
this.assert(this.chat, 'respondWithDice'); | ||
return this.telegram.sendDice(this.chat.id, ...args); | ||
} | ||
/** | ||
* @see https://core.telegram.org/bots/api#replywithdice | ||
*/ | ||
replyWithDice(...args) { | ||
(0, util_1.deprecate)('ctx.replyWithDice', 'reply', 'respondWithDice', 'https://telegraf.js.org/experimental#new-reply'); | ||
return this.respondWithDice(...args); | ||
} | ||
/** | ||
* @see https://core.telegram.org/bots/api#replywithdocument | ||
*/ | ||
replyWithDocument(...args) { | ||
this.assert(this.chat, 'replyWithDocument'); | ||
respondWithDocument(...args) { | ||
this.assert(this.chat, 'respondWithDocument'); | ||
return this.telegram.sendDocument(this.chat.id, ...args); | ||
} | ||
/** | ||
* @see https://core.telegram.org/bots/api#replywithdocument | ||
*/ | ||
replyWithDocument(...args) { | ||
(0, util_1.deprecate)('ctx.replyWithDocument', 'reply', 'respondWithDocument', 'https://telegraf.js.org/experimental#new-reply'); | ||
return this.respondWithDocument(...args); | ||
} | ||
/** | ||
* @see https://core.telegram.org/bots/api#replywithsticker | ||
*/ | ||
replyWithSticker(...args) { | ||
respondWithSticker(...args) { | ||
this.assert(this.chat, 'replyWithSticker'); | ||
@@ -429,12 +472,26 @@ return this.telegram.sendSticker(this.chat.id, ...args); | ||
/** | ||
* @see https://core.telegram.org/bots/api#replywithsticker | ||
*/ | ||
replyWithSticker(...args) { | ||
(0, util_1.deprecate)('ctx.replyWithSticker', 'reply', 'respondWithSticker', 'https://telegraf.js.org/experimental#new-reply'); | ||
return this.respondWithSticker(...args); | ||
} | ||
/** | ||
* @see https://core.telegram.org/bots/api#replywithvideo | ||
*/ | ||
replyWithVideo(...args) { | ||
this.assert(this.chat, 'replyWithVideo'); | ||
respondWithVideo(...args) { | ||
this.assert(this.chat, 'respondWithVideo'); | ||
return this.telegram.sendVideo(this.chat.id, ...args); | ||
} | ||
/** | ||
* @see https://core.telegram.org/bots/api#replywithvideo | ||
*/ | ||
replyWithVideo(...args) { | ||
(0, util_1.deprecate)('ctx.replyWithVideo', 'reply', 'respondWithVideo', 'https://telegraf.js.org/experimental#new-reply'); | ||
return this.respondWithVideo(...args); | ||
} | ||
/** | ||
* @see https://core.telegram.org/bots/api#replywithanimation | ||
*/ | ||
replyWithAnimation(...args) { | ||
respondWithAnimation(...args) { | ||
this.assert(this.chat, 'replyWithAnimation'); | ||
@@ -444,44 +501,93 @@ return this.telegram.sendAnimation(this.chat.id, ...args); | ||
/** | ||
* @see https://core.telegram.org/bots/api#replywithanimation | ||
*/ | ||
replyWithAnimation(...args) { | ||
(0, util_1.deprecate)('ctx.replyWithAnimation', 'reply', 'respondWithAnimation', 'https://telegraf.js.org/experimental#new-reply'); | ||
return this.respondWithAnimation(...args); | ||
} | ||
/** | ||
* @see https://core.telegram.org/bots/api#replywithvideonote | ||
*/ | ||
replyWithVideoNote(...args) { | ||
this.assert(this.chat, 'replyWithVideoNote'); | ||
respondWithVideoNote(...args) { | ||
this.assert(this.chat, 'respondWithVideoNote'); | ||
return this.telegram.sendVideoNote(this.chat.id, ...args); | ||
} | ||
/** | ||
* @see https://core.telegram.org/bots/api#replywithvideonote | ||
*/ | ||
replyWithVideoNote(...args) { | ||
(0, util_1.deprecate)('ctx.replyWithVideoNote', 'reply', 'respondWithVideoNote', 'https://telegraf.js.org/experimental#new-reply'); | ||
return this.respondWithVideoNote(...args); | ||
} | ||
/** | ||
* @see https://core.telegram.org/bots/api#replywithinvoice | ||
*/ | ||
replyWithInvoice(...args) { | ||
this.assert(this.chat, 'replyWithInvoice'); | ||
respondWithInvoice(...args) { | ||
this.assert(this.chat, 'respondWithInvoice'); | ||
return this.telegram.sendInvoice(this.chat.id, ...args); | ||
} | ||
/** | ||
* @see https://core.telegram.org/bots/api#replywithinvoice | ||
*/ | ||
replyWithInvoice(...args) { | ||
(0, util_1.deprecate)('ctx.replyWithInvoice', 'reply', 'respondWithInvoice', 'https://telegraf.js.org/experimental#new-reply'); | ||
return this.respondWithInvoice(...args); | ||
} | ||
/** | ||
* @see https://core.telegram.org/bots/api#replywithgame | ||
*/ | ||
replyWithGame(...args) { | ||
this.assert(this.chat, 'replyWithGame'); | ||
respondWithGame(...args) { | ||
this.assert(this.chat, 'respondWithGame'); | ||
return this.telegram.sendGame(this.chat.id, ...args); | ||
} | ||
/** | ||
* @see https://core.telegram.org/bots/api#replywithgame | ||
*/ | ||
replyWithGame(...args) { | ||
(0, util_1.deprecate)('ctx.replyWithGame', 'reply', 'respondWithGame', 'https://telegraf.js.org/experimental#new-reply'); | ||
return this.respondWithGame(...args); | ||
} | ||
/** | ||
* @see https://core.telegram.org/bots/api#replywithvoice | ||
*/ | ||
replyWithVoice(...args) { | ||
this.assert(this.chat, 'replyWithVoice'); | ||
respondWithVoice(...args) { | ||
this.assert(this.chat, 'respondWithVoice'); | ||
return this.telegram.sendVoice(this.chat.id, ...args); | ||
} | ||
/** | ||
* @see https://core.telegram.org/bots/api#replywithvoice | ||
*/ | ||
replyWithVoice(...args) { | ||
(0, util_1.deprecate)('ctx.replyWithVoice', 'reply', 'respondWithVoice', 'https://telegraf.js.org/experimental#new-reply'); | ||
return this.respondWithVoice(...args); | ||
} | ||
/** | ||
* @see https://core.telegram.org/bots/api#replywithpoll | ||
*/ | ||
replyWithPoll(...args) { | ||
this.assert(this.chat, 'replyWithPoll'); | ||
respondWithPoll(...args) { | ||
this.assert(this.chat, 'respondWithPoll'); | ||
return this.telegram.sendPoll(this.chat.id, ...args); | ||
} | ||
/** | ||
* @see https://core.telegram.org/bots/api#replywithpoll | ||
*/ | ||
replyWithPoll(...args) { | ||
(0, util_1.deprecate)('ctx.replyWithPoll', 'reply', 'respondWithPoll', 'https://telegraf.js.org/experimental#new-reply'); | ||
return this.respondWithPoll(...args); | ||
} | ||
/** | ||
* @see https://core.telegram.org/bots/api#replywithquiz | ||
*/ | ||
replyWithQuiz(...args) { | ||
this.assert(this.chat, 'replyWithQuiz'); | ||
respondWithQuiz(...args) { | ||
this.assert(this.chat, 'respondWithQuiz'); | ||
return this.telegram.sendQuiz(this.chat.id, ...args); | ||
} | ||
/** | ||
* @see https://core.telegram.org/bots/api#replywithquiz | ||
*/ | ||
replyWithQuiz(...args) { | ||
(0, util_1.deprecate)('ctx.replyWithQuiz', 'reply', 'respondWithQuiz', 'https://telegraf.js.org/experimental#new-reply'); | ||
return this.respondWithQuiz(...args); | ||
} | ||
/** | ||
* @see https://core.telegram.org/bots/api#stoppoll | ||
@@ -496,28 +602,56 @@ */ | ||
*/ | ||
replyWithChatAction(...args) { | ||
this.assert(this.chat, 'replyWithChatAction'); | ||
respondWithChatAction(...args) { | ||
this.assert(this.chat, 'respondWithChatAction'); | ||
return this.telegram.sendChatAction(this.chat.id, ...args); | ||
} | ||
/** | ||
* @see https://core.telegram.org/bots/api#replywithchataction | ||
*/ | ||
replyWithChatAction(...args) { | ||
(0, util_1.deprecate)('ctx.replyWithChatAction', 'reply', 'respondWithChatAction'); | ||
return this.respondWithChatAction(...args); | ||
} | ||
/** | ||
* @see https://core.telegram.org/bots/api#replywithlocation | ||
*/ | ||
replyWithLocation(...args) { | ||
this.assert(this.chat, 'replyWithLocation'); | ||
respondWithLocation(...args) { | ||
this.assert(this.chat, 'respondWithLocation'); | ||
return this.telegram.sendLocation(this.chat.id, ...args); | ||
} | ||
/** | ||
* @see https://core.telegram.org/bots/api#replywithlocation | ||
*/ | ||
replyWithLocation(...args) { | ||
(0, util_1.deprecate)('ctx.replyWithLocation', 'reply', 'respondWithLocation', 'https://telegraf.js.org/experimental#new-reply'); | ||
return this.respondWithLocation(...args); | ||
} | ||
/** | ||
* @see https://core.telegram.org/bots/api#replywithvenue | ||
*/ | ||
replyWithVenue(...args) { | ||
this.assert(this.chat, 'replyWithVenue'); | ||
respondWithVenue(...args) { | ||
this.assert(this.chat, 'respondWithVenue'); | ||
return this.telegram.sendVenue(this.chat.id, ...args); | ||
} | ||
/** | ||
* @see https://core.telegram.org/bots/api#replywithvenue | ||
*/ | ||
replyWithVenue(...args) { | ||
(0, util_1.deprecate)('ctx.replyWithVenue', 'reply', 'respondWithVenue', 'https://telegraf.js.org/experimental#new-reply'); | ||
return this.respondWithVenue(...args); | ||
} | ||
/** | ||
* @see https://core.telegram.org/bots/api#replywithcontact | ||
*/ | ||
replyWithContact(...args) { | ||
this.assert(this.chat, 'replyWithContact'); | ||
respondWithContact(...args) { | ||
this.assert(this.chat, 'respondWithContact'); | ||
return this.telegram.sendContact(this.chat.id, ...args); | ||
} | ||
/** | ||
* @see https://core.telegram.org/bots/api#replywithcontact | ||
*/ | ||
replyWithContact(...args) { | ||
(0, util_1.deprecate)('ctx.replyWithContact', 'reply', 'respondWithContact', 'https://telegraf.js.org/experimental#new-reply'); | ||
return this.respondWithContact(...args); | ||
} | ||
/** | ||
* @deprecated use {@link Telegram.getStickerSet} | ||
@@ -524,0 +658,0 @@ * @see https://core.telegram.org/bots/api#getstickerset |
{ | ||
"name": "telegraf", | ||
"version": "4.8.2", | ||
"version": "4.9.0-canary.1", | ||
"description": "Modern Telegram Bot Framework", | ||
@@ -18,2 +18,3 @@ "license": "MIT", | ||
".": "./lib/index.js", | ||
"./future": "./future.js", | ||
"./types": "./types.js" | ||
@@ -32,2 +33,13 @@ }, | ||
}, | ||
"scripts": { | ||
"prepare": "npm run --silent build", | ||
"build": "tsc --build docs/examples", | ||
"build:docs": "typedoc src/index.ts", | ||
"pretest": "npm run build", | ||
"test": "ava test/*", | ||
"lint": "eslint .", | ||
"checks": "npm test && npm run lint", | ||
"refresh": "npm run clean && npm ci", | ||
"clean": "git clean -fX .eslintcache docs/build/ lib/ typings/" | ||
}, | ||
"type": "commonjs", | ||
@@ -76,13 +88,3 @@ "engines": { | ||
"bot framework" | ||
], | ||
"scripts": { | ||
"build": "tsc --build docs/examples", | ||
"build:docs": "typedoc src/index.ts", | ||
"pretest": "npm run build", | ||
"test": "ava test/*", | ||
"lint": "eslint .", | ||
"checks": "npm test && npm run lint", | ||
"refresh": "npm run clean && npm ci", | ||
"clean": "git clean -fX .eslintcache docs/build/ lib/ typings/" | ||
} | ||
} | ||
] | ||
} |
@@ -5,2 +5,3 @@ import * as tg from './core/types/typegram' | ||
import ApiClient from './core/network/client' | ||
import { deprecate } from './util' | ||
import Telegram from './telegram' | ||
@@ -354,4 +355,4 @@ | ||
*/ | ||
reply(this: Context, ...args: Shorthand<'sendMessage'>) { | ||
this.assert(this.chat, 'reply') | ||
respond(this: Context, ...args: Shorthand<'sendMessage'>) { | ||
this.assert(this.chat, 'respond') | ||
return this.telegram.sendMessage(this.chat.id, ...args) | ||
@@ -361,2 +362,15 @@ } | ||
/** | ||
* @see https://core.telegram.org/bots/api#sendmessage | ||
*/ | ||
reply(this: Context, ...args: Shorthand<'sendMessage'>) { | ||
deprecate( | ||
'ctx.reply', | ||
'reply', | ||
'respond', | ||
'https://telegraf.js.org/experimental#new-reply' | ||
) | ||
return this.respond(...args) | ||
} | ||
/** | ||
* @see https://core.telegram.org/bots/api#getchat | ||
@@ -580,3 +594,3 @@ */ | ||
*/ | ||
replyWithPhoto(this: Context, ...args: Shorthand<'sendPhoto'>) { | ||
respondWithPhoto(this: Context, ...args: Shorthand<'sendPhoto'>) { | ||
this.assert(this.chat, 'replyWithPhoto') | ||
@@ -587,5 +601,18 @@ return this.telegram.sendPhoto(this.chat.id, ...args) | ||
/** | ||
* @see https://core.telegram.org/bots/api#replywithphoto | ||
*/ | ||
replyWithPhoto(this: Context, ...args: Shorthand<'sendPhoto'>) { | ||
deprecate( | ||
'ctx.replyWithPhoto', | ||
'reply', | ||
'respondWithPhoto', | ||
'https://telegraf.js.org/experimental#new-reply' | ||
) | ||
return this.respondWithPhoto(...args) | ||
} | ||
/** | ||
* @see https://core.telegram.org/bots/api#replywithmediagroup | ||
*/ | ||
replyWithMediaGroup(this: Context, ...args: Shorthand<'sendMediaGroup'>) { | ||
respondWithMediaGroup(this: Context, ...args: Shorthand<'sendMediaGroup'>) { | ||
this.assert(this.chat, 'replyWithMediaGroup') | ||
@@ -596,6 +623,19 @@ return this.telegram.sendMediaGroup(this.chat.id, ...args) | ||
/** | ||
* @see https://core.telegram.org/bots/api#replywithmediagroup | ||
*/ | ||
replyWithMediaGroup(this: Context, ...args: Shorthand<'sendMediaGroup'>) { | ||
deprecate( | ||
'ctx.replyWithMediaGroup', | ||
'reply', | ||
'respondWithMediaGroup', | ||
'https://telegraf.js.org/experimental#new-reply' | ||
) | ||
return this.respondWithMediaGroup(...args) | ||
} | ||
/** | ||
* @see https://core.telegram.org/bots/api#replywithaudio | ||
*/ | ||
replyWithAudio(this: Context, ...args: Shorthand<'sendAudio'>) { | ||
this.assert(this.chat, 'replyWithAudio') | ||
respondWithAudio(this: Context, ...args: Shorthand<'sendAudio'>) { | ||
this.assert(this.chat, 'respondWithAudio') | ||
return this.telegram.sendAudio(this.chat.id, ...args) | ||
@@ -605,6 +645,19 @@ } | ||
/** | ||
* @see https://core.telegram.org/bots/api#replywithaudio | ||
*/ | ||
replyWithAudio(this: Context, ...args: Shorthand<'sendAudio'>) { | ||
deprecate( | ||
'ctx.replyWithAudio', | ||
'reply', | ||
'respondWithAudio', | ||
'https://telegraf.js.org/experimental#new-reply' | ||
) | ||
return this.respondWithAudio(...args) | ||
} | ||
/** | ||
* @see https://core.telegram.org/bots/api#replywithdice | ||
*/ | ||
replyWithDice(this: Context, ...args: Shorthand<'sendDice'>) { | ||
this.assert(this.chat, 'replyWithDice') | ||
respondWithDice(this: Context, ...args: Shorthand<'sendDice'>) { | ||
this.assert(this.chat, 'respondWithDice') | ||
return this.telegram.sendDice(this.chat.id, ...args) | ||
@@ -614,6 +667,19 @@ } | ||
/** | ||
* @see https://core.telegram.org/bots/api#replywithdice | ||
*/ | ||
replyWithDice(this: Context, ...args: Shorthand<'sendDice'>) { | ||
deprecate( | ||
'ctx.replyWithDice', | ||
'reply', | ||
'respondWithDice', | ||
'https://telegraf.js.org/experimental#new-reply' | ||
) | ||
return this.respondWithDice(...args) | ||
} | ||
/** | ||
* @see https://core.telegram.org/bots/api#replywithdocument | ||
*/ | ||
replyWithDocument(this: Context, ...args: Shorthand<'sendDocument'>) { | ||
this.assert(this.chat, 'replyWithDocument') | ||
respondWithDocument(this: Context, ...args: Shorthand<'sendDocument'>) { | ||
this.assert(this.chat, 'respondWithDocument') | ||
return this.telegram.sendDocument(this.chat.id, ...args) | ||
@@ -623,5 +689,18 @@ } | ||
/** | ||
* @see https://core.telegram.org/bots/api#replywithdocument | ||
*/ | ||
replyWithDocument(this: Context, ...args: Shorthand<'sendDocument'>) { | ||
deprecate( | ||
'ctx.replyWithDocument', | ||
'reply', | ||
'respondWithDocument', | ||
'https://telegraf.js.org/experimental#new-reply' | ||
) | ||
return this.respondWithDocument(...args) | ||
} | ||
/** | ||
* @see https://core.telegram.org/bots/api#replywithsticker | ||
*/ | ||
replyWithSticker(this: Context, ...args: Shorthand<'sendSticker'>) { | ||
respondWithSticker(this: Context, ...args: Shorthand<'sendSticker'>) { | ||
this.assert(this.chat, 'replyWithSticker') | ||
@@ -632,6 +711,19 @@ return this.telegram.sendSticker(this.chat.id, ...args) | ||
/** | ||
* @see https://core.telegram.org/bots/api#replywithsticker | ||
*/ | ||
replyWithSticker(this: Context, ...args: Shorthand<'sendSticker'>) { | ||
deprecate( | ||
'ctx.replyWithSticker', | ||
'reply', | ||
'respondWithSticker', | ||
'https://telegraf.js.org/experimental#new-reply' | ||
) | ||
return this.respondWithSticker(...args) | ||
} | ||
/** | ||
* @see https://core.telegram.org/bots/api#replywithvideo | ||
*/ | ||
replyWithVideo(this: Context, ...args: Shorthand<'sendVideo'>) { | ||
this.assert(this.chat, 'replyWithVideo') | ||
respondWithVideo(this: Context, ...args: Shorthand<'sendVideo'>) { | ||
this.assert(this.chat, 'respondWithVideo') | ||
return this.telegram.sendVideo(this.chat.id, ...args) | ||
@@ -641,5 +733,18 @@ } | ||
/** | ||
* @see https://core.telegram.org/bots/api#replywithvideo | ||
*/ | ||
replyWithVideo(this: Context, ...args: Shorthand<'sendAudio'>) { | ||
deprecate( | ||
'ctx.replyWithVideo', | ||
'reply', | ||
'respondWithVideo', | ||
'https://telegraf.js.org/experimental#new-reply' | ||
) | ||
return this.respondWithVideo(...args) | ||
} | ||
/** | ||
* @see https://core.telegram.org/bots/api#replywithanimation | ||
*/ | ||
replyWithAnimation(this: Context, ...args: Shorthand<'sendAnimation'>) { | ||
respondWithAnimation(this: Context, ...args: Shorthand<'sendAnimation'>) { | ||
this.assert(this.chat, 'replyWithAnimation') | ||
@@ -650,6 +755,19 @@ return this.telegram.sendAnimation(this.chat.id, ...args) | ||
/** | ||
* @see https://core.telegram.org/bots/api#replywithanimation | ||
*/ | ||
replyWithAnimation(this: Context, ...args: Shorthand<'sendAnimation'>) { | ||
deprecate( | ||
'ctx.replyWithAnimation', | ||
'reply', | ||
'respondWithAnimation', | ||
'https://telegraf.js.org/experimental#new-reply' | ||
) | ||
return this.respondWithAnimation(...args) | ||
} | ||
/** | ||
* @see https://core.telegram.org/bots/api#replywithvideonote | ||
*/ | ||
replyWithVideoNote(this: Context, ...args: Shorthand<'sendVideoNote'>) { | ||
this.assert(this.chat, 'replyWithVideoNote') | ||
respondWithVideoNote(this: Context, ...args: Shorthand<'sendVideoNote'>) { | ||
this.assert(this.chat, 'respondWithVideoNote') | ||
return this.telegram.sendVideoNote(this.chat.id, ...args) | ||
@@ -659,6 +777,19 @@ } | ||
/** | ||
* @see https://core.telegram.org/bots/api#replywithvideonote | ||
*/ | ||
replyWithVideoNote(this: Context, ...args: Shorthand<'sendVideoNote'>) { | ||
deprecate( | ||
'ctx.replyWithVideoNote', | ||
'reply', | ||
'respondWithVideoNote', | ||
'https://telegraf.js.org/experimental#new-reply' | ||
) | ||
return this.respondWithVideoNote(...args) | ||
} | ||
/** | ||
* @see https://core.telegram.org/bots/api#replywithinvoice | ||
*/ | ||
replyWithInvoice(this: Context, ...args: Shorthand<'sendInvoice'>) { | ||
this.assert(this.chat, 'replyWithInvoice') | ||
respondWithInvoice(this: Context, ...args: Shorthand<'sendInvoice'>) { | ||
this.assert(this.chat, 'respondWithInvoice') | ||
return this.telegram.sendInvoice(this.chat.id, ...args) | ||
@@ -668,6 +799,19 @@ } | ||
/** | ||
* @see https://core.telegram.org/bots/api#replywithinvoice | ||
*/ | ||
replyWithInvoice(this: Context, ...args: Shorthand<'sendInvoice'>) { | ||
deprecate( | ||
'ctx.replyWithInvoice', | ||
'reply', | ||
'respondWithInvoice', | ||
'https://telegraf.js.org/experimental#new-reply' | ||
) | ||
return this.respondWithInvoice(...args) | ||
} | ||
/** | ||
* @see https://core.telegram.org/bots/api#replywithgame | ||
*/ | ||
replyWithGame(this: Context, ...args: Shorthand<'sendGame'>) { | ||
this.assert(this.chat, 'replyWithGame') | ||
respondWithGame(this: Context, ...args: Shorthand<'sendGame'>) { | ||
this.assert(this.chat, 'respondWithGame') | ||
return this.telegram.sendGame(this.chat.id, ...args) | ||
@@ -677,6 +821,19 @@ } | ||
/** | ||
* @see https://core.telegram.org/bots/api#replywithgame | ||
*/ | ||
replyWithGame(this: Context, ...args: Shorthand<'sendGame'>) { | ||
deprecate( | ||
'ctx.replyWithGame', | ||
'reply', | ||
'respondWithGame', | ||
'https://telegraf.js.org/experimental#new-reply' | ||
) | ||
return this.respondWithGame(...args) | ||
} | ||
/** | ||
* @see https://core.telegram.org/bots/api#replywithvoice | ||
*/ | ||
replyWithVoice(this: Context, ...args: Shorthand<'sendVoice'>) { | ||
this.assert(this.chat, 'replyWithVoice') | ||
respondWithVoice(this: Context, ...args: Shorthand<'sendVoice'>) { | ||
this.assert(this.chat, 'respondWithVoice') | ||
return this.telegram.sendVoice(this.chat.id, ...args) | ||
@@ -686,6 +843,19 @@ } | ||
/** | ||
* @see https://core.telegram.org/bots/api#replywithvoice | ||
*/ | ||
replyWithVoice(this: Context, ...args: Shorthand<'sendVoice'>) { | ||
deprecate( | ||
'ctx.replyWithVoice', | ||
'reply', | ||
'respondWithVoice', | ||
'https://telegraf.js.org/experimental#new-reply' | ||
) | ||
return this.respondWithVoice(...args) | ||
} | ||
/** | ||
* @see https://core.telegram.org/bots/api#replywithpoll | ||
*/ | ||
replyWithPoll(this: Context, ...args: Shorthand<'sendPoll'>) { | ||
this.assert(this.chat, 'replyWithPoll') | ||
respondWithPoll(this: Context, ...args: Shorthand<'sendPoll'>) { | ||
this.assert(this.chat, 'respondWithPoll') | ||
return this.telegram.sendPoll(this.chat.id, ...args) | ||
@@ -695,6 +865,19 @@ } | ||
/** | ||
* @see https://core.telegram.org/bots/api#replywithpoll | ||
*/ | ||
replyWithPoll(this: Context, ...args: Shorthand<'sendPoll'>) { | ||
deprecate( | ||
'ctx.replyWithPoll', | ||
'reply', | ||
'respondWithPoll', | ||
'https://telegraf.js.org/experimental#new-reply' | ||
) | ||
return this.respondWithPoll(...args) | ||
} | ||
/** | ||
* @see https://core.telegram.org/bots/api#replywithquiz | ||
*/ | ||
replyWithQuiz(this: Context, ...args: Shorthand<'sendQuiz'>) { | ||
this.assert(this.chat, 'replyWithQuiz') | ||
respondWithQuiz(this: Context, ...args: Shorthand<'sendQuiz'>) { | ||
this.assert(this.chat, 'respondWithQuiz') | ||
return this.telegram.sendQuiz(this.chat.id, ...args) | ||
@@ -704,2 +887,15 @@ } | ||
/** | ||
* @see https://core.telegram.org/bots/api#replywithquiz | ||
*/ | ||
replyWithQuiz(this: Context, ...args: Shorthand<'sendQuiz'>) { | ||
deprecate( | ||
'ctx.replyWithQuiz', | ||
'reply', | ||
'respondWithQuiz', | ||
'https://telegraf.js.org/experimental#new-reply' | ||
) | ||
return this.respondWithQuiz(...args) | ||
} | ||
/** | ||
* @see https://core.telegram.org/bots/api#stoppoll | ||
@@ -715,4 +911,4 @@ */ | ||
*/ | ||
replyWithChatAction(this: Context, ...args: Shorthand<'sendChatAction'>) { | ||
this.assert(this.chat, 'replyWithChatAction') | ||
respondWithChatAction(this: Context, ...args: Shorthand<'sendChatAction'>) { | ||
this.assert(this.chat, 'respondWithChatAction') | ||
return this.telegram.sendChatAction(this.chat.id, ...args) | ||
@@ -722,6 +918,14 @@ } | ||
/** | ||
* @see https://core.telegram.org/bots/api#replywithchataction | ||
*/ | ||
replyWithChatAction(this: Context, ...args: Shorthand<'sendChatAction'>) { | ||
deprecate('ctx.replyWithChatAction', 'reply', 'respondWithChatAction') | ||
return this.respondWithChatAction(...args) | ||
} | ||
/** | ||
* @see https://core.telegram.org/bots/api#replywithlocation | ||
*/ | ||
replyWithLocation(this: Context, ...args: Shorthand<'sendLocation'>) { | ||
this.assert(this.chat, 'replyWithLocation') | ||
respondWithLocation(this: Context, ...args: Shorthand<'sendLocation'>) { | ||
this.assert(this.chat, 'respondWithLocation') | ||
return this.telegram.sendLocation(this.chat.id, ...args) | ||
@@ -731,6 +935,19 @@ } | ||
/** | ||
* @see https://core.telegram.org/bots/api#replywithlocation | ||
*/ | ||
replyWithLocation(this: Context, ...args: Shorthand<'sendLocation'>) { | ||
deprecate( | ||
'ctx.replyWithLocation', | ||
'reply', | ||
'respondWithLocation', | ||
'https://telegraf.js.org/experimental#new-reply' | ||
) | ||
return this.respondWithLocation(...args) | ||
} | ||
/** | ||
* @see https://core.telegram.org/bots/api#replywithvenue | ||
*/ | ||
replyWithVenue(this: Context, ...args: Shorthand<'sendVenue'>) { | ||
this.assert(this.chat, 'replyWithVenue') | ||
respondWithVenue(this: Context, ...args: Shorthand<'sendVenue'>) { | ||
this.assert(this.chat, 'respondWithVenue') | ||
return this.telegram.sendVenue(this.chat.id, ...args) | ||
@@ -740,6 +957,19 @@ } | ||
/** | ||
* @see https://core.telegram.org/bots/api#replywithvenue | ||
*/ | ||
replyWithVenue(this: Context, ...args: Shorthand<'sendVenue'>) { | ||
deprecate( | ||
'ctx.replyWithVenue', | ||
'reply', | ||
'respondWithVenue', | ||
'https://telegraf.js.org/experimental#new-reply' | ||
) | ||
return this.respondWithVenue(...args) | ||
} | ||
/** | ||
* @see https://core.telegram.org/bots/api#replywithcontact | ||
*/ | ||
replyWithContact(this: Context, ...args: Shorthand<'sendContact'>) { | ||
this.assert(this.chat, 'replyWithContact') | ||
respondWithContact(this: Context, ...args: Shorthand<'sendContact'>) { | ||
this.assert(this.chat, 'respondWithContact') | ||
return this.telegram.sendContact(this.chat.id, ...args) | ||
@@ -749,2 +979,15 @@ } | ||
/** | ||
* @see https://core.telegram.org/bots/api#replywithcontact | ||
*/ | ||
replyWithContact(this: Context, ...args: Shorthand<'sendContact'>) { | ||
deprecate( | ||
'ctx.replyWithContact', | ||
'reply', | ||
'respondWithContact', | ||
'https://telegraf.js.org/experimental#new-reply' | ||
) | ||
return this.respondWithContact(...args) | ||
} | ||
/** | ||
* @deprecated use {@link Telegram.getStickerSet} | ||
@@ -751,0 +994,0 @@ * @see https://core.telegram.org/bots/api#getstickerset |
@@ -80,3 +80,3 @@ import * as tg from './core/types/typegram'; | ||
*/ | ||
editMessageMedia(this: Context, media: tg.InputMedia, extra?: tt.ExtraEditMessageMedia): Promise<true | (tg.Update.Edited & tg.Message.AnimationMessage) | (tg.Update.Edited & tg.Message.DocumentMessage) | (tg.Update.Edited & tg.Message.AudioMessage) | (tg.Update.Edited & tg.Message.PhotoMessage) | (tg.Update.Edited & tg.Message.VideoMessage)>; | ||
editMessageMedia(this: Context, media: tg.InputMedia, extra?: tt.ExtraEditMessageMedia): Promise<true | (tg.Update.Edited & tg.Message.AnimationMessage) | (tg.Update.Edited & tg.Message.AudioMessage) | (tg.Update.Edited & tg.Message.DocumentMessage) | (tg.Update.Edited & tg.Message.PhotoMessage) | (tg.Update.Edited & tg.Message.VideoMessage)>; | ||
/** | ||
@@ -97,2 +97,6 @@ * @see https://core.telegram.org/bots/api#editmessagereplymarkup | ||
*/ | ||
respond(this: Context, ...args: Shorthand<'sendMessage'>): Promise<tg.Message.TextMessage>; | ||
/** | ||
* @see https://core.telegram.org/bots/api#sendmessage | ||
*/ | ||
reply(this: Context, ...args: Shorthand<'sendMessage'>): Promise<tg.Message.TextMessage>; | ||
@@ -199,2 +203,6 @@ /** | ||
*/ | ||
respondWithPhoto(this: Context, ...args: Shorthand<'sendPhoto'>): Promise<tg.Message.PhotoMessage>; | ||
/** | ||
* @see https://core.telegram.org/bots/api#replywithphoto | ||
*/ | ||
replyWithPhoto(this: Context, ...args: Shorthand<'sendPhoto'>): Promise<tg.Message.PhotoMessage>; | ||
@@ -204,2 +212,6 @@ /** | ||
*/ | ||
respondWithMediaGroup(this: Context, ...args: Shorthand<'sendMediaGroup'>): Promise<(tg.Message.DocumentMessage | tg.Message.AudioMessage | tg.Message.PhotoMessage | tg.Message.VideoMessage)[]>; | ||
/** | ||
* @see https://core.telegram.org/bots/api#replywithmediagroup | ||
*/ | ||
replyWithMediaGroup(this: Context, ...args: Shorthand<'sendMediaGroup'>): Promise<(tg.Message.DocumentMessage | tg.Message.AudioMessage | tg.Message.PhotoMessage | tg.Message.VideoMessage)[]>; | ||
@@ -209,2 +221,6 @@ /** | ||
*/ | ||
respondWithAudio(this: Context, ...args: Shorthand<'sendAudio'>): Promise<tg.Message.AudioMessage>; | ||
/** | ||
* @see https://core.telegram.org/bots/api#replywithaudio | ||
*/ | ||
replyWithAudio(this: Context, ...args: Shorthand<'sendAudio'>): Promise<tg.Message.AudioMessage>; | ||
@@ -214,2 +230,6 @@ /** | ||
*/ | ||
respondWithDice(this: Context, ...args: Shorthand<'sendDice'>): Promise<tg.Message.DiceMessage>; | ||
/** | ||
* @see https://core.telegram.org/bots/api#replywithdice | ||
*/ | ||
replyWithDice(this: Context, ...args: Shorthand<'sendDice'>): Promise<tg.Message.DiceMessage>; | ||
@@ -219,2 +239,6 @@ /** | ||
*/ | ||
respondWithDocument(this: Context, ...args: Shorthand<'sendDocument'>): Promise<tg.Message.DocumentMessage>; | ||
/** | ||
* @see https://core.telegram.org/bots/api#replywithdocument | ||
*/ | ||
replyWithDocument(this: Context, ...args: Shorthand<'sendDocument'>): Promise<tg.Message.DocumentMessage>; | ||
@@ -224,2 +248,6 @@ /** | ||
*/ | ||
respondWithSticker(this: Context, ...args: Shorthand<'sendSticker'>): Promise<tg.Message.StickerMessage>; | ||
/** | ||
* @see https://core.telegram.org/bots/api#replywithsticker | ||
*/ | ||
replyWithSticker(this: Context, ...args: Shorthand<'sendSticker'>): Promise<tg.Message.StickerMessage>; | ||
@@ -229,6 +257,14 @@ /** | ||
*/ | ||
replyWithVideo(this: Context, ...args: Shorthand<'sendVideo'>): Promise<tg.Message.VideoMessage>; | ||
respondWithVideo(this: Context, ...args: Shorthand<'sendVideo'>): Promise<tg.Message.VideoMessage>; | ||
/** | ||
* @see https://core.telegram.org/bots/api#replywithvideo | ||
*/ | ||
replyWithVideo(this: Context, ...args: Shorthand<'sendAudio'>): Promise<tg.Message.VideoMessage>; | ||
/** | ||
* @see https://core.telegram.org/bots/api#replywithanimation | ||
*/ | ||
respondWithAnimation(this: Context, ...args: Shorthand<'sendAnimation'>): Promise<tg.Message.AnimationMessage>; | ||
/** | ||
* @see https://core.telegram.org/bots/api#replywithanimation | ||
*/ | ||
replyWithAnimation(this: Context, ...args: Shorthand<'sendAnimation'>): Promise<tg.Message.AnimationMessage>; | ||
@@ -238,2 +274,6 @@ /** | ||
*/ | ||
respondWithVideoNote(this: Context, ...args: Shorthand<'sendVideoNote'>): Promise<tg.Message.VideoNoteMessage>; | ||
/** | ||
* @see https://core.telegram.org/bots/api#replywithvideonote | ||
*/ | ||
replyWithVideoNote(this: Context, ...args: Shorthand<'sendVideoNote'>): Promise<tg.Message.VideoNoteMessage>; | ||
@@ -243,2 +283,6 @@ /** | ||
*/ | ||
respondWithInvoice(this: Context, ...args: Shorthand<'sendInvoice'>): Promise<tg.Message.InvoiceMessage>; | ||
/** | ||
* @see https://core.telegram.org/bots/api#replywithinvoice | ||
*/ | ||
replyWithInvoice(this: Context, ...args: Shorthand<'sendInvoice'>): Promise<tg.Message.InvoiceMessage>; | ||
@@ -248,2 +292,6 @@ /** | ||
*/ | ||
respondWithGame(this: Context, ...args: Shorthand<'sendGame'>): Promise<tg.Message.GameMessage>; | ||
/** | ||
* @see https://core.telegram.org/bots/api#replywithgame | ||
*/ | ||
replyWithGame(this: Context, ...args: Shorthand<'sendGame'>): Promise<tg.Message.GameMessage>; | ||
@@ -253,2 +301,6 @@ /** | ||
*/ | ||
respondWithVoice(this: Context, ...args: Shorthand<'sendVoice'>): Promise<tg.Message.VoiceMessage>; | ||
/** | ||
* @see https://core.telegram.org/bots/api#replywithvoice | ||
*/ | ||
replyWithVoice(this: Context, ...args: Shorthand<'sendVoice'>): Promise<tg.Message.VoiceMessage>; | ||
@@ -258,2 +310,6 @@ /** | ||
*/ | ||
respondWithPoll(this: Context, ...args: Shorthand<'sendPoll'>): Promise<tg.Message.PollMessage>; | ||
/** | ||
* @see https://core.telegram.org/bots/api#replywithpoll | ||
*/ | ||
replyWithPoll(this: Context, ...args: Shorthand<'sendPoll'>): Promise<tg.Message.PollMessage>; | ||
@@ -263,2 +319,6 @@ /** | ||
*/ | ||
respondWithQuiz(this: Context, ...args: Shorthand<'sendQuiz'>): Promise<tg.Message.PollMessage>; | ||
/** | ||
* @see https://core.telegram.org/bots/api#replywithquiz | ||
*/ | ||
replyWithQuiz(this: Context, ...args: Shorthand<'sendQuiz'>): Promise<tg.Message.PollMessage>; | ||
@@ -272,2 +332,6 @@ /** | ||
*/ | ||
respondWithChatAction(this: Context, ...args: Shorthand<'sendChatAction'>): Promise<true>; | ||
/** | ||
* @see https://core.telegram.org/bots/api#replywithchataction | ||
*/ | ||
replyWithChatAction(this: Context, ...args: Shorthand<'sendChatAction'>): Promise<true>; | ||
@@ -277,2 +341,6 @@ /** | ||
*/ | ||
respondWithLocation(this: Context, ...args: Shorthand<'sendLocation'>): Promise<tg.Message.LocationMessage>; | ||
/** | ||
* @see https://core.telegram.org/bots/api#replywithlocation | ||
*/ | ||
replyWithLocation(this: Context, ...args: Shorthand<'sendLocation'>): Promise<tg.Message.LocationMessage>; | ||
@@ -282,2 +350,6 @@ /** | ||
*/ | ||
respondWithVenue(this: Context, ...args: Shorthand<'sendVenue'>): Promise<tg.Message.VenueMessage>; | ||
/** | ||
* @see https://core.telegram.org/bots/api#replywithvenue | ||
*/ | ||
replyWithVenue(this: Context, ...args: Shorthand<'sendVenue'>): Promise<tg.Message.VenueMessage>; | ||
@@ -287,2 +359,6 @@ /** | ||
*/ | ||
respondWithContact(this: Context, ...args: Shorthand<'sendContact'>): Promise<tg.Message.ContactMessage>; | ||
/** | ||
* @see https://core.telegram.org/bots/api#replywithcontact | ||
*/ | ||
replyWithContact(this: Context, ...args: Shorthand<'sendContact'>): Promise<tg.Message.ContactMessage>; | ||
@@ -289,0 +365,0 @@ /** |
Sorry, the diff of this file is not supported yet
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
481760
125
10407
1
1