upd
This commit is contained in:
36
node_modules/telegraf/typings/button.d.ts
generated
vendored
Normal file
36
node_modules/telegraf/typings/button.d.ts
generated
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
import { InlineKeyboardButton, KeyboardButton, KeyboardButtonRequestChat, KeyboardButtonRequestUsers } from './core/types/typegram';
|
||||
type Hideable<B> = B & {
|
||||
hide: boolean;
|
||||
};
|
||||
export declare function text(text: string, hide?: boolean): Hideable<KeyboardButton.CommonButton>;
|
||||
export declare function contactRequest(text: string, hide?: boolean): Hideable<KeyboardButton.RequestContactButton>;
|
||||
export declare function locationRequest(text: string, hide?: boolean): Hideable<KeyboardButton.RequestLocationButton>;
|
||||
export declare function pollRequest(text: string, type?: 'quiz' | 'regular', hide?: boolean): Hideable<KeyboardButton.RequestPollButton>;
|
||||
export declare function userRequest(text: string,
|
||||
/** Must fit in a signed 32 bit int */
|
||||
request_id: number, extra?: Omit<KeyboardButtonRequestUsers, 'request_id' | 'text'>, hide?: boolean): Hideable<KeyboardButton.RequestUsersButton>;
|
||||
export declare function botRequest(text: string,
|
||||
/** Must fit in a signed 32 bit int */
|
||||
request_id: number, extra?: Omit<KeyboardButtonRequestUsers, 'request_id' | 'user_is_bot' | 'text'>, hide?: boolean): Hideable<KeyboardButton.RequestUsersButton>;
|
||||
type KeyboardButtonRequestGroup = Omit<KeyboardButtonRequestChat, 'request_id' | 'chat_is_channel'>;
|
||||
export declare function groupRequest(text: string,
|
||||
/** Must fit in a signed 32 bit int */
|
||||
request_id: number, extra?: KeyboardButtonRequestGroup, hide?: boolean): Hideable<KeyboardButton.RequestChatButton>;
|
||||
type KeyboardButtonRequestChannel = Omit<KeyboardButtonRequestChat, 'request_id' | 'chat_is_channel' | 'chat_is_forum'>;
|
||||
export declare function channelRequest(text: string,
|
||||
/** Must fit in a signed 32 bit int */
|
||||
request_id: number, extra?: KeyboardButtonRequestChannel, hide?: boolean): Hideable<KeyboardButton.RequestChatButton>;
|
||||
export declare function url(text: string, url: string, hide?: boolean): Hideable<InlineKeyboardButton.UrlButton>;
|
||||
export declare function callback(text: string, data: string, hide?: boolean): Hideable<InlineKeyboardButton.CallbackButton>;
|
||||
export declare function switchToChat(text: string, value: string, hide?: boolean): Hideable<InlineKeyboardButton.SwitchInlineButton>;
|
||||
export declare function switchToCurrentChat(text: string, value: string, hide?: boolean): Hideable<InlineKeyboardButton.SwitchInlineCurrentChatButton>;
|
||||
export declare function game(text: string, hide?: boolean): Hideable<InlineKeyboardButton.GameButton>;
|
||||
export declare function pay(text: string, hide?: boolean): Hideable<InlineKeyboardButton.PayButton>;
|
||||
export declare function login(text: string, url: string, opts?: {
|
||||
forward_text?: string;
|
||||
bot_username?: string;
|
||||
request_write_access?: boolean;
|
||||
}, hide?: boolean): Hideable<InlineKeyboardButton.LoginButton>;
|
||||
export declare function webApp(text: string, url: string, hide?: boolean): Hideable<InlineKeyboardButton.WebAppButton>;
|
||||
export {};
|
||||
//# sourceMappingURL=button.d.ts.map
|
||||
1
node_modules/telegraf/typings/button.d.ts.map
generated
vendored
Normal file
1
node_modules/telegraf/typings/button.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../src/button.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,cAAc,EACd,yBAAyB,EACzB,0BAA0B,EAC3B,MAAM,uBAAuB,CAAA;AAE9B,KAAK,QAAQ,CAAC,CAAC,IAAI,CAAC,GAAG;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,CAAA;AAExC,wBAAgB,IAAI,CAClB,IAAI,EAAE,MAAM,EACZ,IAAI,UAAQ,GACX,QAAQ,CAAC,cAAc,CAAC,YAAY,CAAC,CAEvC;AAED,wBAAgB,cAAc,CAC5B,IAAI,EAAE,MAAM,EACZ,IAAI,UAAQ,GACX,QAAQ,CAAC,cAAc,CAAC,oBAAoB,CAAC,CAE/C;AAED,wBAAgB,eAAe,CAC7B,IAAI,EAAE,MAAM,EACZ,IAAI,UAAQ,GACX,QAAQ,CAAC,cAAc,CAAC,qBAAqB,CAAC,CAEhD;AAED,wBAAgB,WAAW,CACzB,IAAI,EAAE,MAAM,EACZ,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,EACzB,IAAI,UAAQ,GACX,QAAQ,CAAC,cAAc,CAAC,iBAAiB,CAAC,CAE5C;AAED,wBAAgB,WAAW,CACzB,IAAI,EAAE,MAAM;AACZ,sCAAsC;AACtC,UAAU,EAAE,MAAM,EAClB,KAAK,CAAC,EAAE,IAAI,CAAC,0BAA0B,EAAE,YAAY,GAAG,MAAM,CAAC,EAC/D,IAAI,UAAQ,GACX,QAAQ,CAAC,cAAc,CAAC,kBAAkB,CAAC,CAM7C;AAED,wBAAgB,UAAU,CACxB,IAAI,EAAE,MAAM;AACZ,sCAAsC;AACtC,UAAU,EAAE,MAAM,EAClB,KAAK,CAAC,EAAE,IAAI,CACV,0BAA0B,EAC1B,YAAY,GAAG,aAAa,GAAG,MAAM,CACtC,EACD,IAAI,UAAQ,GACX,QAAQ,CAAC,cAAc,CAAC,kBAAkB,CAAC,CAM7C;AAED,KAAK,0BAA0B,GAAG,IAAI,CACpC,yBAAyB,EACzB,YAAY,GAAG,iBAAiB,CACjC,CAAA;AAED,wBAAgB,YAAY,CAC1B,IAAI,EAAE,MAAM;AACZ,sCAAsC;AACtC,UAAU,EAAE,MAAM,EAClB,KAAK,CAAC,EAAE,0BAA0B,EAClC,IAAI,UAAQ,GACX,QAAQ,CAAC,cAAc,CAAC,iBAAiB,CAAC,CAM5C;AAED,KAAK,4BAA4B,GAAG,IAAI,CACtC,yBAAyB,EACzB,YAAY,GAAG,iBAAiB,GAAG,eAAe,CACnD,CAAA;AAED,wBAAgB,cAAc,CAC5B,IAAI,EAAE,MAAM;AACZ,sCAAsC;AACtC,UAAU,EAAE,MAAM,EAClB,KAAK,CAAC,EAAE,4BAA4B,EACpC,IAAI,UAAQ,GACX,QAAQ,CAAC,cAAc,CAAC,iBAAiB,CAAC,CAM5C;AAED,wBAAgB,GAAG,CACjB,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,MAAM,EACX,IAAI,UAAQ,GACX,QAAQ,CAAC,oBAAoB,CAAC,SAAS,CAAC,CAE1C;AAED,wBAAgB,QAAQ,CACtB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,IAAI,UAAQ,GACX,QAAQ,CAAC,oBAAoB,CAAC,cAAc,CAAC,CAE/C;AAED,wBAAgB,YAAY,CAC1B,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EACb,IAAI,UAAQ,GACX,QAAQ,CAAC,oBAAoB,CAAC,kBAAkB,CAAC,CAEnD;AAED,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EACb,IAAI,UAAQ,GACX,QAAQ,CAAC,oBAAoB,CAAC,6BAA6B,CAAC,CAE9D;AAED,wBAAgB,IAAI,CAClB,IAAI,EAAE,MAAM,EACZ,IAAI,UAAQ,GACX,QAAQ,CAAC,oBAAoB,CAAC,UAAU,CAAC,CAE3C;AAED,wBAAgB,GAAG,CACjB,IAAI,EAAE,MAAM,EACZ,IAAI,UAAQ,GACX,QAAQ,CAAC,oBAAoB,CAAC,SAAS,CAAC,CAE1C;AAED,wBAAgB,KAAK,CACnB,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,MAAM,EACX,IAAI,GAAE;IACJ,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,oBAAoB,CAAC,EAAE,OAAO,CAAA;CAC1B,EACN,IAAI,UAAQ,GACX,QAAQ,CAAC,oBAAoB,CAAC,WAAW,CAAC,CAM5C;AAED,wBAAgB,MAAM,CACpB,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,MAAM,EACX,IAAI,UAAQ,GAEX,QAAQ,CAAC,oBAAoB,CAAC,YAAY,CAAC,CAM7C"}
|
||||
227
node_modules/telegraf/typings/composer.d.ts
generated
vendored
Normal file
227
node_modules/telegraf/typings/composer.d.ts
generated
vendored
Normal file
@@ -0,0 +1,227 @@
|
||||
/** @format */
|
||||
import * as tg from './core/types/typegram';
|
||||
import * as tt from './telegram-types';
|
||||
import { Middleware, MiddlewareFn, MiddlewareObj } from './middleware';
|
||||
import Context, { FilteredContext, NarrowedContext } from './context';
|
||||
import { MaybeArray, NonemptyReadonlyArray, MaybePromise, Guard } from './core/helpers/util';
|
||||
import { type CallbackQuery } from './core/types/typegram';
|
||||
import { Digit, Reaction } from './reactions';
|
||||
type ReactionAddedOrRemoved = Reaction | `-${tg.TelegramEmoji}` | `-${Digit}${string}`;
|
||||
export type Triggers<C> = MaybeArray<string | RegExp | TriggerFn<C>>;
|
||||
type TriggerFn<C> = (value: string, ctx: C) => RegExpExecArray | null;
|
||||
export type Predicate<T> = (t: T) => boolean;
|
||||
export type AsyncPredicate<T> = (t: T) => Promise<boolean>;
|
||||
export type MatchedMiddleware<C extends Context, T extends tt.UpdateType | tt.MessageSubType = 'message' | 'channel_post'> = NonemptyReadonlyArray<Middleware<NarrowedContext<C, tt.MountMap[T]> & {
|
||||
match: RegExpExecArray;
|
||||
}, tt.MountMap[T]>>;
|
||||
interface StartContextExtn extends tt.CommandContextExtn {
|
||||
/**
|
||||
* @deprecated Use ctx.payload instead
|
||||
*/
|
||||
startPayload: string;
|
||||
}
|
||||
export declare class Composer<C extends Context> implements MiddlewareObj<C> {
|
||||
private handler;
|
||||
constructor(...fns: ReadonlyArray<Middleware<C>>);
|
||||
/**
|
||||
* Registers a middleware.
|
||||
*/
|
||||
use(...fns: ReadonlyArray<Middleware<C>>): this;
|
||||
/**
|
||||
* Registers middleware for handling updates
|
||||
* matching given type guard function.
|
||||
* @deprecated use `Composer::on`
|
||||
*/
|
||||
guard<U extends tg.Update>(guardFn: (update: tg.Update) => update is U, ...fns: NonemptyReadonlyArray<Middleware<NarrowedContext<C, U>, U>>): this;
|
||||
/**
|
||||
* Registers middleware for handling updates narrowed by update types or filter queries.
|
||||
*/
|
||||
on<Filter extends tt.UpdateType | Guard<C['update']>>(filters: MaybeArray<Filter>, ...fns: NonemptyReadonlyArray<Middleware<FilteredContext<C, Filter>>>): this;
|
||||
/**
|
||||
* Registers middleware for handling updates narrowed by update types or message subtypes.
|
||||
* @deprecated Use filter utils instead. Support for Message subtype in `Composer::on` will be removed in Telegraf v5.
|
||||
*/
|
||||
on<Filter extends tt.UpdateType | tt.MessageSubType>(filters: MaybeArray<Filter>, ...fns: NonemptyReadonlyArray<Middleware<NarrowedContext<C, tt.MountMap[Filter]>, tt.MountMap[Filter]>>): this;
|
||||
/**
|
||||
* Registers middleware for handling matching text messages.
|
||||
*/
|
||||
hears(triggers: Triggers<NarrowedContext<C, tt.MountMap['text']>>, ...fns: MatchedMiddleware<C, 'text'>): this;
|
||||
/**
|
||||
* Registers middleware for handling specified commands.
|
||||
*/
|
||||
command(command: Triggers<NarrowedContext<C, tt.MountMap['text']>>, ...fns: NonemptyReadonlyArray<Middleware<NarrowedContext<C, tt.MountMap['text']> & tt.CommandContextExtn>>): this;
|
||||
/**
|
||||
* Registers middleware for handling matching callback queries.
|
||||
*/
|
||||
action(triggers: Triggers<NarrowedContext<C, tt.MountMap['callback_query']>>, ...fns: MatchedMiddleware<C, 'callback_query'>): this;
|
||||
/**
|
||||
* Registers middleware for handling matching inline queries.
|
||||
*/
|
||||
inlineQuery(triggers: Triggers<NarrowedContext<C, tt.MountMap['inline_query']>>, ...fns: MatchedMiddleware<C, 'inline_query'>): this;
|
||||
/**
|
||||
* Registers middleware for handling game queries
|
||||
*/
|
||||
gameQuery(...fns: NonemptyReadonlyArray<Middleware<NarrowedContext<C, tg.Update.CallbackQueryUpdate<CallbackQuery.GameQuery>>>>): this;
|
||||
reaction(reaction: MaybeArray<ReactionAddedOrRemoved>, ...fns: NonemptyReadonlyArray<Middleware<NarrowedContext<C, tg.Update.MessageReactionUpdate> & {
|
||||
match: ReactionAddedOrRemoved;
|
||||
}, tg.Update.MessageReactionUpdate>>): this;
|
||||
/**
|
||||
* Registers middleware for dropping matching updates.
|
||||
*/
|
||||
drop(predicate: Predicate<C>): this;
|
||||
/** @deprecated use `Composer::drop` */
|
||||
filter(predicate: Predicate<C>): this;
|
||||
private entity;
|
||||
email(email: Triggers<C>, ...fns: MatchedMiddleware<C>): this;
|
||||
url(url: Triggers<C>, ...fns: MatchedMiddleware<C>): this;
|
||||
textLink(link: Triggers<C>, ...fns: MatchedMiddleware<C>): this;
|
||||
textMention(mention: Triggers<C>, ...fns: MatchedMiddleware<C>): this;
|
||||
mention(mention: MaybeArray<string>, ...fns: MatchedMiddleware<C>): this;
|
||||
phone(number: Triggers<C>, ...fns: MatchedMiddleware<C>): this;
|
||||
hashtag(hashtag: MaybeArray<string>, ...fns: MatchedMiddleware<C>): this;
|
||||
cashtag(cashtag: MaybeArray<string>, ...fns: MatchedMiddleware<C>): this;
|
||||
spoiler(text: Triggers<C>, ...fns: MatchedMiddleware<C>): this;
|
||||
/**
|
||||
* Registers a middleware for handling /start
|
||||
*/
|
||||
start(...fns: NonemptyReadonlyArray<Middleware<NarrowedContext<C, tt.MountMap['text']> & StartContextExtn>>): this;
|
||||
/**
|
||||
* Registers a middleware for handling /help
|
||||
*/
|
||||
help(...fns: NonemptyReadonlyArray<Middleware<NarrowedContext<C, tt.MountMap['text']> & tt.CommandContextExtn>>): this;
|
||||
/**
|
||||
* Registers a middleware for handling /settings
|
||||
*/
|
||||
settings(...fns: NonemptyReadonlyArray<Middleware<NarrowedContext<C, tt.MountMap['text']> & tt.CommandContextExtn>>): this;
|
||||
middleware(): MiddlewareFn<C>;
|
||||
static reply(...args: Parameters<Context['reply']>): MiddlewareFn<Context>;
|
||||
static catch<C extends Context>(errorHandler: (err: unknown, ctx: C) => void, ...fns: ReadonlyArray<Middleware<C>>): MiddlewareFn<C>;
|
||||
/**
|
||||
* Generates middleware that runs in the background.
|
||||
*/
|
||||
static fork<C extends Context>(middleware: Middleware<C>): MiddlewareFn<C>;
|
||||
static tap<C extends Context>(middleware: Middleware<C>): MiddlewareFn<C>;
|
||||
/**
|
||||
* Generates middleware that gives up control to the next middleware.
|
||||
*/
|
||||
static passThru(): MiddlewareFn<Context>;
|
||||
static lazy<C extends Context>(factoryFn: (ctx: C) => MaybePromise<Middleware<C>>): MiddlewareFn<C>;
|
||||
static log(logFn?: (s: string) => void): MiddlewareFn<Context>;
|
||||
/**
|
||||
* @param trueMiddleware middleware to run if the predicate returns true
|
||||
* @param falseMiddleware middleware to run if the predicate returns false
|
||||
*/
|
||||
static branch<C extends Context>(predicate: boolean | Predicate<C> | AsyncPredicate<C>, trueMiddleware: Middleware<C>, falseMiddleware: Middleware<C>): MiddlewareFn<C>;
|
||||
/**
|
||||
* Generates optional middleware.
|
||||
* @param predicate predicate to decide on a context object whether to run the middleware
|
||||
* @param fns middleware to run if the predicate returns true
|
||||
*/
|
||||
static optional<C extends Context>(predicate: Predicate<C> | AsyncPredicate<C>, ...fns: NonemptyReadonlyArray<Middleware<C>>): MiddlewareFn<C>;
|
||||
/** @deprecated use `Composer.drop` */
|
||||
static filter<C extends Context>(predicate: Predicate<C>): MiddlewareFn<C>;
|
||||
/**
|
||||
* Generates middleware for dropping matching updates.
|
||||
*/
|
||||
static drop<C extends Context>(predicate: Predicate<C>): MiddlewareFn<C>;
|
||||
static dispatch<C extends Context, Handlers extends Record<string | number | symbol, Middleware<C>>>(routeFn: (ctx: C) => MaybePromise<keyof Handlers>, handlers: Handlers): Middleware<C>;
|
||||
/**
|
||||
* Generates optional middleware based on a predicate that only operates on `ctx.update`.
|
||||
*
|
||||
* Example:
|
||||
* ```ts
|
||||
* import { Composer, Update } from 'telegraf'
|
||||
*
|
||||
* const predicate = (u): u is Update.MessageUpdate => 'message' in u
|
||||
* const middleware = Composer.guard(predicate, (ctx) => {
|
||||
* const message = ctx.update.message
|
||||
* })
|
||||
* ```
|
||||
*
|
||||
* Note that `Composer.on('message')` is preferred over this.
|
||||
*
|
||||
* @param guardFn predicate to decide whether to run the middleware based on the `ctx.update` object
|
||||
* @param fns middleware to run if the predicate returns true
|
||||
* @see `Composer.optional` for a more generic version of this method that allows the predicate to operate on `ctx` itself
|
||||
* @deprecated use `Composer.on`
|
||||
*/
|
||||
static guard<C extends Context, U extends tg.Update>(guardFn: (u: tg.Update) => u is U, ...fns: NonemptyReadonlyArray<Middleware<NarrowedContext<C, U>, U>>): MiddlewareFn<C>;
|
||||
/**
|
||||
* Generates middleware for handling updates narrowed by update types or filter queries.
|
||||
*/
|
||||
static on<Ctx extends Context, Filter extends tt.UpdateType | Guard<Ctx['update']>>(filters: MaybeArray<Filter>, ...fns: NonemptyReadonlyArray<Middleware<FilteredContext<Ctx, Filter>>>): MiddlewareFn<Ctx>;
|
||||
/**
|
||||
* Generates middleware for handling updates narrowed by update types or message subtype.
|
||||
* @deprecated Use filter utils instead. Support for Message subtype in `Composer.on` will be removed in Telegraf v5.
|
||||
*/
|
||||
static on<Ctx extends Context, Filter extends tt.UpdateType | tt.MessageSubType>(filters: MaybeArray<Filter>, ...fns: NonemptyReadonlyArray<Middleware<NarrowedContext<Ctx, tt.MountMap[Filter]>, tt.MountMap[Filter]>>): MiddlewareFn<Ctx>;
|
||||
/**
|
||||
* Generates middleware for handling provided update types.
|
||||
* @deprecated use `Composer.on` instead
|
||||
*/
|
||||
static mount: typeof Composer.on;
|
||||
private static entity;
|
||||
static entityText<C extends Context>(entityType: MaybeArray<string>, predicate: Triggers<C>, ...fns: MatchedMiddleware<C>): MiddlewareFn<C>;
|
||||
static email<C extends Context>(email: Triggers<C>, ...fns: MatchedMiddleware<C>): MiddlewareFn<C>;
|
||||
static phone<C extends Context>(number: Triggers<C>, ...fns: MatchedMiddleware<C>): MiddlewareFn<C>;
|
||||
static url<C extends Context>(url: Triggers<C>, ...fns: MatchedMiddleware<C>): MiddlewareFn<C>;
|
||||
static textLink<C extends Context>(link: Triggers<C>, ...fns: MatchedMiddleware<C>): MiddlewareFn<C>;
|
||||
static textMention<C extends Context>(mention: Triggers<C>, ...fns: MatchedMiddleware<C>): MiddlewareFn<C>;
|
||||
static mention<C extends Context>(mention: MaybeArray<string>, ...fns: MatchedMiddleware<C>): MiddlewareFn<C>;
|
||||
static hashtag<C extends Context>(hashtag: MaybeArray<string>, ...fns: MatchedMiddleware<C>): MiddlewareFn<C>;
|
||||
static cashtag<C extends Context>(cashtag: MaybeArray<string>, ...fns: MatchedMiddleware<C>): MiddlewareFn<C>;
|
||||
static spoiler<C extends Context>(text: Triggers<C>, ...fns: MatchedMiddleware<C>): MiddlewareFn<C>;
|
||||
private static match;
|
||||
/**
|
||||
* Generates middleware for handling matching text messages.
|
||||
*/
|
||||
static hears<C extends Context>(triggers: Triggers<NarrowedContext<C, tt.MountMap['text']>>, ...fns: MatchedMiddleware<C, 'text'>): MiddlewareFn<C>;
|
||||
/**
|
||||
* Generates middleware for handling specified commands.
|
||||
*/
|
||||
static command<C extends Context>(command: Triggers<NarrowedContext<C, tt.MountMap['text']>>, ...fns: NonemptyReadonlyArray<Middleware<NarrowedContext<C, tt.MountMap['text']> & tt.CommandContextExtn>>): MiddlewareFn<C>;
|
||||
/**
|
||||
* Generates middleware for handling matching callback queries.
|
||||
*/
|
||||
static action<C extends Context>(triggers: Triggers<NarrowedContext<C, tt.MountMap['callback_query']>>, ...fns: MatchedMiddleware<C, 'callback_query'>): MiddlewareFn<C>;
|
||||
/**
|
||||
* Generates middleware for handling matching inline queries.
|
||||
*/
|
||||
static inlineQuery<C extends Context>(triggers: Triggers<NarrowedContext<C, tt.MountMap['inline_query']>>, ...fns: MatchedMiddleware<C, 'inline_query'>): MiddlewareFn<C>;
|
||||
static reaction<C extends Context>(reaction: MaybeArray<ReactionAddedOrRemoved>, ...fns: NonemptyReadonlyArray<Middleware<NarrowedContext<C, tg.Update.MessageReactionUpdate> & {
|
||||
match: ReactionAddedOrRemoved;
|
||||
}, tg.Update.MessageReactionUpdate>>): MiddlewareFn<C>;
|
||||
/**
|
||||
* Generates middleware responding only to specified users.
|
||||
*/
|
||||
static acl<C extends Context>(userId: MaybeArray<number>, ...fns: NonemptyReadonlyArray<Middleware<C>>): MiddlewareFn<C>;
|
||||
private static memberStatus;
|
||||
/**
|
||||
* Generates middleware responding only to chat admins and chat creator.
|
||||
*/
|
||||
static admin<C extends Context>(...fns: NonemptyReadonlyArray<Middleware<C>>): MiddlewareFn<C>;
|
||||
/**
|
||||
* Generates middleware responding only to chat creator.
|
||||
*/
|
||||
static creator<C extends Context>(...fns: NonemptyReadonlyArray<Middleware<C>>): MiddlewareFn<C>;
|
||||
/**
|
||||
* Generates middleware running only in specified chat types.
|
||||
*/
|
||||
static chatType<C extends Context>(type: MaybeArray<tg.Chat['type']>, ...fns: NonemptyReadonlyArray<Middleware<C>>): MiddlewareFn<C>;
|
||||
/**
|
||||
* Generates middleware running only in private chats.
|
||||
*/
|
||||
static privateChat<C extends Context>(...fns: NonemptyReadonlyArray<Middleware<C>>): MiddlewareFn<C>;
|
||||
/**
|
||||
* Generates middleware running only in groups and supergroups.
|
||||
*/
|
||||
static groupChat<C extends Context>(...fns: NonemptyReadonlyArray<Middleware<C>>): MiddlewareFn<C>;
|
||||
/**
|
||||
* Generates middleware for handling game queries.
|
||||
*/
|
||||
static gameQuery<C extends Context>(...fns: NonemptyReadonlyArray<Middleware<NarrowedContext<C, tg.Update.CallbackQueryUpdate<CallbackQuery.GameQuery>>>>): MiddlewareFn<C>;
|
||||
static unwrap<C extends Context>(handler: Middleware<C>): MiddlewareFn<C>;
|
||||
static compose<C extends Context>(middlewares: ReadonlyArray<Middleware<C>>): MiddlewareFn<C>;
|
||||
}
|
||||
export default Composer;
|
||||
//# sourceMappingURL=composer.d.ts.map
|
||||
1
node_modules/telegraf/typings/composer.d.ts.map
generated
vendored
Normal file
1
node_modules/telegraf/typings/composer.d.ts.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
655
node_modules/telegraf/typings/context.d.ts
generated
vendored
Normal file
655
node_modules/telegraf/typings/context.d.ts
generated
vendored
Normal file
@@ -0,0 +1,655 @@
|
||||
import * as tg from './core/types/typegram';
|
||||
import * as tt from './telegram-types';
|
||||
import { Deunionize, PropOr, UnionKeys } from './core/helpers/deunionize';
|
||||
import ApiClient from './core/network/client';
|
||||
import { Guard, Guarded, Keyed, MaybeArray } from './core/helpers/util';
|
||||
import Telegram from './telegram';
|
||||
import { FmtString } from './format';
|
||||
import { Digit, MessageReactions } from './reactions';
|
||||
type Tail<T> = T extends [unknown, ...infer U] ? U : never;
|
||||
type Shorthand<FName extends Exclude<keyof Telegram, keyof ApiClient>> = Tail<Parameters<Telegram[FName]>>;
|
||||
/**
|
||||
* Narrows down `C['update']` (and derived getters)
|
||||
* to specific update type `U`.
|
||||
*
|
||||
* Used by [[`Composer`]],
|
||||
* possibly useful for splitting a bot into multiple files.
|
||||
*/
|
||||
export type NarrowedContext<C extends Context, U extends tg.Update> = Context<U> & Omit<C, keyof Context>;
|
||||
export type FilteredContext<Ctx extends Context, Filter extends tt.UpdateType | Guard<Ctx['update']>> = Filter extends tt.UpdateType ? NarrowedContext<Ctx, Extract<tg.Update, Record<Filter, object>>> : NarrowedContext<Ctx, Guarded<Filter>>;
|
||||
export declare class Context<U extends Deunionize<tg.Update> = tg.Update> {
|
||||
readonly update: U;
|
||||
readonly telegram: Telegram;
|
||||
readonly botInfo: tg.UserFromGetMe;
|
||||
readonly state: Record<string | symbol, any>;
|
||||
constructor(update: U, telegram: Telegram, botInfo: tg.UserFromGetMe);
|
||||
get updateType(): Extract<UnionKeys<U>, tt.UpdateType>;
|
||||
get me(): string;
|
||||
/**
|
||||
* @deprecated Use ctx.telegram instead
|
||||
*/
|
||||
get tg(): Telegram;
|
||||
get message(): PropOr<U, "message">;
|
||||
get editedMessage(): PropOr<U, "edited_message">;
|
||||
get inlineQuery(): PropOr<U, "inline_query">;
|
||||
get shippingQuery(): PropOr<U, "shipping_query">;
|
||||
get preCheckoutQuery(): PropOr<U, "pre_checkout_query">;
|
||||
get chosenInlineResult(): PropOr<U, "chosen_inline_result">;
|
||||
get channelPost(): PropOr<U, "channel_post">;
|
||||
get editedChannelPost(): PropOr<U, "edited_channel_post">;
|
||||
get messageReaction(): PropOr<U, "message_reaction">;
|
||||
get messageReactionCount(): PropOr<U, "message_reaction_count">;
|
||||
get callbackQuery(): PropOr<U, "callback_query">;
|
||||
get poll(): PropOr<U, "poll">;
|
||||
get pollAnswer(): PropOr<U, "poll_answer">;
|
||||
get myChatMember(): PropOr<U, "my_chat_member">;
|
||||
get chatMember(): PropOr<U, "chat_member">;
|
||||
get chatJoinRequest(): PropOr<U, "chat_join_request">;
|
||||
get chatBoost(): PropOr<U, "chat_boost">;
|
||||
get removedChatBoost(): PropOr<U, "removed_chat_boost">;
|
||||
/** Shorthand for any `message` object present in the current update. One of
|
||||
* `message`, `edited_message`, `channel_post`, `edited_channel_post` or
|
||||
* `callback_query.message`
|
||||
*/
|
||||
get msg(): GetMsg<U> & Msg;
|
||||
/** Shorthand for any message_id present in the current update. */
|
||||
get msgId(): GetMsgId<U>;
|
||||
get chat(): Getter<U, 'chat'>;
|
||||
get senderChat(): PropOr<GetUpdateContent<U>, "sender_chat", undefined>;
|
||||
get from(): GetUserFromAnySource<U>;
|
||||
get inlineMessageId(): string | undefined;
|
||||
get passportData(): tg.PassportData | undefined;
|
||||
get webAppData(): {
|
||||
data: {
|
||||
json<T>(): T;
|
||||
text(): string;
|
||||
};
|
||||
button_text: string;
|
||||
} | undefined;
|
||||
/**
|
||||
* @deprecated use {@link Telegram.webhookReply}
|
||||
*/
|
||||
get webhookReply(): boolean;
|
||||
set webhookReply(enable: boolean);
|
||||
get reactions(): MessageReactions;
|
||||
has<Filter extends tt.UpdateType | Guard<Context['update']>>(filters: MaybeArray<Filter>): this is FilteredContext<Context, Filter>;
|
||||
get text(): GetText<U>;
|
||||
entities<EntityTypes extends tg.MessageEntity['type'][]>(...types: EntityTypes): (tg.MessageEntity & {
|
||||
type: EntityTypes extends [] ? "mention" | "hashtag" | "cashtag" | "bot_command" | "url" | "email" | "phone_number" | "bold" | "blockquote" | "italic" | "underline" | "strikethrough" | "spoiler" | "code" | "custom_emoji" | "pre" | "text_link" | "text_mention" : EntityTypes[number];
|
||||
fragment: string;
|
||||
})[];
|
||||
/**
|
||||
* @see https://core.telegram.org/bots/api#answerinlinequery
|
||||
*/
|
||||
answerInlineQuery(...args: Shorthand<'answerInlineQuery'>): Promise<true>;
|
||||
/**
|
||||
* @see https://core.telegram.org/bots/api#answercallbackquery
|
||||
*/
|
||||
answerCbQuery(...args: Shorthand<'answerCbQuery'>): Promise<true>;
|
||||
/**
|
||||
* @see https://core.telegram.org/bots/api#answercallbackquery
|
||||
*/
|
||||
answerGameQuery(...args: Shorthand<'answerGameQuery'>): Promise<true>;
|
||||
/**
|
||||
* Shorthand for {@link Telegram.getUserChatBoosts}
|
||||
*/
|
||||
getUserChatBoosts(): Promise<tg.UserChatBoosts[]>;
|
||||
/**
|
||||
* @see https://core.telegram.org/bots/api#answershippingquery
|
||||
*/
|
||||
answerShippingQuery(...args: Shorthand<'answerShippingQuery'>): Promise<true>;
|
||||
/**
|
||||
* @see https://core.telegram.org/bots/api#answerprecheckoutquery
|
||||
*/
|
||||
answerPreCheckoutQuery(...args: Shorthand<'answerPreCheckoutQuery'>): Promise<true>;
|
||||
/**
|
||||
* @see https://core.telegram.org/bots/api#editmessagetext
|
||||
*/
|
||||
editMessageText(text: string | FmtString, extra?: tt.ExtraEditMessageText): Promise<true | (tg.Update.Edited & tg.Message.TextMessage)>;
|
||||
/**
|
||||
* @see https://core.telegram.org/bots/api#editmessagecaption
|
||||
*/
|
||||
editMessageCaption(caption: string | FmtString | undefined, extra?: tt.ExtraEditMessageCaption): Promise<true | (tg.Update.Edited & tg.Message.CaptionableMessage)>;
|
||||
/**
|
||||
* @see https://core.telegram.org/bots/api#editmessagemedia
|
||||
*/
|
||||
editMessageMedia(media: tt.WrapCaption<tg.InputMedia>, extra?: tt.ExtraEditMessageMedia): Promise<true | (tg.Update.Edited & tg.Message)>;
|
||||
/**
|
||||
* @see https://core.telegram.org/bots/api#editmessagereplymarkup
|
||||
*/
|
||||
editMessageReplyMarkup(markup: tg.InlineKeyboardMarkup | undefined): Promise<true | (tg.Update.Edited & tg.Message)>;
|
||||
/**
|
||||
* @see https://core.telegram.org/bots/api#editmessagelivelocation
|
||||
*/
|
||||
editMessageLiveLocation(latitude: number, longitude: number, extra?: tt.ExtraEditMessageLiveLocation): Promise<true | (tg.Update.Edited & tg.Message.LocationMessage)>;
|
||||
/**
|
||||
* @see https://core.telegram.org/bots/api#stopmessagelivelocation
|
||||
*/
|
||||
stopMessageLiveLocation(markup?: tg.InlineKeyboardMarkup): Promise<true | (tg.Update.Edited & tg.Message.LocationMessage)>;
|
||||
/**
|
||||
* @see https://core.telegram.org/bots/api#sendmessage
|
||||
*/
|
||||
sendMessage(text: string | FmtString, extra?: tt.ExtraReplyMessage): Promise<tg.Message.TextMessage>;
|
||||
/**
|
||||
* @see https://core.telegram.org/bots/api#sendmessage
|
||||
*/
|
||||
reply(...args: Shorthand<'sendMessage'>): Promise<tg.Message.TextMessage>;
|
||||
/**
|
||||
* @see https://core.telegram.org/bots/api#getchat
|
||||
*/
|
||||
getChat(...args: Shorthand<'getChat'>): Promise<tg.ChatFromGetChat>;
|
||||
/**
|
||||
* @see https://core.telegram.org/bots/api#exportchatinvitelink
|
||||
*/
|
||||
exportChatInviteLink(...args: Shorthand<'exportChatInviteLink'>): Promise<string>;
|
||||
/**
|
||||
* @see https://core.telegram.org/bots/api#createchatinvitelink
|
||||
*/
|
||||
createChatInviteLink(...args: Shorthand<'createChatInviteLink'>): Promise<tg.ChatInviteLink>;
|
||||
/**
|
||||
* @see https://core.telegram.org/bots/api#editchatinvitelink
|
||||
*/
|
||||
editChatInviteLink(...args: Shorthand<'editChatInviteLink'>): Promise<tg.ChatInviteLink>;
|
||||
/**
|
||||
* @see https://core.telegram.org/bots/api#revokechatinvitelink
|
||||
*/
|
||||
revokeChatInviteLink(...args: Shorthand<'revokeChatInviteLink'>): Promise<tg.ChatInviteLink>;
|
||||
/**
|
||||
* @see https://core.telegram.org/bots/api#banchatmember
|
||||
*/
|
||||
banChatMember(...args: Shorthand<'banChatMember'>): Promise<true>;
|
||||
/**
|
||||
* @see https://core.telegram.org/bots/api#banchatmember
|
||||
* @deprecated since API 5.3. Use {@link Context.banChatMember}
|
||||
*/
|
||||
get kickChatMember(): (userId: number, untilDate?: number | undefined, extra?: Omit<{
|
||||
chat_id: string | number;
|
||||
user_id: number;
|
||||
until_date?: number | undefined;
|
||||
revoke_messages?: boolean | undefined;
|
||||
}, "chat_id" | "user_id" | "until_date"> | undefined) => Promise<true>;
|
||||
/**
|
||||
* @see https://core.telegram.org/bots/api#unbanchatmember
|
||||
*/
|
||||
unbanChatMember(...args: Shorthand<'unbanChatMember'>): Promise<true>;
|
||||
/**
|
||||
* @see https://core.telegram.org/bots/api#restrictchatmember
|
||||
*/
|
||||
restrictChatMember(...args: Shorthand<'restrictChatMember'>): Promise<true>;
|
||||
/**
|
||||
* @see https://core.telegram.org/bots/api#promotechatmember
|
||||
*/
|
||||
promoteChatMember(...args: Shorthand<'promoteChatMember'>): Promise<true>;
|
||||
/**
|
||||
* @see https://core.telegram.org/bots/api#setchatadministratorcustomtitle
|
||||
*/
|
||||
setChatAdministratorCustomTitle(...args: Shorthand<'setChatAdministratorCustomTitle'>): Promise<true>;
|
||||
/**
|
||||
* @see https://core.telegram.org/bots/api#setchatphoto
|
||||
*/
|
||||
setChatPhoto(...args: Shorthand<'setChatPhoto'>): Promise<true>;
|
||||
/**
|
||||
* @see https://core.telegram.org/bots/api#deletechatphoto
|
||||
*/
|
||||
deleteChatPhoto(...args: Shorthand<'deleteChatPhoto'>): Promise<true>;
|
||||
/**
|
||||
* @see https://core.telegram.org/bots/api#setchattitle
|
||||
*/
|
||||
setChatTitle(...args: Shorthand<'setChatTitle'>): Promise<true>;
|
||||
/**
|
||||
* @see https://core.telegram.org/bots/api#setchatdescription
|
||||
*/
|
||||
setChatDescription(...args: Shorthand<'setChatDescription'>): Promise<true>;
|
||||
/**
|
||||
* @see https://core.telegram.org/bots/api#pinchatmessage
|
||||
*/
|
||||
pinChatMessage(...args: Shorthand<'pinChatMessage'>): Promise<true>;
|
||||
/**
|
||||
* @see https://core.telegram.org/bots/api#unpinchatmessage
|
||||
*/
|
||||
unpinChatMessage(...args: Shorthand<'unpinChatMessage'>): Promise<true>;
|
||||
/**
|
||||
* @see https://core.telegram.org/bots/api#unpinallchatmessages
|
||||
*/
|
||||
unpinAllChatMessages(...args: Shorthand<'unpinAllChatMessages'>): Promise<true>;
|
||||
/**
|
||||
* @see https://core.telegram.org/bots/api#leavechat
|
||||
*/
|
||||
leaveChat(...args: Shorthand<'leaveChat'>): Promise<true>;
|
||||
/**
|
||||
* @see https://core.telegram.org/bots/api#setchatpermissions
|
||||
*/
|
||||
setChatPermissions(...args: Shorthand<'setChatPermissions'>): Promise<true>;
|
||||
/**
|
||||
* @see https://core.telegram.org/bots/api#getchatadministrators
|
||||
*/
|
||||
getChatAdministrators(...args: Shorthand<'getChatAdministrators'>): Promise<(tg.ChatMemberOwner | tg.ChatMemberAdministrator)[]>;
|
||||
/**
|
||||
* @see https://core.telegram.org/bots/api#getchatmember
|
||||
*/
|
||||
getChatMember(...args: Shorthand<'getChatMember'>): Promise<tg.ChatMember>;
|
||||
/**
|
||||
* @see https://core.telegram.org/bots/api#getchatmembercount
|
||||
*/
|
||||
getChatMembersCount(...args: Shorthand<'getChatMembersCount'>): Promise<number>;
|
||||
/**
|
||||
* @see https://core.telegram.org/bots/api#setpassportdataerrors
|
||||
*/
|
||||
setPassportDataErrors(errors: readonly tg.PassportElementError[]): Promise<true>;
|
||||
/**
|
||||
* @see https://core.telegram.org/bots/api#sendphoto
|
||||
*/
|
||||
sendPhoto(photo: string | tg.InputFile, extra?: tt.ExtraPhoto): Promise<tg.Message.PhotoMessage>;
|
||||
/**
|
||||
* @see https://core.telegram.org/bots/api#sendphoto
|
||||
*/
|
||||
replyWithPhoto(...args: Shorthand<'sendPhoto'>): Promise<tg.Message.PhotoMessage>;
|
||||
/**
|
||||
* @see https://core.telegram.org/bots/api#sendmediagroup
|
||||
*/
|
||||
sendMediaGroup(media: tt.MediaGroup, extra?: tt.ExtraMediaGroup): Promise<(tg.Message.DocumentMessage | tg.Message.AudioMessage | tg.Message.PhotoMessage | tg.Message.VideoMessage)[]>;
|
||||
/**
|
||||
* @see https://core.telegram.org/bots/api#sendmediagroup
|
||||
*/
|
||||
replyWithMediaGroup(...args: Shorthand<'sendMediaGroup'>): Promise<(tg.Message.DocumentMessage | tg.Message.AudioMessage | tg.Message.PhotoMessage | tg.Message.VideoMessage)[]>;
|
||||
/**
|
||||
* @see https://core.telegram.org/bots/api#sendaudio
|
||||
*/
|
||||
sendAudio(audio: string | tg.InputFile, extra?: tt.ExtraAudio): Promise<tg.Message.AudioMessage>;
|
||||
/**
|
||||
* @see https://core.telegram.org/bots/api#sendaudio
|
||||
*/
|
||||
replyWithAudio(...args: Shorthand<'sendAudio'>): Promise<tg.Message.AudioMessage>;
|
||||
/**
|
||||
* @see https://core.telegram.org/bots/api#senddice
|
||||
*/
|
||||
sendDice(extra?: tt.ExtraDice): Promise<tg.Message.DiceMessage>;
|
||||
/**
|
||||
* @see https://core.telegram.org/bots/api#senddice
|
||||
*/
|
||||
replyWithDice(...args: Shorthand<'sendDice'>): Promise<tg.Message.DiceMessage>;
|
||||
/**
|
||||
* @see https://core.telegram.org/bots/api#senddocument
|
||||
*/
|
||||
sendDocument(document: string | tg.InputFile, extra?: tt.ExtraDocument): Promise<tg.Message.DocumentMessage>;
|
||||
/**
|
||||
* @see https://core.telegram.org/bots/api#senddocument
|
||||
*/
|
||||
replyWithDocument(...args: Shorthand<'sendDocument'>): Promise<tg.Message.DocumentMessage>;
|
||||
/**
|
||||
* @see https://core.telegram.org/bots/api#sendsticker
|
||||
*/
|
||||
sendSticker(sticker: string | tg.InputFile, extra?: tt.ExtraSticker): Promise<tg.Message.StickerMessage>;
|
||||
/**
|
||||
* @see https://core.telegram.org/bots/api#sendsticker
|
||||
*/
|
||||
replyWithSticker(...args: Shorthand<'sendSticker'>): Promise<tg.Message.StickerMessage>;
|
||||
/**
|
||||
* @see https://core.telegram.org/bots/api#sendvideo
|
||||
*/
|
||||
sendVideo(video: string | tg.InputFile, extra?: tt.ExtraVideo): Promise<tg.Message.VideoMessage>;
|
||||
/**
|
||||
* @see https://core.telegram.org/bots/api#sendvideo
|
||||
*/
|
||||
replyWithVideo(...args: Shorthand<'sendVideo'>): Promise<tg.Message.VideoMessage>;
|
||||
/**
|
||||
* @see https://core.telegram.org/bots/api#sendanimation
|
||||
*/
|
||||
sendAnimation(animation: string | tg.InputFile, extra?: tt.ExtraAnimation): Promise<tg.Message.AnimationMessage>;
|
||||
/**
|
||||
* @see https://core.telegram.org/bots/api#sendanimation
|
||||
*/
|
||||
replyWithAnimation(...args: Shorthand<'sendAnimation'>): Promise<tg.Message.AnimationMessage>;
|
||||
/**
|
||||
* @see https://core.telegram.org/bots/api#sendvideonote
|
||||
*/
|
||||
sendVideoNote(videoNote: string | tg.InputFileVideoNote, extra?: tt.ExtraVideoNote): Promise<tg.Message.VideoNoteMessage>;
|
||||
/**
|
||||
* @see https://core.telegram.org/bots/api#sendvideonote
|
||||
*/
|
||||
replyWithVideoNote(...args: Shorthand<'sendVideoNote'>): Promise<tg.Message.VideoNoteMessage>;
|
||||
/**
|
||||
* @see https://core.telegram.org/bots/api#sendinvoice
|
||||
*/
|
||||
sendInvoice(invoice: tt.NewInvoiceParameters, extra?: tt.ExtraInvoice): Promise<tg.Message.InvoiceMessage>;
|
||||
/**
|
||||
* @see https://core.telegram.org/bots/api#sendinvoice
|
||||
*/
|
||||
replyWithInvoice(...args: Shorthand<'sendInvoice'>): Promise<tg.Message.InvoiceMessage>;
|
||||
/**
|
||||
* @see https://core.telegram.org/bots/api#sendgame
|
||||
*/
|
||||
sendGame(game: string, extra?: tt.ExtraGame): Promise<tg.Message.GameMessage>;
|
||||
/**
|
||||
* @see https://core.telegram.org/bots/api#sendgame
|
||||
*/
|
||||
replyWithGame(...args: Shorthand<'sendGame'>): Promise<tg.Message.GameMessage>;
|
||||
/**
|
||||
* @see https://core.telegram.org/bots/api#sendvoice
|
||||
*/
|
||||
sendVoice(voice: string | tg.InputFile, extra?: tt.ExtraVoice): Promise<tg.Message.VoiceMessage>;
|
||||
/**
|
||||
* @see https://core.telegram.org/bots/api#sendvoice
|
||||
*/
|
||||
replyWithVoice(...args: Shorthand<'sendVoice'>): Promise<tg.Message.VoiceMessage>;
|
||||
/**
|
||||
* @see https://core.telegram.org/bots/api#sendpoll
|
||||
*/
|
||||
sendPoll(poll: string, options: readonly string[], extra?: tt.ExtraPoll): Promise<tg.Message.PollMessage>;
|
||||
/**
|
||||
* @see https://core.telegram.org/bots/api#sendpoll
|
||||
*/
|
||||
replyWithPoll(...args: Shorthand<'sendPoll'>): Promise<tg.Message.PollMessage>;
|
||||
/**
|
||||
* @see https://core.telegram.org/bots/api#sendpoll
|
||||
*/
|
||||
sendQuiz(quiz: string, options: readonly string[], extra?: tt.ExtraPoll): Promise<tg.Message.PollMessage>;
|
||||
/**
|
||||
* @see https://core.telegram.org/bots/api#sendpoll
|
||||
*/
|
||||
replyWithQuiz(...args: Shorthand<'sendQuiz'>): Promise<tg.Message.PollMessage>;
|
||||
/**
|
||||
* @see https://core.telegram.org/bots/api#stoppoll
|
||||
*/
|
||||
stopPoll(...args: Shorthand<'stopPoll'>): Promise<tg.Poll>;
|
||||
/**
|
||||
* @see https://core.telegram.org/bots/api#sendchataction
|
||||
*/
|
||||
sendChatAction(action: Shorthand<'sendChatAction'>[0], extra?: tt.ExtraSendChatAction): Promise<true>;
|
||||
/**
|
||||
* @see https://core.telegram.org/bots/api#sendchataction
|
||||
*
|
||||
* Sends the sendChatAction request repeatedly, with a delay between requests,
|
||||
* as long as the provided callback function is being processed.
|
||||
*
|
||||
* The sendChatAction errors should be ignored, because the goal is the actual long process completing and performing an action.
|
||||
*
|
||||
* @param action - chat action type.
|
||||
* @param callback - a function to run along with the chat action.
|
||||
* @param extra - extra parameters for sendChatAction.
|
||||
* @param {number} [extra.intervalDuration=8000] - The duration (in milliseconds) between subsequent sendChatAction requests.
|
||||
*/
|
||||
persistentChatAction(action: Shorthand<'sendChatAction'>[0], callback: () => Promise<void>, { intervalDuration, ...extra }?: tt.ExtraSendChatAction & {
|
||||
intervalDuration?: number;
|
||||
}): Promise<void>;
|
||||
/**
|
||||
* @deprecated use {@link Context.sendChatAction} instead
|
||||
* @see https://core.telegram.org/bots/api#sendchataction
|
||||
*/
|
||||
replyWithChatAction(...args: Shorthand<'sendChatAction'>): Promise<true>;
|
||||
/**
|
||||
* Shorthand for {@link Telegram.setMessageReaction}
|
||||
* @param reaction An emoji or custom_emoji_id to set as reaction to current message. Leave empty to remove reactions.
|
||||
* @param is_big Pass True to set the reaction with a big animation
|
||||
*/
|
||||
react(reaction?: MaybeArray<tg.TelegramEmoji | `${Digit}${string}` | tg.ReactionType>, is_big?: boolean): Promise<true>;
|
||||
/**
|
||||
* @see https://core.telegram.org/bots/api#sendlocation
|
||||
*/
|
||||
sendLocation(latitude: number, longitude: number, extra?: tt.ExtraLocation): Promise<tg.Message.LocationMessage>;
|
||||
/**
|
||||
* @see https://core.telegram.org/bots/api#sendlocation
|
||||
*/
|
||||
replyWithLocation(...args: Shorthand<'sendLocation'>): Promise<tg.Message.LocationMessage>;
|
||||
/**
|
||||
* @see https://core.telegram.org/bots/api#sendvenue
|
||||
*/
|
||||
sendVenue(latitude: number, longitude: number, title: string, address: string, extra?: tt.ExtraVenue): Promise<tg.Message.VenueMessage>;
|
||||
/**
|
||||
* @see https://core.telegram.org/bots/api#sendvenue
|
||||
*/
|
||||
replyWithVenue(...args: Shorthand<'sendVenue'>): Promise<tg.Message.VenueMessage>;
|
||||
/**
|
||||
* @see https://core.telegram.org/bots/api#sendcontact
|
||||
*/
|
||||
sendContact(phoneNumber: string, firstName: string, extra?: tt.ExtraContact): Promise<tg.Message.ContactMessage>;
|
||||
/**
|
||||
* @see https://core.telegram.org/bots/api#sendcontact
|
||||
*/
|
||||
replyWithContact(...args: Shorthand<'sendContact'>): Promise<tg.Message.ContactMessage>;
|
||||
/**
|
||||
* @deprecated use {@link Telegram.getStickerSet}
|
||||
* @see https://core.telegram.org/bots/api#getstickerset
|
||||
*/
|
||||
getStickerSet(setName: string): Promise<tg.StickerSet>;
|
||||
/**
|
||||
* @see https://core.telegram.org/bots/api#setchatstickerset
|
||||
*/
|
||||
setChatStickerSet(setName: string): Promise<true>;
|
||||
/**
|
||||
* @see https://core.telegram.org/bots/api#deletechatstickerset
|
||||
*/
|
||||
deleteChatStickerSet(): Promise<true>;
|
||||
/**
|
||||
* Use this method to create a topic in a forum supergroup chat. The bot must be an administrator in the chat for this
|
||||
* to work and must have the can_manage_topics administrator rights. Returns information about the created topic as a
|
||||
* ForumTopic object.
|
||||
*
|
||||
* @see https://core.telegram.org/bots/api#createforumtopic
|
||||
*/
|
||||
createForumTopic(...args: Shorthand<'createForumTopic'>): Promise<tg.ForumTopic>;
|
||||
/**
|
||||
* Use this method to edit name and icon of a topic in a forum supergroup chat. The bot must be an administrator in
|
||||
* the chat for this to work and must have can_manage_topics administrator rights, unless it is the creator of the
|
||||
* topic. Returns True on success.
|
||||
*
|
||||
* @see https://core.telegram.org/bots/api#editforumtopic
|
||||
*/
|
||||
editForumTopic(extra: tt.ExtraEditForumTopic): Promise<true>;
|
||||
/**
|
||||
* Use this method to close an open topic in a forum supergroup chat. The bot must be an administrator in the chat
|
||||
* for this to work and must have the can_manage_topics administrator rights, unless it is the creator of the topic.
|
||||
* Returns True on success.
|
||||
*
|
||||
* @see https://core.telegram.org/bots/api#closeforumtopic
|
||||
*/
|
||||
closeForumTopic(): Promise<true>;
|
||||
/**
|
||||
* Use this method to reopen a closed topic in a forum supergroup chat. The bot must be an administrator in the chat
|
||||
* for this to work and must have the can_manage_topics administrator rights, unless it is the creator of the topic.
|
||||
* Returns True on success.
|
||||
*
|
||||
* @see https://core.telegram.org/bots/api#reopenforumtopic
|
||||
*/
|
||||
reopenForumTopic(): Promise<true>;
|
||||
/**
|
||||
* Use this method to delete a forum topic along with all its messages in a forum supergroup chat. The bot must be an
|
||||
* administrator in the chat for this to work and must have the can_delete_messages administrator rights.
|
||||
* Returns True on success.
|
||||
*
|
||||
* @see https://core.telegram.org/bots/api#deleteforumtopic
|
||||
*/
|
||||
deleteForumTopic(): Promise<true>;
|
||||
/**
|
||||
* Use this method to clear the list of pinned messages in a forum topic. The bot must be an administrator in the chat
|
||||
* for this to work and must have the can_pin_messages administrator right in the supergroup. Returns True on success.
|
||||
*
|
||||
* @see https://core.telegram.org/bots/api#unpinallforumtopicmessages
|
||||
*/
|
||||
unpinAllForumTopicMessages(): Promise<true>;
|
||||
/**
|
||||
* Use this method to edit the name of the 'General' topic in a forum supergroup chat. The bot must be an administrator
|
||||
* in the chat for this to work and must have can_manage_topics administrator rights. Returns True on success.
|
||||
*
|
||||
* @see https://core.telegram.org/bots/api#editgeneralforumtopic
|
||||
*/
|
||||
editGeneralForumTopic(name: string): Promise<true>;
|
||||
/**
|
||||
* Use this method to close an open 'General' topic in a forum supergroup chat. The bot must be an administrator in the
|
||||
* chat for this to work and must have the can_manage_topics administrator rights. Returns True on success.
|
||||
*
|
||||
* @see https://core.telegram.org/bots/api#closegeneralforumtopic
|
||||
*/
|
||||
closeGeneralForumTopic(): Promise<true>;
|
||||
/**
|
||||
* Use this method to reopen a closed 'General' topic in a forum supergroup chat. The bot must be an administrator in
|
||||
* the chat for this to work and must have the can_manage_topics administrator rights. The topic will be automatically
|
||||
* unhidden if it was hidden. Returns True on success.
|
||||
*
|
||||
* @see https://core.telegram.org/bots/api#reopengeneralforumtopic
|
||||
*/
|
||||
reopenGeneralForumTopic(): Promise<true>;
|
||||
/**
|
||||
* Use this method to hide the 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat
|
||||
* for this to work and must have the can_manage_topics administrator rights. The topic will be automatically closed
|
||||
* if it was open. Returns True on success.
|
||||
*
|
||||
* @see https://core.telegram.org/bots/api#hidegeneralforumtopic
|
||||
*/
|
||||
hideGeneralForumTopic(): Promise<true>;
|
||||
/**
|
||||
* Use this method to unhide the 'General' topic in a forum supergroup chat. The bot must be an administrator in the
|
||||
* chat for this to work and must have the can_manage_topics administrator rights. Returns True on success.
|
||||
*
|
||||
* @see https://core.telegram.org/bots/api#unhidegeneralforumtopic
|
||||
*/
|
||||
unhideGeneralForumTopic(): Promise<true>;
|
||||
/**
|
||||
* Use this method to clear the list of pinned messages in a General forum topic.
|
||||
* The bot must be an administrator in the chat for this to work and must have the can_pin_messages administrator
|
||||
* right in the supergroup.
|
||||
*
|
||||
* @param chat_id Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
|
||||
*
|
||||
* @see https://core.telegram.org/bots/api#unpinallgeneralforumtopicmessages
|
||||
*/
|
||||
unpinAllGeneralForumTopicMessages(): Promise<true>;
|
||||
/**
|
||||
* @deprecated use {@link Telegram.setStickerPositionInSet}
|
||||
* @see https://core.telegram.org/bots/api#setstickerpositioninset
|
||||
*/
|
||||
setStickerPositionInSet(sticker: string, position: number): Promise<true>;
|
||||
/**
|
||||
* @deprecated use {@link Telegram.setStickerSetThumbnail}
|
||||
* @see https://core.telegram.org/bots/api#setstickersetthumbnail
|
||||
*/
|
||||
setStickerSetThumb(...args: Parameters<Telegram['setStickerSetThumbnail']>): Promise<true>;
|
||||
setStickerSetThumbnail(...args: Parameters<Telegram['setStickerSetThumbnail']>): Promise<true>;
|
||||
setStickerMaskPosition(...args: Parameters<Telegram['setStickerMaskPosition']>): Promise<true>;
|
||||
setStickerKeywords(...args: Parameters<Telegram['setStickerKeywords']>): Promise<true>;
|
||||
setStickerEmojiList(...args: Parameters<Telegram['setStickerEmojiList']>): Promise<true>;
|
||||
deleteStickerSet(...args: Parameters<Telegram['deleteStickerSet']>): Promise<true>;
|
||||
setStickerSetTitle(...args: Parameters<Telegram['setStickerSetTitle']>): Promise<true>;
|
||||
setCustomEmojiStickerSetThumbnail(...args: Parameters<Telegram['setCustomEmojiStickerSetThumbnail']>): Promise<true>;
|
||||
/**
|
||||
* @deprecated use {@link Telegram.deleteStickerFromSet}
|
||||
* @see https://core.telegram.org/bots/api#deletestickerfromset
|
||||
*/
|
||||
deleteStickerFromSet(sticker: string): Promise<true>;
|
||||
/**
|
||||
* @see https://core.telegram.org/bots/api#uploadstickerfile
|
||||
*/
|
||||
uploadStickerFile(...args: Shorthand<'uploadStickerFile'>): Promise<tg.File>;
|
||||
/**
|
||||
* @see https://core.telegram.org/bots/api#createnewstickerset
|
||||
*/
|
||||
createNewStickerSet(...args: Shorthand<'createNewStickerSet'>): Promise<true>;
|
||||
/**
|
||||
* @see https://core.telegram.org/bots/api#addstickertoset
|
||||
*/
|
||||
addStickerToSet(...args: Shorthand<'addStickerToSet'>): Promise<true>;
|
||||
/**
|
||||
* @deprecated use {@link Telegram.getMyCommands}
|
||||
* @see https://core.telegram.org/bots/api#getmycommands
|
||||
*/
|
||||
getMyCommands(): Promise<tg.BotCommand[]>;
|
||||
/**
|
||||
* @deprecated use {@link Telegram.setMyCommands}
|
||||
* @see https://core.telegram.org/bots/api#setmycommands
|
||||
*/
|
||||
setMyCommands(commands: readonly tg.BotCommand[]): Promise<true>;
|
||||
/**
|
||||
* @deprecated use {@link Context.replyWithMarkdownV2}
|
||||
* @see https://core.telegram.org/bots/api#sendmessage
|
||||
*/
|
||||
replyWithMarkdown(markdown: string, extra?: tt.ExtraReplyMessage): Promise<tg.Message.TextMessage>;
|
||||
/**
|
||||
* @see https://core.telegram.org/bots/api#sendmessage
|
||||
*/
|
||||
replyWithMarkdownV2(markdown: string, extra?: tt.ExtraReplyMessage): Promise<tg.Message.TextMessage>;
|
||||
/**
|
||||
* @see https://core.telegram.org/bots/api#sendmessage
|
||||
*/
|
||||
replyWithHTML(html: string, extra?: tt.ExtraReplyMessage): Promise<tg.Message.TextMessage>;
|
||||
/**
|
||||
* @see https://core.telegram.org/bots/api#deletemessage
|
||||
*/
|
||||
deleteMessage(messageId?: number): Promise<true>;
|
||||
/**
|
||||
* Context-aware shorthand for {@link Telegram.deleteMessages}
|
||||
* @param messageIds Identifiers of 1-100 messages to delete. See deleteMessage for limitations on which messages can be deleted
|
||||
*/
|
||||
deleteMessages(messageIds: number[]): Promise<true>;
|
||||
/**
|
||||
* @see https://core.telegram.org/bots/api#forwardmessage
|
||||
*/
|
||||
forwardMessage(chatId: string | number, extra?: Shorthand<'forwardMessage'>[2]): Promise<tg.Message>;
|
||||
/**
|
||||
* Shorthand for {@link Telegram.forwardMessages}
|
||||
* @see https://core.telegram.org/bots/api#forwardmessages
|
||||
*/
|
||||
forwardMessages(chatId: string | number, messageIds: number[], extra?: Shorthand<'forwardMessages'>[2]): Promise<tg.MessageId[]>;
|
||||
/**
|
||||
* @see https://core.telegram.org/bots/api#copymessage
|
||||
*/
|
||||
copyMessage(chatId: string | number, extra?: tt.ExtraCopyMessage): Promise<tg.MessageId>;
|
||||
/**
|
||||
* Context-aware shorthand for {@link Telegram.copyMessages}
|
||||
* @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
|
||||
* @param messageIds Identifiers of 1-100 messages in the chat from_chat_id to copy. The identifiers must be specified in a strictly increasing order.
|
||||
*/
|
||||
copyMessages(chatId: number | string, messageIds: number[], extra?: tt.ExtraCopyMessages): Promise<tg.MessageId[]>;
|
||||
/**
|
||||
* @see https://core.telegram.org/bots/api#approvechatjoinrequest
|
||||
*/
|
||||
approveChatJoinRequest(userId: number): Promise<true>;
|
||||
/**
|
||||
* @see https://core.telegram.org/bots/api#declinechatjoinrequest
|
||||
*/
|
||||
declineChatJoinRequest(userId: number): Promise<true>;
|
||||
/**
|
||||
* @see https://core.telegram.org/bots/api#banchatsenderchat
|
||||
*/
|
||||
banChatSenderChat(senderChatId: number): Promise<true>;
|
||||
/**
|
||||
* @see https://core.telegram.org/bots/api#unbanchatsenderchat
|
||||
*/
|
||||
unbanChatSenderChat(senderChatId: number): Promise<true>;
|
||||
/**
|
||||
* Use this method to change the bot's menu button in the current private chat. Returns true on success.
|
||||
* @see https://core.telegram.org/bots/api#setchatmenubutton
|
||||
*/
|
||||
setChatMenuButton(menuButton?: tg.MenuButton): Promise<true>;
|
||||
/**
|
||||
* Use this method to get the current value of the bot's menu button in the current private chat. Returns MenuButton on success.
|
||||
* @see https://core.telegram.org/bots/api#getchatmenubutton
|
||||
*/
|
||||
getChatMenuButton(): Promise<tg.MenuButton>;
|
||||
/**
|
||||
* @see https://core.telegram.org/bots/api#setmydefaultadministratorrights
|
||||
*/
|
||||
setMyDefaultAdministratorRights(extra?: Parameters<Telegram['setMyDefaultAdministratorRights']>[0]): Promise<true>;
|
||||
/**
|
||||
* @see https://core.telegram.org/bots/api#getmydefaultadministratorrights
|
||||
*/
|
||||
getMyDefaultAdministratorRights(extra?: Parameters<Telegram['getMyDefaultAdministratorRights']>[0]): Promise<tg.ChatAdministratorRights>;
|
||||
}
|
||||
export default Context;
|
||||
type UpdateTypes<U extends Deunionize<tg.Update>> = Extract<UnionKeys<U>, tt.UpdateType>;
|
||||
export type GetUpdateContent<U extends tg.Update> = U extends tg.Update.CallbackQueryUpdate ? U['callback_query']['message'] : U[UpdateTypes<U>];
|
||||
type Getter<U extends Deunionize<tg.Update>, P extends string> = PropOr<GetUpdateContent<U>, P>;
|
||||
interface Msg {
|
||||
isAccessible(): this is MaybeMessage<tg.Message>;
|
||||
has<Ks extends UnionKeys<tg.Message>[]>(...keys: Ks): this is MaybeMessage<Keyed<tg.Message, Ks[number]>>;
|
||||
}
|
||||
declare const Msg: Msg;
|
||||
export type MaybeMessage<M extends tg.MaybeInaccessibleMessage = tg.MaybeInaccessibleMessage> = M & Msg;
|
||||
type GetMsg<U extends tg.Update> = U extends tg.Update.MessageUpdate ? U['message'] : U extends tg.Update.ChannelPostUpdate ? U['channel_post'] : U extends tg.Update.EditedChannelPostUpdate ? U['edited_channel_post'] : U extends tg.Update.EditedMessageUpdate ? U['edited_message'] : U extends tg.Update.CallbackQueryUpdate ? U['callback_query']['message'] : undefined;
|
||||
type GetUserFromAnySource<U extends tg.Update> = GetMsg<U> extends {
|
||||
from: tg.User;
|
||||
} ? tg.User : U extends tg.Update.CallbackQueryUpdate | tg.Update.InlineQueryUpdate | tg.Update.ShippingQueryUpdate | tg.Update.PreCheckoutQueryUpdate | tg.Update.ChosenInlineResultUpdate | tg.Update.ChatMemberUpdate | tg.Update.MyChatMemberUpdate | tg.Update.ChatJoinRequestUpdate | tg.Update.MessageReactionUpdate | tg.Update.PollAnswerUpdate | tg.Update.ChatBoostUpdate ? tg.User : undefined;
|
||||
type GetMsgId<U extends tg.Update> = GetMsg<U> extends {
|
||||
message_id: number;
|
||||
} ? number : U extends tg.Update.MessageReactionUpdate ? number : U extends tg.Update.MessageReactionCountUpdate ? number : undefined;
|
||||
type GetText<U extends tg.Update> = GetMsg<U> extends tg.Message.TextMessage ? string : GetMsg<U> extends tg.Message ? string | undefined : U extends tg.Update.PollUpdate ? string | undefined : undefined;
|
||||
//# sourceMappingURL=context.d.ts.map
|
||||
1
node_modules/telegraf/typings/context.d.ts.map
generated
vendored
Normal file
1
node_modules/telegraf/typings/context.d.ts.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
11
node_modules/telegraf/typings/core/helpers/args.d.ts
generated
vendored
Normal file
11
node_modules/telegraf/typings/core/helpers/args.d.ts
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
interface Entity {
|
||||
/** Type of the entity. Currently, can be “mention” (@username), “hashtag” (#hashtag), “cashtag” ($USD), “bot_command” (/start@jobs_bot), “url” (https://telegram.org), “email” (do-not-reply@telegram.org), “phone_number” (+1-212-555-0123), “bold” (bold text), “italic” (italic text), “underline” (underlined text), “strikethrough” (strikethrough text), “spoiler” (spoiler message), “code” (monowidth string), “pre” (monowidth block), “text_link” (for clickable text URLs), “text_mention” (for users without usernames), “custom_emoji” (for inline custom emoji stickers) */
|
||||
type: string;
|
||||
/** Offset in UTF-16 code units to the start of the entity */
|
||||
offset: number;
|
||||
/** Length of the entity in UTF-16 code units */
|
||||
length: number;
|
||||
}
|
||||
export declare function argsParser(str: string, entities?: Entity[], entityOffset?: number): string[];
|
||||
export {};
|
||||
//# sourceMappingURL=args.d.ts.map
|
||||
1
node_modules/telegraf/typings/core/helpers/args.d.ts.map
generated
vendored
Normal file
1
node_modules/telegraf/typings/core/helpers/args.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"args.d.ts","sourceRoot":"","sources":["../../../src/core/helpers/args.ts"],"names":[],"mappings":"AAAA,UAAU,MAAM;IACd,0jBAA0jB;IAC1jB,IAAI,EAAE,MAAM,CAAA;IACZ,6DAA6D;IAC7D,MAAM,EAAE,MAAM,CAAA;IACd,gDAAgD;IAChD,MAAM,EAAE,MAAM,CAAA;CACf;AAKD,wBAAgB,UAAU,CACxB,GAAG,EAAE,MAAM,EACX,QAAQ,GAAE,MAAM,EAAO,EACvB,YAAY,SAAI,YA+CjB"}
|
||||
56
node_modules/telegraf/typings/core/helpers/check.d.ts
generated
vendored
Normal file
56
node_modules/telegraf/typings/core/helpers/check.d.ts
generated
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||
interface Mapping {
|
||||
string: string;
|
||||
number: number;
|
||||
bigint: bigint;
|
||||
boolean: boolean;
|
||||
symbol: symbol;
|
||||
undefined: undefined;
|
||||
object: Record<string, unknown>;
|
||||
function: (...props: any[]) => any;
|
||||
}
|
||||
/**
|
||||
* Checks if a given object has a property with a given name.
|
||||
*
|
||||
* Example invocation:
|
||||
* ```js
|
||||
* let obj = { 'foo': 'bar', 'baz': () => {} }
|
||||
* hasProp(obj, 'foo') // true
|
||||
* hasProp(obj, 'baz') // true
|
||||
* hasProp(obj, 'abc') // false
|
||||
* ```
|
||||
*
|
||||
* @param obj An object to test
|
||||
* @param prop The name of the property
|
||||
*/
|
||||
export declare function hasProp<O extends object, K extends PropertyKey>(obj: O | undefined, prop: K): obj is O & Record<K, unknown>;
|
||||
/**
|
||||
* Checks if a given object has a property with a given name.
|
||||
* Furthermore performs a `typeof` check on the property if it exists.
|
||||
*
|
||||
* Example invocation:
|
||||
* ```js
|
||||
* let obj = { 'foo': 'bar', 'baz': () => {} }
|
||||
* hasPropType(obj, 'foo', 'string') // true
|
||||
* hasPropType(obj, 'baz', 'function') // true
|
||||
* hasPropType(obj, 'abc', 'number') // false
|
||||
* ```
|
||||
*
|
||||
* @param obj An object to test
|
||||
* @param prop The name of the property
|
||||
* @param type The type the property is expected to have
|
||||
*/
|
||||
export declare function hasPropType<O extends object, K extends PropertyKey, T extends keyof Mapping, V extends Mapping[T]>(obj: O | undefined, prop: K, type: T): obj is O & Record<K, V>;
|
||||
/**
|
||||
* Checks if the supplied array has two dimensions or not.
|
||||
*
|
||||
* Example invocations:
|
||||
* is2D([]) // false
|
||||
* is2D([[]]) // true
|
||||
* is2D([[], []]) // true
|
||||
* is2D([42]) // false
|
||||
*
|
||||
* @param arr an array with one or two dimensions
|
||||
*/
|
||||
export declare function is2D<E>(arr: E[] | E[][]): arr is E[][];
|
||||
export {};
|
||||
//# sourceMappingURL=check.d.ts.map
|
||||
1
node_modules/telegraf/typings/core/helpers/check.d.ts.map
generated
vendored
Normal file
1
node_modules/telegraf/typings/core/helpers/check.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"check.d.ts","sourceRoot":"","sources":["../../../src/core/helpers/check.ts"],"names":[],"mappings":"AAAA,UAAU,OAAO;IACf,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,OAAO,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;IACd,SAAS,EAAE,SAAS,CAAA;IACpB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAE/B,QAAQ,EAAE,CAAC,GAAG,KAAK,EAAE,GAAG,EAAE,KAAK,GAAG,CAAA;CACnC;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,OAAO,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,WAAW,EAC7D,GAAG,EAAE,CAAC,GAAG,SAAS,EAClB,IAAI,EAAE,CAAC,GACN,GAAG,IAAI,CAAC,GAAG,MAAM,CAAC,CAAC,EAAE,OAAO,CAAC,CAE/B;AACD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,WAAW,CACzB,CAAC,SAAS,MAAM,EAChB,CAAC,SAAS,WAAW,EACrB,CAAC,SAAS,MAAM,OAAO,EACvB,CAAC,SAAS,OAAO,CAAC,CAAC,CAAC,EACpB,GAAG,EAAE,CAAC,GAAG,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAE/D;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,IAAI,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,CAAC,EAAE,EAAE,GAAG,GAAG,IAAI,CAAC,EAAE,EAAE,CAEtD"}
|
||||
4
node_modules/telegraf/typings/core/helpers/compact.d.ts
generated
vendored
Normal file
4
node_modules/telegraf/typings/core/helpers/compact.d.ts
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
export declare function compactOptions<T extends {
|
||||
[key: string]: unknown;
|
||||
}>(options?: T): T | undefined;
|
||||
//# sourceMappingURL=compact.d.ts.map
|
||||
1
node_modules/telegraf/typings/core/helpers/compact.d.ts.map
generated
vendored
Normal file
1
node_modules/telegraf/typings/core/helpers/compact.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"compact.d.ts","sourceRoot":"","sources":["../../../src/core/helpers/compact.ts"],"names":[],"mappings":"AAAA,wBAAgB,cAAc,CAAC,CAAC,SAAS;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,EACjE,OAAO,CAAC,EAAE,CAAC,GACV,CAAC,GAAG,SAAS,CAef"}
|
||||
18
node_modules/telegraf/typings/core/helpers/deunionize.d.ts
generated
vendored
Normal file
18
node_modules/telegraf/typings/core/helpers/deunionize.d.ts
generated
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
export type PropOr<T extends object | undefined, P extends string | symbol | number, D = undefined> = T extends Partial<Record<P, unknown>> ? T[P] : D;
|
||||
export type UnionKeys<T> = T extends unknown ? keyof T : never;
|
||||
type AddOptionalKeys<K extends PropertyKey> = {
|
||||
readonly [P in K]?: never;
|
||||
};
|
||||
/**
|
||||
* @see https://millsp.github.io/ts-toolbelt/modules/union_strict.html
|
||||
*/
|
||||
export type Deunionize<B extends object | undefined, T = B> = T extends object ? T & AddOptionalKeys<Exclude<UnionKeys<B>, keyof T>> : T;
|
||||
/**
|
||||
* Expose properties from all union variants.
|
||||
* @deprectated
|
||||
* @see https://github.com/telegraf/telegraf/issues/1388#issuecomment-791573609
|
||||
* @see https://millsp.github.io/ts-toolbelt/modules/union_strict.html
|
||||
*/
|
||||
export declare function deunionize<T extends object | undefined>(t: T): Deunionize<T, T>;
|
||||
export {};
|
||||
//# sourceMappingURL=deunionize.d.ts.map
|
||||
1
node_modules/telegraf/typings/core/helpers/deunionize.d.ts.map
generated
vendored
Normal file
1
node_modules/telegraf/typings/core/helpers/deunionize.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"deunionize.d.ts","sourceRoot":"","sources":["../../../src/core/helpers/deunionize.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,MAAM,CAChB,CAAC,SAAS,MAAM,GAAG,SAAS,EAC5B,CAAC,SAAS,MAAM,GAAG,MAAM,GAAG,MAAM,EAClC,CAAC,GAAG,SAAS,IACX,CAAC,SAAS,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA;AAEpD,MAAM,MAAM,SAAS,CAAC,CAAC,IAAI,CAAC,SAAS,OAAO,GAAG,MAAM,CAAC,GAAG,KAAK,CAAA;AAE9D,KAAK,eAAe,CAAC,CAAC,SAAS,WAAW,IAAI;IAAE,QAAQ,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,KAAK;CAAE,CAAA;AAE3E;;GAEG;AACH,MAAM,MAAM,UAAU,CAAC,CAAC,SAAS,MAAM,GAAG,SAAS,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,MAAM,GAC1E,CAAC,GAAG,eAAe,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,GACnD,CAAC,CAAA;AAEL;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,CAAC,SAAS,MAAM,GAAG,SAAS,EAAE,CAAC,EAAE,CAAC,oBAE5D"}
|
||||
30
node_modules/telegraf/typings/core/helpers/formatting.d.ts
generated
vendored
Normal file
30
node_modules/telegraf/typings/core/helpers/formatting.d.ts
generated
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
import { MessageEntity, User } from '@telegraf/types';
|
||||
import { Any } from './util';
|
||||
export type Nestable<Kind extends string> = string | number | boolean | FmtString<Kind>;
|
||||
export type MaybeNestableList<Kind extends string> = Nestable<Kind> | readonly Nestable<Kind>[];
|
||||
export interface FmtString<Brand extends string> {
|
||||
text: string;
|
||||
entities?: MessageEntity[];
|
||||
parse_mode?: undefined;
|
||||
__to_nest: Brand;
|
||||
}
|
||||
export declare class FmtString<Brand extends string = string> implements FmtString<Brand> {
|
||||
text: string;
|
||||
constructor(text: string, entities?: MessageEntity[]);
|
||||
static normalise(content: Nestable<string>): FmtString<string>;
|
||||
}
|
||||
/**
|
||||
* Given an `Iterable<FmtString | string | Any>` and a separator, flattens the list into a single FmtString.
|
||||
* Analogous to Array#join -> string, but for FmtString
|
||||
*/
|
||||
export declare const join: (fragments: Iterable<FmtString | string | Any>, separator?: string | FmtString) => FmtString<string>;
|
||||
/** Internal constructor for all fmt helpers */
|
||||
export declare function createFmt(kind?: MessageEntity['type'], opts?: object): (parts: MaybeNestableList<string>, ...items: Nestable<string>[]) => FmtString<string>;
|
||||
export declare const linkOrMention: (content: Nestable<string>, data: {
|
||||
type: 'text_link';
|
||||
url: string;
|
||||
} | {
|
||||
type: 'text_mention';
|
||||
user: User;
|
||||
}) => FmtString<string>;
|
||||
//# sourceMappingURL=formatting.d.ts.map
|
||||
1
node_modules/telegraf/typings/core/helpers/formatting.d.ts.map
generated
vendored
Normal file
1
node_modules/telegraf/typings/core/helpers/formatting.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"formatting.d.ts","sourceRoot":"","sources":["../../../src/core/helpers/formatting.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;AACrD,OAAO,EAAE,GAAG,EAAO,MAAM,QAAQ,CAAA;AAEjC,MAAM,MAAM,QAAQ,CAAC,IAAI,SAAS,MAAM,IACpC,MAAM,GACN,MAAM,GACN,OAAO,GACP,SAAS,CAAC,IAAI,CAAC,CAAA;AACnB,MAAM,MAAM,iBAAiB,CAAC,IAAI,SAAS,MAAM,IAC7C,QAAQ,CAAC,IAAI,CAAC,GACd,SAAS,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAA;AAE7B,MAAM,WAAW,SAAS,CAAC,KAAK,SAAS,MAAM;IAC7C,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,CAAC,EAAE,aAAa,EAAE,CAAA;IAC1B,UAAU,CAAC,EAAE,SAAS,CAAA;IACtB,SAAS,EAAE,KAAK,CAAA;CACjB;AAED,qBAAa,SAAS,CAAC,KAAK,SAAS,MAAM,GAAG,MAAM,CAClD,YAAW,SAAS,CAAC,KAAK,CAAC;IAGlB,IAAI,EAAE,MAAM;gBAAZ,IAAI,EAAE,MAAM,EACnB,QAAQ,CAAC,EAAE,aAAa,EAAE;IAQ5B,MAAM,CAAC,SAAS,CAAC,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC;CAI3C;AAqBD;;;GAGG;AACH,eAAO,MAAM,IAAI,cACJ,SAAS,SAAS,GAAG,MAAM,GAAG,GAAG,CAAC,cACjC,MAAM,GAAG,SAAS,sBAqB/B,CAAA;AAED,+CAA+C;AAC/C,wBAAgB,SAAS,CAAC,IAAI,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,EAAE,MAAM,WAE1D,kBAAkB,MAAM,CAAC,YACtB,SAAS,MAAM,CAAC,EAAE,uBAgB/B;AAED,eAAO,MAAM,aAAa,YACf,SAAS,MAAM,CAAC,QAErB;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GAClC;IAAE,IAAI,EAAE,cAAc,CAAC;IAAC,IAAI,EAAE,IAAI,CAAA;CAAE,sBAKzC,CAAA"}
|
||||
27
node_modules/telegraf/typings/core/helpers/util.d.ts
generated
vendored
Normal file
27
node_modules/telegraf/typings/core/helpers/util.d.ts
generated
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
/// <reference types="node" />
|
||||
import { FmtString } from './formatting';
|
||||
import { Deunionize, UnionKeys } from './deunionize';
|
||||
export declare const env: NodeJS.ProcessEnv;
|
||||
export type Any = {} | undefined | null;
|
||||
export type Expand<T> = T extends object ? T extends infer O ? {
|
||||
[K in keyof O]: O[K];
|
||||
} : never : T;
|
||||
export type MaybeArray<T> = T | T[];
|
||||
export type MaybePromise<T> = T | Promise<T>;
|
||||
export type NonemptyReadonlyArray<T> = readonly [T, ...T[]];
|
||||
export type ExclusiveKeys<A extends object, B extends object> = keyof Omit<A, keyof B>;
|
||||
export declare function fmtCaption<Extra extends {
|
||||
caption?: string | FmtString;
|
||||
} | undefined>(extra?: Extra): Extra extends undefined ? undefined : Omit<Extra, 'caption'> & {
|
||||
caption?: string;
|
||||
};
|
||||
export type DistinctKeys<T extends object> = Exclude<UnionKeys<T>, keyof T>;
|
||||
export type KeyedDistinct<T extends object, K extends DistinctKeys<T>> = Record<K, {}> & Deunionize<Record<K, {}>, T>;
|
||||
export type Keyed<T extends object, K extends UnionKeys<T>> = Record<K, {}> & Deunionize<Record<K, {}>, T>;
|
||||
/** Construct a generic type guard */
|
||||
export type Guard<X = unknown, Y extends X = X> = (x: X) => x is Y;
|
||||
/** Extract the guarded type from a type guard, defaults to never. */
|
||||
export type Guarded<F> = F extends (x: any) => x is infer T ? T : never;
|
||||
export declare function zip<X, Y>(xs: Iterable<X>, ys: Iterable<Y>): Iterable<X | Y>;
|
||||
export declare function indexed<T extends object, U>(target: T, indexer: (index: number) => U): T;
|
||||
//# sourceMappingURL=util.d.ts.map
|
||||
1
node_modules/telegraf/typings/core/helpers/util.d.ts.map
generated
vendored
Normal file
1
node_modules/telegraf/typings/core/helpers/util.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../src/core/helpers/util.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AACxC,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAEpD,eAAO,MAAM,GAAG,mBAAc,CAAA;AAG9B,MAAM,MAAM,GAAG,GAAG,EAAE,GAAG,SAAS,GAAG,IAAI,CAAA;AAEvC,MAAM,MAAM,MAAM,CAAC,CAAC,IAAI,CAAC,SAAS,MAAM,GACpC,CAAC,SAAS,MAAM,CAAC,GACf;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAE,GACxB,KAAK,GACP,CAAC,CAAA;AAEL,MAAM,MAAM,UAAU,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAA;AACnC,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAA;AAC5C,MAAM,MAAM,qBAAqB,CAAC,CAAC,IAAI,SAAS,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC,CAAA;AAG3D,MAAM,MAAM,aAAa,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,MAAM,IAAI,MAAM,IAAI,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAA;AAEtF,wBAAgB,UAAU,CACxB,KAAK,SAAS;IAAE,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,GAAG,SAAS,EAE1D,KAAK,CAAC,EAAE,KAAK,GACZ,KAAK,SAAS,SAAS,GACtB,SAAS,GACT,IAAI,CAAC,KAAK,EAAE,SAAS,CAAC,GAAG;IAAE,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,CAAA;AAiBjD,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,MAAM,IAAI,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAA;AAI3E,MAAM,MAAM,aAAa,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,YAAY,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,CAAA;AAIrH,MAAM,MAAM,KAAK,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,SAAS,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,CAAA;AAE1G,qCAAqC;AACrC,MAAM,MAAM,KAAK,CAAC,CAAC,GAAG,OAAO,EAAE,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;AAElE,qEAAqE;AACrE,MAAM,MAAM,OAAO,CAAC,CAAC,IAEnB,CAAC,SAAS,CAAC,CAAC,EAAE,GAAG,KAAK,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAA;AAEhD,wBAAiB,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,CAiB5E;AAED,wBAAgB,OAAO,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,EACzC,MAAM,EAAE,CAAC,EACT,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,CAAC,KAY9B"}
|
||||
55
node_modules/telegraf/typings/core/network/client.d.ts
generated
vendored
Normal file
55
node_modules/telegraf/typings/core/network/client.d.ts
generated
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
/// <reference types="node" />
|
||||
/// <reference types="node" />
|
||||
import * as http from 'http';
|
||||
import { Opts, Telegram } from '../types/typegram';
|
||||
import { AbortSignal } from 'abort-controller';
|
||||
import { URL } from 'url';
|
||||
declare namespace ApiClient {
|
||||
type Agent = http.Agent | ((parsedUrl: URL) => http.Agent) | undefined;
|
||||
interface Options {
|
||||
/**
|
||||
* Agent for communicating with the bot API.
|
||||
*/
|
||||
agent?: http.Agent;
|
||||
/**
|
||||
* Agent for attaching files via URL.
|
||||
* 1. Not all agents support both `http:` and `https:`.
|
||||
* 2. When passing a function, create the agents once, outside of the function.
|
||||
* Creating new agent every request probably breaks `keepAlive`.
|
||||
*/
|
||||
attachmentAgent?: Agent;
|
||||
apiRoot: string;
|
||||
/**
|
||||
* @default 'bot'
|
||||
* @see https://github.com/tdlight-team/tdlight-telegram-bot-api#user-mode
|
||||
*/
|
||||
apiMode: 'bot' | 'user';
|
||||
webhookReply: boolean;
|
||||
testEnv: boolean;
|
||||
}
|
||||
interface CallApiOptions {
|
||||
signal?: AbortSignal;
|
||||
}
|
||||
}
|
||||
type Response = http.ServerResponse;
|
||||
declare class ApiClient {
|
||||
readonly token: string;
|
||||
private readonly response?;
|
||||
readonly options: ApiClient.Options;
|
||||
constructor(token: string, options?: Partial<ApiClient.Options>, response?: Response | undefined);
|
||||
/**
|
||||
* If set to `true`, first _eligible_ call will avoid performing a POST request.
|
||||
* Note that such a call:
|
||||
* 1. cannot report errors or return meaningful values,
|
||||
* 2. resolves before bot API has a chance to process it,
|
||||
* 3. prematurely confirms the update as processed.
|
||||
*
|
||||
* https://core.telegram.org/bots/faq#how-can-i-make-requests-in-response-to-updates
|
||||
* https://github.com/telegraf/telegraf/pull/1250
|
||||
*/
|
||||
set webhookReply(enable: boolean);
|
||||
get webhookReply(): boolean;
|
||||
callApi<M extends keyof Telegram>(method: M, payload: Opts<M>, { signal }?: ApiClient.CallApiOptions): Promise<ReturnType<Telegram[M]>>;
|
||||
}
|
||||
export default ApiClient;
|
||||
//# sourceMappingURL=client.d.ts.map
|
||||
1
node_modules/telegraf/typings/core/network/client.d.ts.map
generated
vendored
Normal file
1
node_modules/telegraf/typings/core/network/client.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/core/network/client.ts"],"names":[],"mappings":";;AAIA,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAK5B,OAAO,EAAa,IAAI,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAI9C,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAazB,kBAAU,SAAS,CAAC;IAClB,KAAY,KAAK,GAAG,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,SAAS,EAAE,GAAG,KAAK,IAAI,CAAC,KAAK,CAAC,GAAG,SAAS,CAAA;IAC7E,UAAiB,OAAO;QACtB;;WAEG;QACH,KAAK,CAAC,EAAE,IAAI,CAAC,KAAK,CAAA;QAClB;;;;;WAKG;QACH,eAAe,CAAC,EAAE,KAAK,CAAA;QACvB,OAAO,EAAE,MAAM,CAAA;QACf;;;WAGG;QACH,OAAO,EAAE,KAAK,GAAG,MAAM,CAAA;QACvB,YAAY,EAAE,OAAO,CAAA;QACrB,OAAO,EAAE,OAAO,CAAA;KACjB;IAED,UAAiB,cAAc;QAC7B,MAAM,CAAC,EAAE,WAAW,CAAA;KACrB;CACF;AAuPD,KAAK,QAAQ,GAAG,IAAI,CAAC,cAAc,CAAA;AACnC,cAAM,SAAS;IAIX,QAAQ,CAAC,KAAK,EAAE,MAAM;IAEtB,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC;IAL5B,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAC,OAAO,CAAA;gBAGxB,KAAK,EAAE,MAAM,EACtB,OAAO,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,EACnB,QAAQ,CAAC,sBAAU;IAWtC;;;;;;;;;OASG;IACH,IAAI,YAAY,CAAC,MAAM,EAAE,OAAO,EAE/B;IAED,IAAI,YAAY,IAJS,OAAO,CAM/B;IAEK,OAAO,CAAC,CAAC,SAAS,MAAM,QAAQ,EACpC,MAAM,EAAE,CAAC,EACT,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,EAChB,EAAE,MAAM,EAAE,GAAE,SAAS,CAAC,cAAmB,GACxC,OAAO,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;CAoDpC;AAED,eAAe,SAAS,CAAA"}
|
||||
16
node_modules/telegraf/typings/core/network/error.d.ts
generated
vendored
Normal file
16
node_modules/telegraf/typings/core/network/error.d.ts
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
import { ResponseParameters } from '../types/typegram';
|
||||
interface ErrorPayload {
|
||||
error_code: number;
|
||||
description: string;
|
||||
parameters?: ResponseParameters;
|
||||
}
|
||||
export declare class TelegramError extends Error {
|
||||
readonly response: ErrorPayload;
|
||||
readonly on: {};
|
||||
constructor(response: ErrorPayload, on?: {});
|
||||
get code(): number;
|
||||
get description(): string;
|
||||
get parameters(): ResponseParameters | undefined;
|
||||
}
|
||||
export default TelegramError;
|
||||
//# sourceMappingURL=error.d.ts.map
|
||||
1
node_modules/telegraf/typings/core/network/error.d.ts.map
generated
vendored
Normal file
1
node_modules/telegraf/typings/core/network/error.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../../src/core/network/error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AAEtD,UAAU,YAAY;IACpB,UAAU,EAAE,MAAM,CAAA;IAClB,WAAW,EAAE,MAAM,CAAA;IACnB,UAAU,CAAC,EAAE,kBAAkB,CAAA;CAChC;AACD,qBAAa,aAAc,SAAQ,KAAK;IAEpC,QAAQ,CAAC,QAAQ,EAAE,YAAY;IAC/B,QAAQ,CAAC,EAAE;gBADF,QAAQ,EAAE,YAAY,EACtB,EAAE,KAAK;IAKlB,IAAI,IAAI,WAEP;IAED,IAAI,WAAW,WAEd;IAED,IAAI,UAAU,mCAEb;CACF;AAED,eAAe,aAAa,CAAA"}
|
||||
19
node_modules/telegraf/typings/core/network/multipart-stream.d.ts
generated
vendored
Normal file
19
node_modules/telegraf/typings/core/network/multipart-stream.d.ts
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
/// <reference types="node" />
|
||||
/// <reference types="node" />
|
||||
/// <reference types="node" />
|
||||
import SandwichStream from 'sandwich-stream';
|
||||
interface Part {
|
||||
headers: {
|
||||
[key: string]: string;
|
||||
};
|
||||
body: NodeJS.ReadStream | NodeJS.ReadableStream | Buffer | string;
|
||||
}
|
||||
declare class MultipartStream extends SandwichStream {
|
||||
constructor(boundary: string);
|
||||
addPart(part: Part): void;
|
||||
static isStream(stream: unknown): stream is {
|
||||
pipe: MultipartStream['pipe'];
|
||||
};
|
||||
}
|
||||
export default MultipartStream;
|
||||
//# sourceMappingURL=multipart-stream.d.ts.map
|
||||
1
node_modules/telegraf/typings/core/network/multipart-stream.d.ts.map
generated
vendored
Normal file
1
node_modules/telegraf/typings/core/network/multipart-stream.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"multipart-stream.d.ts","sourceRoot":"","sources":["../../../src/core/network/multipart-stream.ts"],"names":[],"mappings":";;;AAEA,OAAO,cAAc,MAAM,iBAAiB,CAAA;AAG5C,UAAU,IAAI;IACZ,OAAO,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAA;IAClC,IAAI,EAAE,MAAM,CAAC,UAAU,GAAG,MAAM,CAAC,cAAc,GAAG,MAAM,GAAG,MAAM,CAAA;CAClE;AAED,cAAM,eAAgB,SAAQ,cAAc;gBAC9B,QAAQ,EAAE,MAAM;IAQ5B,OAAO,CAAC,IAAI,EAAE,IAAI;IAclB,MAAM,CAAC,QAAQ,CACb,MAAM,EAAE,OAAO,GACd,MAAM,IAAI;QAAE,IAAI,EAAE,eAAe,CAAC,MAAM,CAAC,CAAA;KAAE;CAO/C;AAED,eAAe,eAAe,CAAA"}
|
||||
16
node_modules/telegraf/typings/core/network/polling.d.ts
generated
vendored
Normal file
16
node_modules/telegraf/typings/core/network/polling.d.ts
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
import * as tg from '../types/typegram';
|
||||
import * as tt from '../../telegram-types';
|
||||
import ApiClient from './client';
|
||||
export declare class Polling {
|
||||
private readonly telegram;
|
||||
private readonly allowedUpdates;
|
||||
private readonly abortController;
|
||||
private skipOffsetSync;
|
||||
private offset;
|
||||
constructor(telegram: ApiClient, allowedUpdates: readonly tt.UpdateType[]);
|
||||
private [Symbol.asyncIterator];
|
||||
private syncUpdateOffset;
|
||||
loop(handleUpdate: (updates: tg.Update) => Promise<void>): Promise<void>;
|
||||
stop(): void;
|
||||
}
|
||||
//# sourceMappingURL=polling.d.ts.map
|
||||
1
node_modules/telegraf/typings/core/network/polling.d.ts.map
generated
vendored
Normal file
1
node_modules/telegraf/typings/core/network/polling.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"polling.d.ts","sourceRoot":"","sources":["../../../src/core/network/polling.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACvC,OAAO,KAAK,EAAE,MAAM,sBAAsB,CAAA;AAE1C,OAAO,SAAS,MAAM,UAAU,CAAA;AAWhC,qBAAa,OAAO;IAKhB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,cAAc;IALjC,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAwB;IACxD,OAAO,CAAC,cAAc,CAAQ;IAC9B,OAAO,CAAC,MAAM,CAAI;gBAEC,QAAQ,EAAE,SAAS,EACnB,cAAc,EAAE,SAAS,EAAE,CAAC,UAAU,EAAE;YAG5C,CAAC,MAAM,CAAC,aAAa,CAAC;YA+CvB,gBAAgB;IAMxB,IAAI,CAAC,YAAY,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC;IAc9D,IAAI;CAGL"}
|
||||
7
node_modules/telegraf/typings/core/network/webhook.d.ts
generated
vendored
Normal file
7
node_modules/telegraf/typings/core/network/webhook.d.ts
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
/// <reference types="node" />
|
||||
import * as http from 'http';
|
||||
import { type Update } from '../types/typegram';
|
||||
export default function generateWebhook(filter: (req: http.IncomingMessage) => boolean, updateHandler: (update: Update, res: http.ServerResponse) => Promise<void>): (req: http.IncomingMessage & {
|
||||
body?: Update;
|
||||
}, res: http.ServerResponse, next?: () => void) => Promise<void>;
|
||||
//# sourceMappingURL=webhook.d.ts.map
|
||||
1
node_modules/telegraf/typings/core/network/webhook.d.ts.map
generated
vendored
Normal file
1
node_modules/telegraf/typings/core/network/webhook.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"webhook.d.ts","sourceRoot":"","sources":["../../../src/core/network/webhook.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAE5B,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAG/C,MAAM,CAAC,OAAO,UAAU,eAAe,CACrC,MAAM,EAAE,CAAC,GAAG,EAAE,IAAI,CAAC,eAAe,KAAK,OAAO,EAC9C,aAAa,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,CAAC,cAAc,KAAK,OAAO,CAAC,IAAI,CAAC,SAGnE,KAAK,eAAe,GAAG;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,OACxC,KAAK,cAAc,eACb,IAAI,KAKd,QAAQ,IAAI,CAAC,CAwCjB"}
|
||||
44
node_modules/telegraf/typings/core/types/typegram.d.ts
generated
vendored
Normal file
44
node_modules/telegraf/typings/core/types/typegram.d.ts
generated
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
/// <reference types="node" />
|
||||
/// <reference types="node" />
|
||||
import * as Typegram from '@telegraf/types';
|
||||
export * from '@telegraf/types/api';
|
||||
export * from '@telegraf/types/inline';
|
||||
export * from '@telegraf/types/manage';
|
||||
export * from '@telegraf/types/markup';
|
||||
export * from '@telegraf/types/message';
|
||||
export * from '@telegraf/types/methods';
|
||||
export * from '@telegraf/types/passport';
|
||||
export * from '@telegraf/types/payment';
|
||||
export * from '@telegraf/types/settings';
|
||||
export * from '@telegraf/types/update';
|
||||
interface InputFileByPath {
|
||||
source: string;
|
||||
filename?: string;
|
||||
}
|
||||
interface InputFileByReadableStream {
|
||||
source: NodeJS.ReadableStream;
|
||||
filename?: string;
|
||||
}
|
||||
interface InputFileByBuffer {
|
||||
source: Buffer;
|
||||
filename?: string;
|
||||
}
|
||||
interface InputFileByURL {
|
||||
url: string;
|
||||
filename?: string;
|
||||
}
|
||||
export type InputFile = InputFileByPath | InputFileByReadableStream | InputFileByBuffer | InputFileByURL;
|
||||
export type Telegram = Typegram.ApiMethods<InputFile>;
|
||||
export type Opts<M extends keyof Telegram> = Typegram.Opts<InputFile>[M];
|
||||
export type InputMedia = Typegram.InputMedia<InputFile>;
|
||||
export type InputMediaPhoto = Typegram.InputMediaPhoto<InputFile>;
|
||||
export type InputMediaVideo = Typegram.InputMediaVideo<InputFile>;
|
||||
export type InputMediaAnimation = Typegram.InputMediaAnimation<InputFile>;
|
||||
export type InputMediaAudio = Typegram.InputMediaAudio<InputFile>;
|
||||
export type InputMediaDocument = Typegram.InputMediaDocument<InputFile>;
|
||||
export type ChatAction = Opts<'sendChatAction'>['action'];
|
||||
/**
|
||||
* Sending video notes by a URL is currently unsupported
|
||||
*/
|
||||
export type InputFileVideoNote = Exclude<InputFile, InputFileByURL>;
|
||||
//# sourceMappingURL=typegram.d.ts.map
|
||||
1
node_modules/telegraf/typings/core/types/typegram.d.ts.map
generated
vendored
Normal file
1
node_modules/telegraf/typings/core/types/typegram.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"typegram.d.ts","sourceRoot":"","sources":["../../../src/core/types/typegram.ts"],"names":[],"mappings":";;AAAA,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAA;AAG3C,cAAc,qBAAqB,CAAA;AACnC,cAAc,wBAAwB,CAAA;AACtC,cAAc,wBAAwB,CAAA;AACtC,cAAc,wBAAwB,CAAA;AACtC,cAAc,yBAAyB,CAAA;AACvC,cAAc,yBAAyB,CAAA;AACvC,cAAc,0BAA0B,CAAA;AACxC,cAAc,yBAAyB,CAAA;AACvC,cAAc,0BAA0B,CAAA;AACxC,cAAc,wBAAwB,CAAA;AAGtC,UAAU,eAAe;IACvB,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AACD,UAAU,yBAAyB;IACjC,MAAM,EAAE,MAAM,CAAC,cAAc,CAAA;IAC7B,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AACD,UAAU,iBAAiB;IACzB,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AACD,UAAU,cAAc;IACtB,GAAG,EAAE,MAAM,CAAA;IACX,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AACD,MAAM,MAAM,SAAS,GACjB,eAAe,GACf,yBAAyB,GACzB,iBAAiB,GACjB,cAAc,CAAA;AAElB,MAAM,MAAM,QAAQ,GAAG,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,CAAA;AAErD,MAAM,MAAM,IAAI,CAAC,CAAC,SAAS,MAAM,QAAQ,IAAI,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAA;AACxE,MAAM,MAAM,UAAU,GAAG,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,CAAA;AACvD,MAAM,MAAM,eAAe,GAAG,QAAQ,CAAC,eAAe,CAAC,SAAS,CAAC,CAAA;AACjE,MAAM,MAAM,eAAe,GAAG,QAAQ,CAAC,eAAe,CAAC,SAAS,CAAC,CAAA;AACjE,MAAM,MAAM,mBAAmB,GAAG,QAAQ,CAAC,mBAAmB,CAAC,SAAS,CAAC,CAAA;AACzE,MAAM,MAAM,eAAe,GAAG,QAAQ,CAAC,eAAe,CAAC,SAAS,CAAC,CAAA;AACjE,MAAM,MAAM,kBAAkB,GAAG,QAAQ,CAAC,kBAAkB,CAAC,SAAS,CAAC,CAAA;AAGvE,MAAM,MAAM,UAAU,GAAG,IAAI,CAAC,gBAAgB,CAAC,CAAC,QAAQ,CAAC,CAAA;AAEzD;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,OAAO,CAAC,SAAS,EAAE,cAAc,CAAC,CAAA"}
|
||||
18
node_modules/telegraf/typings/filters.d.ts
generated
vendored
Normal file
18
node_modules/telegraf/typings/filters.d.ts
generated
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
import type { CallbackQuery, CommonMessageBundle, Message, Update } from '@telegraf/types';
|
||||
import { DistinctKeys, KeyedDistinct, Guarded } from './core/helpers/util';
|
||||
export type Filter<U extends Update> = (update: Update) => update is U;
|
||||
export { Guarded };
|
||||
export type AllGuarded<Fs extends Filter<Update>[]> = Fs extends [
|
||||
infer A,
|
||||
...infer B
|
||||
] ? B extends [] ? Guarded<A> : B extends Filter<Update>[] ? Guarded<A> & AllGuarded<B> : never : never;
|
||||
export declare const message: <Ks extends DistinctKeys<Message>[]>(...keys: Ks) => (update: Update) => update is Update.MessageUpdate<KeyedDistinct<Message, Ks[number]>>;
|
||||
export declare const editedMessage: <Ks extends DistinctKeys<CommonMessageBundle>[]>(...keys: Ks) => (update: Update) => update is Update.EditedMessageUpdate<KeyedDistinct<CommonMessageBundle, Ks[number]>>;
|
||||
export declare const channelPost: <Ks extends DistinctKeys<Message>[]>(...keys: Ks) => (update: Update) => update is Update.ChannelPostUpdate<KeyedDistinct<Message, Ks[number]>>;
|
||||
export declare const editedChannelPost: <Ks extends DistinctKeys<CommonMessageBundle>[]>(...keys: Ks) => (update: Update) => update is Update.EditedChannelPostUpdate<KeyedDistinct<CommonMessageBundle, Ks[number]>>;
|
||||
export declare const callbackQuery: <Ks extends DistinctKeys<CallbackQuery>[]>(...keys: Ks) => (update: Update) => update is Update.CallbackQueryUpdate<KeyedDistinct<CallbackQuery, Ks[number]>>;
|
||||
/** Any of the provided filters must match */
|
||||
export declare const anyOf: <Us extends Update[]>(...filters: { [UIdx in keyof Us]: Filter<Us[UIdx]>; }) => (update: Update) => update is Us[number];
|
||||
/** All of the provided filters must match */
|
||||
export declare const allOf: <U extends Update, Fs extends Filter<U>[]>(...filters: Fs) => (update: Update) => update is AllGuarded<Fs>;
|
||||
//# sourceMappingURL=filters.d.ts.map
|
||||
1
node_modules/telegraf/typings/filters.d.ts.map
generated
vendored
Normal file
1
node_modules/telegraf/typings/filters.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"filters.d.ts","sourceRoot":"","sources":["../src/filters.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,mBAAmB,EACnB,OAAO,EACP,MAAM,EACP,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAE1E,MAAM,MAAM,MAAM,CAAC,CAAC,SAAS,MAAM,IAAI,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,IAAI,CAAC,CAAA;AAEtE,OAAO,EAAE,OAAO,EAAE,CAAA;AAElB,MAAM,MAAM,UAAU,CAAC,EAAE,SAAS,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,SAAS;IAC/D,MAAM,CAAC;IACP,GAAG,MAAM,CAAC;CACX,GACG,CAAC,SAAS,EAAE,GACV,OAAO,CAAC,CAAC,CAAC,GAEV,CAAC,SAAS,MAAM,CAAC,MAAM,CAAC,EAAE,GACxB,OAAO,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,GAC1B,KAAK,GACT,KAAK,CAAA;AAET,eAAO,MAAM,OAAO,gEAGR,MAAM,uEAOf,CAAA;AAEH,eAAO,MAAM,aAAa,4EAGd,MAAM,yFASf,CAAA;AAEH,eAAO,MAAM,WAAW,gEAGZ,MAAM,2EAOf,CAAA;AAEH,eAAO,MAAM,iBAAiB,4EAGlB,MAAM,6FASf,CAAA;AAEH,eAAO,MAAM,aAAa,sEAGd,MAAM,mFASf,CAAA;AAEH,6CAA6C;AAC7C,eAAO,MAAM,KAAK,2FAMP,MAAM,yBAGd,CAAA;AAEH,6CAA6C;AAC7C,eAAO,MAAM,KAAK,yEAEP,MAAM,6BAGd,CAAA"}
|
||||
22
node_modules/telegraf/typings/format.d.ts
generated
vendored
Normal file
22
node_modules/telegraf/typings/format.d.ts
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
import { User } from '@telegraf/types';
|
||||
import { FmtString } from './core/helpers/formatting';
|
||||
export { FmtString };
|
||||
type Nestable<Kind extends string> = string | number | boolean | FmtString<Kind>;
|
||||
type Nesting<Kind extends string> = [
|
||||
parts: Nestable<Kind> | readonly Nestable<Kind>[],
|
||||
...items: Nestable<Kind>[]
|
||||
];
|
||||
type Nests<Is extends string, Kind extends string> = (...args: Nesting<Kind>) => FmtString<Is>;
|
||||
export declare const join: Nests<"fmt", string>;
|
||||
export declare const fmt: Nests<"fmt", string>;
|
||||
export declare const bold: Nests<"bold", "bold" | "italic" | "underline" | "strikethrough" | "spoiler" | "fmt">;
|
||||
export declare const italic: Nests<"italic", "bold" | "italic" | "underline" | "strikethrough" | "spoiler" | "fmt">;
|
||||
export declare const spoiler: Nests<"spoiler", "bold" | "italic" | "underline" | "strikethrough" | "spoiler" | "fmt">;
|
||||
export declare const strikethrough: Nests<"strikethrough", "bold" | "italic" | "underline" | "strikethrough" | "spoiler" | "fmt">;
|
||||
export declare const underline: Nests<"underline", "bold" | "italic" | "underline" | "strikethrough" | "spoiler" | "fmt">;
|
||||
export declare const quote: Nests<"blockquote", "bold" | "italic" | "underline" | "strikethrough" | "spoiler" | "code" | "fmt">;
|
||||
export declare const code: Nests<"code", never>;
|
||||
export declare const pre: (language: string) => Nests<"pre", never>;
|
||||
export declare const link: (content: Nestable<'fmt' | 'bold' | 'italic' | 'underline' | 'strikethrough' | 'spoiler' | 'code'>, url: string) => FmtString<"text_link">;
|
||||
export declare const mention: (name: Nestable<'fmt' | 'bold' | 'italic' | 'underline' | 'strikethrough' | 'spoiler' | 'code'>, user: number | User) => FmtString<"text_link"> | FmtString<"text_mention">;
|
||||
//# sourceMappingURL=format.d.ts.map
|
||||
1
node_modules/telegraf/typings/format.d.ts.map
generated
vendored
Normal file
1
node_modules/telegraf/typings/format.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../src/format.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;AACtC,OAAO,EACL,SAAS,EAIV,MAAM,2BAA2B,CAAA;AAElC,OAAO,EAAE,SAAS,EAAE,CAAA;AAEpB,KAAK,QAAQ,CAAC,IAAI,SAAS,MAAM,IAAI,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC,IAAI,CAAC,CAAA;AAChF,KAAK,OAAO,CAAC,IAAI,SAAS,MAAM,IAAI;IAClC,KAAK,EAAE,QAAQ,CAAC,IAAI,CAAC,GAAG,SAAS,QAAQ,CAAC,IAAI,CAAC,EAAE;IACjD,GAAG,KAAK,EAAE,QAAQ,CAAC,IAAI,CAAC,EAAE;CAC3B,CAAA;AACD,KAAK,KAAK,CAAC,EAAE,SAAS,MAAM,EAAE,IAAI,SAAS,MAAM,IAAI,CACnD,GAAG,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,KACnB,SAAS,CAAC,EAAE,CAAC,CAAA;AASlB,eAAO,MAAM,IAAI,sBAAgC,CAAA;AAEjD,eAAO,MAAM,GAAG,sBAAsC,CAAA;AAEtD,eAAO,MAAM,IAAI,sFAGhB,CAAA;AAED,eAAO,MAAM,MAAM,wFAGlB,CAAA;AAED,eAAO,MAAM,OAAO,yFAGnB,CAAA;AAED,eAAO,MAAM,aAAa,+FAKvB,CAAA;AAEH,eAAO,MAAM,SAAS,2FAKnB,CAAA;AAEH,eAAO,MAAM,KAAK,qGAWf,CAAA;AAEH,eAAO,MAAM,IAAI,sBAA4C,CAAA;AAE7D,eAAO,MAAM,GAAG,aAAc,MAAM,wBACmB,CAAA;AAEvD,eAAO,MAAM,IAAI,YACN,SACL,KAAK,GACL,MAAM,GACN,QAAQ,GACR,WAAW,GACX,eAAe,GACf,SAAS,GACT,MAAM,CACT,OACI,MAAM,2BAGiE,CAAA;AAE9E,eAAO,MAAM,OAAO,SACZ,SACF,KAAK,GACL,MAAM,GACN,QAAQ,GACR,WAAW,GACX,eAAe,GACf,SAAS,GACT,MAAM,CACT,QACK,MAAM,GAAG,IAAI,uDAOiB,CAAA"}
|
||||
12
node_modules/telegraf/typings/future.d.ts
generated
vendored
Normal file
12
node_modules/telegraf/typings/future.d.ts
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
import Context from './context';
|
||||
import { Middleware } from './middleware';
|
||||
/**
|
||||
* Sets up Context to use the new reply methods.
|
||||
* This middleware makes `ctx.reply()` and `ctx.replyWith*()` methods will actually reply to the message they are replying to.
|
||||
* Use `ctx.sendMessage()` to send a message in chat without replying to it.
|
||||
*
|
||||
* If the message to reply is deleted, `reply()` will send a normal message.
|
||||
* If the update is not a message and we are unable to reply, `reply()` will send a normal message.
|
||||
*/
|
||||
export declare function useNewReplies<C extends Context>(): Middleware<C>;
|
||||
//# sourceMappingURL=future.d.ts.map
|
||||
1
node_modules/telegraf/typings/future.d.ts.map
generated
vendored
Normal file
1
node_modules/telegraf/typings/future.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"future.d.ts","sourceRoot":"","sources":["../src/future.ts"],"names":[],"mappings":"AACA,OAAO,OAAO,MAAM,WAAW,CAAA;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAgLzC;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,CAAC,SAAS,OAAO,KAAK,UAAU,CAAC,CAAC,CAAC,CA0BhE"}
|
||||
15
node_modules/telegraf/typings/index.d.ts
generated
vendored
Normal file
15
node_modules/telegraf/typings/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
export { Telegraf } from './telegraf';
|
||||
export { Context, NarrowedContext } from './context';
|
||||
export { Composer } from './composer';
|
||||
export { Middleware, MiddlewareFn, MiddlewareObj } from './middleware';
|
||||
export { Router } from './router';
|
||||
export { TelegramError } from './core/network/error';
|
||||
export { Telegram } from './telegram';
|
||||
export * as Types from './telegram-types';
|
||||
export * as Markup from './markup';
|
||||
export * as Input from './input';
|
||||
export * as Format from './format';
|
||||
export { deunionize } from './core/helpers/deunionize';
|
||||
export { session, MemorySessionStore, SessionStore } from './session';
|
||||
export * as Scenes from './scenes';
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
1
node_modules/telegraf/typings/index.d.ts.map
generated
vendored
Normal file
1
node_modules/telegraf/typings/index.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAA;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AACtE,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAErC,OAAO,KAAK,KAAK,MAAM,kBAAkB,CAAA;AACzC,OAAO,KAAK,MAAM,MAAM,UAAU,CAAA;AAClC,OAAO,KAAK,KAAK,MAAM,SAAS,CAAA;AAChC,OAAO,KAAK,MAAM,MAAM,UAAU,CAAA;AAElC,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAA;AACtD,OAAO,EAAE,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAErE,OAAO,KAAK,MAAM,MAAM,UAAU,CAAA"}
|
||||
55
node_modules/telegraf/typings/input.d.ts
generated
vendored
Normal file
55
node_modules/telegraf/typings/input.d.ts
generated
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
/// <reference types="node" />
|
||||
/// <reference types="node" />
|
||||
/// <reference types="node" />
|
||||
/// <reference types="node" />
|
||||
/// <reference types="node" />
|
||||
import { InputFile } from './core/types/typegram';
|
||||
/**
|
||||
* The local file specified by path will be uploaded to Telegram using multipart/form-data.
|
||||
*
|
||||
* 10 MB max size for photos, 50 MB for other files.
|
||||
*/
|
||||
export declare const fromLocalFile: (path: string, filename?: string) => InputFile;
|
||||
/**
|
||||
* The buffer will be uploaded as file to Telegram using multipart/form-data.
|
||||
*
|
||||
* 10 MB max size for photos, 50 MB for other files.
|
||||
*/
|
||||
export declare const fromBuffer: (buffer: Buffer, filename?: string) => InputFile;
|
||||
/**
|
||||
* Contents of the stream will be uploaded as file to Telegram using multipart/form-data.
|
||||
*
|
||||
* 10 MB max size for photos, 50 MB for other files.
|
||||
*/
|
||||
export declare const fromReadableStream: (stream: NodeJS.ReadableStream, filename?: string) => InputFile;
|
||||
/**
|
||||
* Contents of the URL will be streamed to Telegram.
|
||||
*
|
||||
* 10 MB max size for photos, 50 MB for other files.
|
||||
*/
|
||||
export declare const fromURLStream: (url: string | URL, filename?: string) => InputFile;
|
||||
/**
|
||||
* Provide Telegram with an HTTP URL for the file to be sent.
|
||||
* Telegram will download and send the file.
|
||||
*
|
||||
* * The target file must have the correct MIME type (e.g., audio/mpeg for `sendAudio`, etc.).
|
||||
* * `sendDocument` with URL will currently only work for GIF, PDF and ZIP files.
|
||||
* * To use `sendVoice`, the file must have the type audio/ogg and be no more than 1MB in size.
|
||||
* 1-20MB voice notes will be sent as files.
|
||||
*
|
||||
* 5 MB max size for photos and 20 MB max for other types of content.
|
||||
*/
|
||||
export declare const fromURL: (url: string | URL) => string;
|
||||
/**
|
||||
* If the file is already stored somewhere on the Telegram servers, you don't need to reupload it:
|
||||
* each file object has a file_id field, simply pass this file_id as a parameter instead of uploading.
|
||||
*
|
||||
* It is not possible to change the file type when resending by file_id.
|
||||
*
|
||||
* It is not possible to resend thumbnails using file_id.
|
||||
* They have to be uploaded using one of the other Input methods.
|
||||
*
|
||||
* There are no limits for files sent this way.
|
||||
*/
|
||||
export declare const fromFileId: (fileId: string) => string;
|
||||
//# sourceMappingURL=input.d.ts.map
|
||||
1
node_modules/telegraf/typings/input.d.ts.map
generated
vendored
Normal file
1
node_modules/telegraf/typings/input.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../src/input.ts"],"names":[],"mappings":";;;;;AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AAEjD;;;;GAIG;AAEH,eAAO,MAAM,aAAa,SAAU,MAAM,aAAa,MAAM,KAAG,SAAyC,CAAA;AAEzG;;;;GAIG;AAEH,eAAO,MAAM,UAAU,WAAY,MAAM,aAAa,MAAM,KAAG,SAA2C,CAAA;AAE1G;;;;GAIG;AAEH,eAAO,MAAM,kBAAkB,WAAY,qBAAqB,aAAa,MAAM,KAAG,SAA2C,CAAA;AAEjI;;;;GAIG;AAEH,eAAO,MAAM,aAAa,QAAS,MAAM,GAAG,GAAG,aAAa,MAAM,KAAG,SAAgD,CAAA;AAErH;;;;;;;;;;GAUG;AACH,eAAO,MAAM,OAAO,QAAS,MAAM,GAAG,GAAG,KAAG,MAAwB,CAAA;AAEpE;;;;;;;;;;GAUG;AACH,eAAO,MAAM,UAAU,WAAY,MAAM,KAAG,MAAgB,CAAA"}
|
||||
27
node_modules/telegraf/typings/markup.d.ts
generated
vendored
Normal file
27
node_modules/telegraf/typings/markup.d.ts
generated
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
import { ForceReply, InlineKeyboardButton, InlineKeyboardMarkup, KeyboardButton, ReplyKeyboardMarkup, ReplyKeyboardRemove } from './core/types/typegram';
|
||||
type Hideable<B> = B & {
|
||||
hide?: boolean;
|
||||
};
|
||||
type HideableKBtn = Hideable<KeyboardButton>;
|
||||
type HideableIKBtn = Hideable<InlineKeyboardButton>;
|
||||
export declare class Markup<T extends InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply> {
|
||||
readonly reply_markup: T;
|
||||
constructor(reply_markup: T);
|
||||
selective<T extends ForceReply | ReplyKeyboardMarkup>(this: Markup<T>, value?: boolean): Markup<T>;
|
||||
placeholder<T extends ForceReply | ReplyKeyboardMarkup>(this: Markup<T>, placeholder: string): Markup<T>;
|
||||
resize(this: Markup<ReplyKeyboardMarkup>, value?: boolean): Markup<ReplyKeyboardMarkup>;
|
||||
oneTime(this: Markup<ReplyKeyboardMarkup>, value?: boolean): Markup<ReplyKeyboardMarkup>;
|
||||
persistent(this: Markup<ReplyKeyboardMarkup>, value?: boolean): Markup<ReplyKeyboardMarkup>;
|
||||
}
|
||||
export * as button from './button';
|
||||
export declare function removeKeyboard(): Markup<ReplyKeyboardRemove>;
|
||||
export declare function forceReply(): Markup<ForceReply>;
|
||||
export declare function keyboard(buttons: HideableKBtn[][]): Markup<ReplyKeyboardMarkup>;
|
||||
export declare function keyboard(buttons: HideableKBtn[], options?: Partial<KeyboardBuildingOptions<HideableKBtn>>): Markup<ReplyKeyboardMarkup>;
|
||||
export declare function inlineKeyboard(buttons: HideableIKBtn[][]): Markup<InlineKeyboardMarkup>;
|
||||
export declare function inlineKeyboard(buttons: HideableIKBtn[], options?: Partial<KeyboardBuildingOptions<HideableIKBtn>>): Markup<InlineKeyboardMarkup>;
|
||||
interface KeyboardBuildingOptions<B extends HideableKBtn | HideableIKBtn> {
|
||||
wrap?: (btn: B, index: number, currentRow: B[]) => boolean;
|
||||
columns: number;
|
||||
}
|
||||
//# sourceMappingURL=markup.d.ts.map
|
||||
1
node_modules/telegraf/typings/markup.d.ts.map
generated
vendored
Normal file
1
node_modules/telegraf/typings/markup.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"markup.d.ts","sourceRoot":"","sources":["../src/markup.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,oBAAoB,EACpB,oBAAoB,EACpB,cAAc,EACd,mBAAmB,EACnB,mBAAmB,EACpB,MAAM,uBAAuB,CAAA;AAG9B,KAAK,QAAQ,CAAC,CAAC,IAAI,CAAC,GAAG;IAAE,IAAI,CAAC,EAAE,OAAO,CAAA;CAAE,CAAA;AACzC,KAAK,YAAY,GAAG,QAAQ,CAAC,cAAc,CAAC,CAAA;AAC5C,KAAK,aAAa,GAAG,QAAQ,CAAC,oBAAoB,CAAC,CAAA;AAEnD,qBAAa,MAAM,CACjB,CAAC,SACG,oBAAoB,GACpB,mBAAmB,GACnB,mBAAmB,GACnB,UAAU;IAEF,QAAQ,CAAC,YAAY,EAAE,CAAC;gBAAf,YAAY,EAAE,CAAC;IAEpC,SAAS,CAAC,CAAC,SAAS,UAAU,GAAG,mBAAmB,EAClD,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,EACf,KAAK,UAAO;IAKd,WAAW,CAAC,CAAC,SAAS,UAAU,GAAG,mBAAmB,EACpD,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,EACf,WAAW,EAAE,MAAM;IAQrB,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,mBAAmB,CAAC,EAAE,KAAK,UAAO;IAOtD,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,mBAAmB,CAAC,EAAE,KAAK,UAAO;IAOvD,UAAU,CAAC,IAAI,EAAE,MAAM,CAAC,mBAAmB,CAAC,EAAE,KAAK,UAAO;CAM3D;AAED,OAAO,KAAK,MAAM,MAAM,UAAU,CAAA;AAElC,wBAAgB,cAAc,IAAI,MAAM,CAAC,mBAAmB,CAAC,CAE5D;AAED,wBAAgB,UAAU,IAAI,MAAM,CAAC,UAAU,CAAC,CAE/C;AAED,wBAAgB,QAAQ,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,GAAG,MAAM,CAAC,mBAAmB,CAAC,CAAA;AAChF,wBAAgB,QAAQ,CACtB,OAAO,EAAE,YAAY,EAAE,EACvB,OAAO,CAAC,EAAE,OAAO,CAAC,uBAAuB,CAAC,YAAY,CAAC,CAAC,GACvD,MAAM,CAAC,mBAAmB,CAAC,CAAA;AAY9B,wBAAgB,cAAc,CAC5B,OAAO,EAAE,aAAa,EAAE,EAAE,GACzB,MAAM,CAAC,oBAAoB,CAAC,CAAA;AAC/B,wBAAgB,cAAc,CAC5B,OAAO,EAAE,aAAa,EAAE,EACxB,OAAO,CAAC,EAAE,OAAO,CAAC,uBAAuB,CAAC,aAAa,CAAC,CAAC,GACxD,MAAM,CAAC,oBAAoB,CAAC,CAAA;AAY/B,UAAU,uBAAuB,CAAC,CAAC,SAAS,YAAY,GAAG,aAAa;IACtE,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC,EAAE,KAAK,OAAO,CAAA;IAC1D,OAAO,EAAE,MAAM,CAAA;CAChB"}
|
||||
8
node_modules/telegraf/typings/middleware.d.ts
generated
vendored
Normal file
8
node_modules/telegraf/typings/middleware.d.ts
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
import { Context } from './context';
|
||||
import { Update } from './core/types/typegram';
|
||||
export type MiddlewareFn<C extends Context<U>, U extends Update = Update> = (ctx: C, next: () => Promise<void>) => Promise<unknown> | void;
|
||||
export interface MiddlewareObj<C extends Context<U>, U extends Update = Update> {
|
||||
middleware: () => MiddlewareFn<C, U>;
|
||||
}
|
||||
export type Middleware<C extends Context<U>, U extends Update = Update> = MiddlewareFn<C, U> | MiddlewareObj<C, U>;
|
||||
//# sourceMappingURL=middleware.d.ts.map
|
||||
1
node_modules/telegraf/typings/middleware.d.ts.map
generated
vendored
Normal file
1
node_modules/telegraf/typings/middleware.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"middleware.d.ts","sourceRoot":"","sources":["../src/middleware.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AAQ9C,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,GAAG,MAAM,IAAI,CAC1E,GAAG,EAAE,CAAC,EACN,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,KACtB,OAAO,CAAC,OAAO,CAAC,GAAG,IAAI,CAAA;AAE5B,MAAM,WAAW,aAAa,CAC5B,CAAC,SAAS,OAAO,CAAC,CAAC,CAAC,EACpB,CAAC,SAAS,MAAM,GAAG,MAAM;IAEzB,UAAU,EAAE,MAAM,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;CACrC;AAED,MAAM,MAAM,UAAU,CAAC,CAAC,SAAS,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,GAAG,MAAM,IAClE,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC,GAClB,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA"}
|
||||
32
node_modules/telegraf/typings/reactions.d.ts
generated
vendored
Normal file
32
node_modules/telegraf/typings/reactions.d.ts
generated
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
import { Deunionize } from './core/helpers/deunionize';
|
||||
import * as tg from './core/types/typegram';
|
||||
export type Digit = '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9';
|
||||
export declare const Digit: Set<string>;
|
||||
export type Reaction = tg.TelegramEmoji | `${Digit}${string}` | Deunionize<tg.ReactionType>;
|
||||
type ReactionCtx = {
|
||||
update: Partial<tg.Update.MessageReactionUpdate>;
|
||||
};
|
||||
export declare class ReactionList {
|
||||
protected list: tg.ReactionType[];
|
||||
[index: number]: Deunionize<tg.ReactionType>;
|
||||
protected constructor(list: tg.ReactionType[]);
|
||||
static fromArray(list?: tg.ReactionType[]): ReactionList;
|
||||
static has(reactions: tg.ReactionType[], reaction: Reaction): boolean;
|
||||
toArray(): tg.ReactionType[];
|
||||
filter(filterFn: (value: tg.ReactionType, index: number) => boolean): ReactionList;
|
||||
has(reaction: Reaction): boolean;
|
||||
get count(): number;
|
||||
[Symbol.iterator](): IterableIterator<tg.ReactionType>;
|
||||
}
|
||||
export declare class MessageReactions extends ReactionList {
|
||||
ctx: ReactionCtx;
|
||||
private constructor();
|
||||
static from(ctx: ReactionCtx): MessageReactions;
|
||||
get old(): ReactionList;
|
||||
get new(): ReactionList;
|
||||
get added(): ReactionList;
|
||||
get removed(): ReactionList;
|
||||
get kept(): ReactionList;
|
||||
}
|
||||
export {};
|
||||
//# sourceMappingURL=reactions.d.ts.map
|
||||
1
node_modules/telegraf/typings/reactions.d.ts.map
generated
vendored
Normal file
1
node_modules/telegraf/typings/reactions.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"reactions.d.ts","sourceRoot":"","sources":["../src/reactions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAA;AAEtD,OAAO,KAAK,EAAE,MAAM,uBAAuB,CAAA;AAE3C,MAAM,MAAM,KAAK,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAA;AAC7E,eAAO,MAAM,KAAK,aAA8D,CAAA;AAChF,MAAM,MAAM,QAAQ,GAChB,EAAE,CAAC,aAAa,GAChB,GAAG,KAAK,GAAG,MAAM,EAAE,GACnB,UAAU,CAAC,EAAE,CAAC,YAAY,CAAC,CAAA;AAE/B,KAAK,WAAW,GAAG;IAAE,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC,MAAM,CAAC,qBAAqB,CAAC,CAAA;CAAE,CAAA;AAQvE,qBAAa,YAAY;IAID,SAAS,CAAC,IAAI,EAAE,EAAE,CAAC,YAAY,EAAE;IAFvD,CAAC,KAAK,EAAE,MAAM,GAAG,UAAU,CAAC,EAAE,CAAC,YAAY,CAAC,CAAA;IAE5C,SAAS,aAAuB,IAAI,EAAE,EAAE,CAAC,YAAY,EAAE;IAEvD,MAAM,CAAC,SAAS,CAAC,IAAI,GAAE,EAAE,CAAC,YAAY,EAAO,GAAG,YAAY;IAS5D,MAAM,CAAC,GAAG,CAAC,SAAS,EAAE,EAAE,CAAC,YAAY,EAAE,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO;IAkBrE,OAAO,IAAI,EAAE,CAAC,YAAY,EAAE;IAI5B,MAAM,CACJ,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,YAAY,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,GAC3D,YAAY;IAIf,GAAG,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO;IAIhC,IAAI,KAAK,IAAI,MAAM,CAElB;IAED,CAAC,MAAM,CAAC,QAAQ,CAAC;CAQlB;AAED,qBAAa,gBAAiB,SAAQ,YAAY;IACrB,GAAG,EAAE,WAAW;IAA3C,OAAO;IAIP,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,WAAW;IAS5B,IAAI,GAAG,iBAIN;IAED,IAAI,GAAG,iBAIN;IAED,IAAI,KAAK,IAAI,YAAY,CAExB;IAED,IAAI,OAAO,IAAI,YAAY,CAE1B;IAED,IAAI,IAAI,IAAI,YAAY,CAEvB;CACF"}
|
||||
21
node_modules/telegraf/typings/router.d.ts
generated
vendored
Normal file
21
node_modules/telegraf/typings/router.d.ts
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
/** @format */
|
||||
import { Middleware, MiddlewareObj } from './middleware';
|
||||
import Context from './context';
|
||||
type NonemptyReadonlyArray<T> = readonly [T, ...T[]];
|
||||
type RouteFn<TContext extends Context> = (ctx: TContext) => {
|
||||
route: string;
|
||||
context?: Partial<TContext>;
|
||||
state?: Partial<TContext['state']>;
|
||||
} | null;
|
||||
/** @deprecated in favor of {@link Composer.dispatch} */
|
||||
export declare class Router<C extends Context> implements MiddlewareObj<C> {
|
||||
private readonly routeFn;
|
||||
handlers: Map<string, Middleware<C>>;
|
||||
private otherwiseHandler;
|
||||
constructor(routeFn: RouteFn<C>, handlers?: Map<string, Middleware<C>>);
|
||||
on(route: string, ...fns: NonemptyReadonlyArray<Middleware<C>>): this;
|
||||
otherwise(...fns: NonemptyReadonlyArray<Middleware<C>>): this;
|
||||
middleware(): import("./middleware").MiddlewareFn<C>;
|
||||
}
|
||||
export {};
|
||||
//# sourceMappingURL=router.d.ts.map
|
||||
1
node_modules/telegraf/typings/router.d.ts.map
generated
vendored
Normal file
1
node_modules/telegraf/typings/router.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../src/router.ts"],"names":[],"mappings":"AAAA,cAAc;AAEd,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAExD,OAAO,OAAO,MAAM,WAAW,CAAA;AAE/B,KAAK,qBAAqB,CAAC,CAAC,IAAI,SAAS,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC,CAAA;AAEpD,KAAK,OAAO,CAAC,QAAQ,SAAS,OAAO,IAAI,CAAC,GAAG,EAAE,QAAQ,KAAK;IAC1D,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAA;IAC3B,KAAK,CAAC,EAAE,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAA;CACnC,GAAG,IAAI,CAAA;AAER,wDAAwD;AACxD,qBAAa,MAAM,CAAC,CAAC,SAAS,OAAO,CAAE,YAAW,aAAa,CAAC,CAAC,CAAC;IAI9D,OAAO,CAAC,QAAQ,CAAC,OAAO;IACjB,QAAQ;IAJjB,OAAO,CAAC,gBAAgB,CAAqC;gBAG1C,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,EAC7B,QAAQ,6BAAmC;IAOpD,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,GAAG,EAAE,qBAAqB,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;IAQ9D,SAAS,CAAC,GAAG,GAAG,EAAE,qBAAqB,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;IAQtD,UAAU;CAWX"}
|
||||
2
node_modules/telegraf/typings/scenes.d.ts
generated
vendored
Normal file
2
node_modules/telegraf/typings/scenes.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
export * from './scenes/index.js';
|
||||
//# sourceMappingURL=scenes.d.ts.map
|
||||
1
node_modules/telegraf/typings/scenes.d.ts.map
generated
vendored
Normal file
1
node_modules/telegraf/typings/scenes.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"scenes.d.ts","sourceRoot":"","sources":["../src/scenes.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAA"}
|
||||
22
node_modules/telegraf/typings/scenes/base.d.ts
generated
vendored
Normal file
22
node_modules/telegraf/typings/scenes/base.d.ts
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
import { Middleware, MiddlewareFn } from '../middleware';
|
||||
import Composer from '../composer';
|
||||
import Context from '../context';
|
||||
export interface SceneOptions<C extends Context> {
|
||||
ttl?: number;
|
||||
handlers: ReadonlyArray<MiddlewareFn<C>>;
|
||||
enterHandlers: ReadonlyArray<MiddlewareFn<C>>;
|
||||
leaveHandlers: ReadonlyArray<MiddlewareFn<C>>;
|
||||
}
|
||||
export declare class BaseScene<C extends Context = Context> extends Composer<C> {
|
||||
id: string;
|
||||
ttl?: number;
|
||||
enterHandler: MiddlewareFn<C>;
|
||||
leaveHandler: MiddlewareFn<C>;
|
||||
constructor(id: string, options?: SceneOptions<C>);
|
||||
enter(...fns: Array<Middleware<C>>): this;
|
||||
leave(...fns: Array<Middleware<C>>): this;
|
||||
enterMiddleware(): MiddlewareFn<C>;
|
||||
leaveMiddleware(): MiddlewareFn<C>;
|
||||
}
|
||||
export default BaseScene;
|
||||
//# sourceMappingURL=base.d.ts.map
|
||||
1
node_modules/telegraf/typings/scenes/base.d.ts.map
generated
vendored
Normal file
1
node_modules/telegraf/typings/scenes/base.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../src/scenes/base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AACxD,OAAO,QAAQ,MAAM,aAAa,CAAA;AAClC,OAAO,OAAO,MAAM,YAAY,CAAA;AAIhC,MAAM,WAAW,YAAY,CAAC,CAAC,SAAS,OAAO;IAC7C,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,aAAa,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAA;IACxC,aAAa,EAAE,aAAa,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAA;IAC7C,aAAa,EAAE,aAAa,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAA;CAC9C;AAED,qBAAa,SAAS,CAAC,CAAC,SAAS,OAAO,GAAG,OAAO,CAAE,SAAQ,QAAQ,CAAC,CAAC,CAAC;IACrE,EAAE,EAAE,MAAM,CAAA;IACV,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,YAAY,EAAE,YAAY,CAAC,CAAC,CAAC,CAAA;IAC7B,YAAY,EAAE,YAAY,CAAC,CAAC,CAAC,CAAA;gBACjB,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC;IAcjD,KAAK,CAAC,GAAG,GAAG,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;IAKlC,KAAK,CAAC,GAAG,GAAG,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;IAKlC,eAAe;IAIf,eAAe;CAGhB;AAED,eAAe,SAAS,CAAA"}
|
||||
36
node_modules/telegraf/typings/scenes/context.d.ts
generated
vendored
Normal file
36
node_modules/telegraf/typings/scenes/context.d.ts
generated
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
import BaseScene from './base';
|
||||
import Context from '../context';
|
||||
import { SessionContext } from '../session';
|
||||
export interface SceneContext<D extends SceneSessionData = SceneSessionData> extends Context {
|
||||
session: SceneSession<D>;
|
||||
scene: SceneContextScene<SceneContext<D>, D>;
|
||||
}
|
||||
export interface SceneSessionData {
|
||||
current?: string;
|
||||
expires?: number;
|
||||
state?: object;
|
||||
}
|
||||
export interface SceneSession<S extends SceneSessionData = SceneSessionData> {
|
||||
__scenes?: S;
|
||||
}
|
||||
export interface SceneContextSceneOptions<D extends SceneSessionData> {
|
||||
ttl?: number;
|
||||
default?: string;
|
||||
defaultSession: D;
|
||||
}
|
||||
export default class SceneContextScene<C extends SessionContext<SceneSession<D>>, D extends SceneSessionData = SceneSessionData> {
|
||||
private readonly ctx;
|
||||
private readonly scenes;
|
||||
private readonly options;
|
||||
constructor(ctx: C, scenes: Map<string, BaseScene<C>>, options: Partial<SceneContextSceneOptions<D>>);
|
||||
get session(): D;
|
||||
get state(): object;
|
||||
set state(value: object);
|
||||
get current(): BaseScene<C> | undefined;
|
||||
reset(): void;
|
||||
enter(sceneId: string, initialState?: object, silent?: boolean): Promise<unknown>;
|
||||
reenter(): Promise<unknown> | undefined;
|
||||
private leaving;
|
||||
leave(): Promise<void>;
|
||||
}
|
||||
//# sourceMappingURL=context.d.ts.map
|
||||
1
node_modules/telegraf/typings/scenes/context.d.ts.map
generated
vendored
Normal file
1
node_modules/telegraf/typings/scenes/context.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/scenes/context.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,QAAQ,CAAA;AAE9B,OAAO,OAAO,MAAM,YAAY,CAAA;AAEhC,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAM3C,MAAM,WAAW,YAAY,CAAC,CAAC,SAAS,gBAAgB,GAAG,gBAAgB,CACzE,SAAQ,OAAO;IACf,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC,CAAA;IACxB,KAAK,EAAE,iBAAiB,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;CAC7C;AAED,MAAM,WAAW,gBAAgB;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,YAAY,CAAC,CAAC,SAAS,gBAAgB,GAAG,gBAAgB;IACzE,QAAQ,CAAC,EAAE,CAAC,CAAA;CACb;AAED,MAAM,WAAW,wBAAwB,CAAC,CAAC,SAAS,gBAAgB;IAClE,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,cAAc,EAAE,CAAC,CAAA;CAClB;AAED,MAAM,CAAC,OAAO,OAAO,iBAAiB,CACpC,CAAC,SAAS,cAAc,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,EACzC,CAAC,SAAS,gBAAgB,GAAG,gBAAgB;IAK3C,OAAO,CAAC,QAAQ,CAAC,GAAG;IACpB,OAAO,CAAC,QAAQ,CAAC,MAAM;IAJzB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA6B;gBAGlC,GAAG,EAAE,CAAC,EACN,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,EAClD,OAAO,EAAE,OAAO,CAAC,wBAAwB,CAAC,CAAC,CAAC,CAAC;IAQ/C,IAAI,OAAO,IAAI,CAAC,CAaf;IAED,IAAI,KAAK,WAER;IAED,IAAI,KAAK,CAAC,KAAK,QAAA,EAEd;IAED,IAAI,OAAO,6BAKV;IAED,KAAK;IAKC,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,YAAY,GAAE,MAAW,EAAE,MAAM,UAAQ;IAyBtE,OAAO;IAMP,OAAO,CAAC,OAAO,CAAQ;IACjB,KAAK;CAmBZ"}
|
||||
11
node_modules/telegraf/typings/scenes/index.d.ts
generated
vendored
Normal file
11
node_modules/telegraf/typings/scenes/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
/**
|
||||
* @see https://github.com/telegraf/telegraf/issues/705#issuecomment-549056045
|
||||
* @see https://www.npmjs.com/package/telegraf-stateless-question
|
||||
* @packageDocumentation
|
||||
*/
|
||||
export { Stage } from './stage';
|
||||
export { SceneContext, SceneSession, default as SceneContextScene, SceneSessionData, } from './context';
|
||||
export { BaseScene } from './base';
|
||||
export { WizardScene } from './wizard';
|
||||
export { WizardContext, WizardSession, default as WizardContextWizard, WizardSessionData, } from './wizard/context';
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
1
node_modules/telegraf/typings/scenes/index.d.ts.map
generated
vendored
Normal file
1
node_modules/telegraf/typings/scenes/index.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/scenes/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,OAAO,IAAI,iBAAiB,EAC5B,gBAAgB,GACjB,MAAM,WAAW,CAAA;AAClB,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AACtC,OAAO,EACL,aAAa,EACb,aAAa,EACb,OAAO,IAAI,mBAAmB,EAC9B,iBAAiB,GAClB,MAAM,kBAAkB,CAAA"}
|
||||
24
node_modules/telegraf/typings/scenes/stage.d.ts
generated
vendored
Normal file
24
node_modules/telegraf/typings/scenes/stage.d.ts
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
import { SessionContext } from '../session';
|
||||
import SceneContextScene, { SceneContextSceneOptions, SceneSession, SceneSessionData } from './context';
|
||||
import { BaseScene } from './base';
|
||||
import { Composer } from '../composer';
|
||||
import { Context } from '../context';
|
||||
export declare class Stage<C extends SessionContext<SceneSession<D>> & {
|
||||
scene: SceneContextScene<C, D>;
|
||||
}, D extends SceneSessionData = SceneSessionData> extends Composer<C> {
|
||||
options: Partial<SceneContextSceneOptions<D>>;
|
||||
scenes: Map<string, BaseScene<C>>;
|
||||
constructor(scenes?: ReadonlyArray<BaseScene<C>>, options?: Partial<SceneContextSceneOptions<D>>);
|
||||
register(...scenes: ReadonlyArray<BaseScene<C>>): this;
|
||||
middleware(): import("..").MiddlewareFn<C>;
|
||||
static enter<C extends Context & {
|
||||
scene: SceneContextScene<C>;
|
||||
}>(...args: Parameters<SceneContextScene<C>['enter']>): (ctx: C) => Promise<unknown>;
|
||||
static reenter<C extends Context & {
|
||||
scene: SceneContextScene<C>;
|
||||
}>(...args: Parameters<SceneContextScene<C>['reenter']>): (ctx: C) => Promise<unknown> | undefined;
|
||||
static leave<C extends Context & {
|
||||
scene: SceneContextScene<C>;
|
||||
}>(...args: Parameters<SceneContextScene<C>['leave']>): (ctx: C) => Promise<void>;
|
||||
}
|
||||
//# sourceMappingURL=stage.d.ts.map
|
||||
1
node_modules/telegraf/typings/scenes/stage.d.ts.map
generated
vendored
Normal file
1
node_modules/telegraf/typings/scenes/stage.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"stage.d.ts","sourceRoot":"","sources":["../../src/scenes/stage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,cAAc,EAAE,MAAM,YAAY,CAAA;AAC7D,OAAO,iBAAiB,EAAE,EACxB,wBAAwB,EACxB,YAAY,EACZ,gBAAgB,EACjB,MAAM,WAAW,CAAA;AAClB,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAEpC,qBAAa,KAAK,CAChB,CAAC,SAAS,cAAc,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,GAAG;IAC1C,KAAK,EAAE,iBAAiB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;CAC/B,EACD,CAAC,SAAS,gBAAgB,GAAG,gBAAgB,CAC7C,SAAQ,QAAQ,CAAC,CAAC,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC,wBAAwB,CAAC,CAAC,CAAC,CAAC,CAAA;IAC7C,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,CAAA;gBAG/B,MAAM,GAAE,aAAa,CAAC,SAAS,CAAC,CAAC,CAAC,CAAM,EACxC,OAAO,CAAC,EAAE,OAAO,CAAC,wBAAwB,CAAC,CAAC,CAAC,CAAC;IAQhD,QAAQ,CAAC,GAAG,MAAM,EAAE,aAAa,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;IAU/C,UAAU;IAcV,MAAM,CAAC,KAAK,CAAC,CAAC,SAAS,OAAO,GAAG;QAAE,KAAK,EAAE,iBAAiB,CAAC,CAAC,CAAC,CAAA;KAAE,EAC9D,GAAG,IAAI,EAAE,UAAU,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,SAErC,CAAC;IAGhB,MAAM,CAAC,OAAO,CAAC,CAAC,SAAS,OAAO,GAAG;QAAE,KAAK,EAAE,iBAAiB,CAAC,CAAC,CAAC,CAAA;KAAE,EAChE,GAAG,IAAI,EAAE,UAAU,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,SAEvC,CAAC;IAGhB,MAAM,CAAC,KAAK,CAAC,CAAC,SAAS,OAAO,GAAG;QAAE,KAAK,EAAE,iBAAiB,CAAC,CAAC,CAAC,CAAA;KAAE,EAC9D,GAAG,IAAI,EAAE,UAAU,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,SAErC,CAAC;CAEjB"}
|
||||
29
node_modules/telegraf/typings/scenes/wizard/context.d.ts
generated
vendored
Normal file
29
node_modules/telegraf/typings/scenes/wizard/context.d.ts
generated
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
import SceneContextScene, { SceneSession, SceneSessionData } from '../context';
|
||||
import Context from '../../context';
|
||||
import { Middleware } from '../../middleware';
|
||||
import { SessionContext } from '../../session';
|
||||
export interface WizardContext<D extends WizardSessionData = WizardSessionData> extends Context {
|
||||
session: WizardSession<D>;
|
||||
scene: SceneContextScene<WizardContext<D>, D>;
|
||||
wizard: WizardContextWizard<WizardContext<D>>;
|
||||
}
|
||||
export interface WizardSessionData extends SceneSessionData {
|
||||
cursor: number;
|
||||
}
|
||||
export interface WizardSession<S extends WizardSessionData = WizardSessionData> extends SceneSession<S> {
|
||||
}
|
||||
export default class WizardContextWizard<C extends SessionContext<WizardSession> & {
|
||||
scene: SceneContextScene<C, WizardSessionData>;
|
||||
}> {
|
||||
private readonly ctx;
|
||||
private readonly steps;
|
||||
readonly state: object;
|
||||
constructor(ctx: C, steps: ReadonlyArray<Middleware<C>>);
|
||||
get step(): Middleware<C> | undefined;
|
||||
get cursor(): number;
|
||||
set cursor(cursor: number);
|
||||
selectStep(index: number): this;
|
||||
next(): this;
|
||||
back(): this;
|
||||
}
|
||||
//# sourceMappingURL=context.d.ts.map
|
||||
1
node_modules/telegraf/typings/scenes/wizard/context.d.ts.map
generated
vendored
Normal file
1
node_modules/telegraf/typings/scenes/wizard/context.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/scenes/wizard/context.ts"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,EAAE,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAC9E,OAAO,OAAO,MAAM,eAAe,CAAA;AACnC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAE9C,MAAM,WAAW,aAAa,CAAC,CAAC,SAAS,iBAAiB,GAAG,iBAAiB,CAC5E,SAAQ,OAAO;IACf,OAAO,EAAE,aAAa,CAAC,CAAC,CAAC,CAAA;IACzB,KAAK,EAAE,iBAAiB,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;IAC7C,MAAM,EAAE,mBAAmB,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAA;CAC9C;AAED,MAAM,WAAW,iBAAkB,SAAQ,gBAAgB;IACzD,MAAM,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,aAAa,CAAC,CAAC,SAAS,iBAAiB,GAAG,iBAAiB,CAC5E,SAAQ,YAAY,CAAC,CAAC,CAAC;CAAG;AAE5B,MAAM,CAAC,OAAO,OAAO,mBAAmB,CACtC,CAAC,SAAS,cAAc,CAAC,aAAa,CAAC,GAAG;IACxC,KAAK,EAAE,iBAAiB,CAAC,CAAC,EAAE,iBAAiB,CAAC,CAAA;CAC/C;IAIC,OAAO,CAAC,QAAQ,CAAC,GAAG;IACpB,OAAO,CAAC,QAAQ,CAAC,KAAK;IAHxB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;gBAEH,GAAG,EAAE,CAAC,EACN,KAAK,EAAE,aAAa,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;IAMtD,IAAI,IAAI,8BAEP;IAED,IAAI,MAAM,IAIS,MAAM,CAFxB;IAED,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,EAExB;IAED,UAAU,CAAC,KAAK,EAAE,MAAM;IAKxB,IAAI;IAIJ,IAAI;CAGL"}
|
||||
16
node_modules/telegraf/typings/scenes/wizard/index.d.ts
generated
vendored
Normal file
16
node_modules/telegraf/typings/scenes/wizard/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
import BaseScene, { SceneOptions } from '../base';
|
||||
import { Middleware, MiddlewareObj } from '../../middleware';
|
||||
import WizardContextWizard, { WizardSessionData } from './context';
|
||||
import Context from '../../context';
|
||||
import SceneContextScene from '../context';
|
||||
export declare class WizardScene<C extends Context & {
|
||||
scene: SceneContextScene<C, WizardSessionData>;
|
||||
wizard: WizardContextWizard<C>;
|
||||
}> extends BaseScene<C> implements MiddlewareObj<C> {
|
||||
steps: Array<Middleware<C>>;
|
||||
constructor(id: string, ...steps: Array<Middleware<C>>);
|
||||
constructor(id: string, options: SceneOptions<C>, ...steps: Array<Middleware<C>>);
|
||||
middleware(): import("../../middleware").MiddlewareFn<C>;
|
||||
enterMiddleware(): import("../../middleware").MiddlewareFn<C>;
|
||||
}
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
1
node_modules/telegraf/typings/scenes/wizard/index.d.ts.map
generated
vendored
Normal file
1
node_modules/telegraf/typings/scenes/wizard/index.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/scenes/wizard/index.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,EAAE,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AACjD,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAC5D,OAAO,mBAAmB,EAAE,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAA;AAElE,OAAO,OAAO,MAAM,eAAe,CAAA;AACnC,OAAO,iBAAiB,MAAM,YAAY,CAAA;AAE1C,qBAAa,WAAW,CACpB,CAAC,SAAS,OAAO,GAAG;IAClB,KAAK,EAAE,iBAAiB,CAAC,CAAC,EAAE,iBAAiB,CAAC,CAAA;IAC9C,MAAM,EAAE,mBAAmB,CAAC,CAAC,CAAC,CAAA;CAC/B,CAEH,SAAQ,SAAS,CAAC,CAAC,CACnB,YAAW,aAAa,CAAC,CAAC,CAAC;IAE3B,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAA;gBAEf,EAAE,EAAE,MAAM,EAAE,GAAG,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;gBAEpD,EAAE,EAAE,MAAM,EACV,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC,EACxB,GAAG,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;IAoBhC,UAAU;IAiBV,eAAe;CAGhB"}
|
||||
55
node_modules/telegraf/typings/session.d.ts
generated
vendored
Normal file
55
node_modules/telegraf/typings/session.d.ts
generated
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
import { Context } from './context';
|
||||
import { ExclusiveKeys, MaybePromise } from './core/helpers/util';
|
||||
import { MiddlewareFn } from './middleware';
|
||||
export interface SyncSessionStore<T> {
|
||||
get: (name: string) => T | undefined;
|
||||
set: (name: string, value: T) => void;
|
||||
delete: (name: string) => void;
|
||||
}
|
||||
export interface AsyncSessionStore<T> {
|
||||
get: (name: string) => Promise<T | undefined>;
|
||||
set: (name: string, value: T) => Promise<unknown>;
|
||||
delete: (name: string) => Promise<unknown>;
|
||||
}
|
||||
export type SessionStore<T> = SyncSessionStore<T> | AsyncSessionStore<T>;
|
||||
interface SessionOptions<S, C extends Context, P extends string> {
|
||||
/** Customise the session prop. Defaults to "session" and is available as ctx.session. */
|
||||
property?: P;
|
||||
getSessionKey?: (ctx: C) => MaybePromise<string | undefined>;
|
||||
store?: SessionStore<S>;
|
||||
defaultSession?: (ctx: C) => S;
|
||||
}
|
||||
/** @deprecated session can use custom properties now. Construct this type directly. */
|
||||
export interface SessionContext<S extends object> extends Context {
|
||||
session?: S;
|
||||
}
|
||||
/**
|
||||
* Returns middleware that adds `ctx.session` for storing arbitrary state per session key.
|
||||
*
|
||||
* The default `getSessionKey` is `${ctx.from.id}:${ctx.chat.id}`.
|
||||
* If either `ctx.from` or `ctx.chat` is `undefined`, default session key and thus `ctx.session` are also `undefined`.
|
||||
*
|
||||
* > ⚠️ Session data is kept only in memory by default, which means that all data will be lost when the process is terminated.
|
||||
* >
|
||||
* > If you want to persist data across process restarts, or share it among multiple instances, you should use
|
||||
* [@telegraf/session](https://www.npmjs.com/package/@telegraf/session), or pass custom `storage`.
|
||||
*
|
||||
* @see {@link https://github.com/feathers-studio/telegraf-docs/blob/b694bcc36b4f71fb1cd650a345c2009ab4d2a2a5/guide/session.md Telegraf Docs | Session}
|
||||
* @see {@link https://github.com/feathers-studio/telegraf-docs/blob/master/examples/session-bot.ts Example}
|
||||
*/
|
||||
export declare function session<S extends NonNullable<C[P]>, C extends Context & {
|
||||
[key in P]?: C[P];
|
||||
}, P extends (ExclusiveKeys<C, Context> & string) | 'session' = 'session'>(options?: SessionOptions<S, C, P>): MiddlewareFn<C>;
|
||||
/** @deprecated Use `Map` */
|
||||
export declare class MemorySessionStore<T> implements SyncSessionStore<T> {
|
||||
private readonly ttl;
|
||||
private readonly store;
|
||||
constructor(ttl?: number);
|
||||
get(name: string): T | undefined;
|
||||
set(name: string, value: T): void;
|
||||
delete(name: string): void;
|
||||
}
|
||||
/** @deprecated session can use custom properties now. Directly use `'session' in ctx` instead */
|
||||
export declare function isSessionContext<S extends object>(ctx: Context): ctx is SessionContext<S>;
|
||||
export {};
|
||||
//# sourceMappingURL=session.d.ts.map
|
||||
1
node_modules/telegraf/typings/session.d.ts.map
generated
vendored
Normal file
1
node_modules/telegraf/typings/session.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../src/session.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAI3C,MAAM,WAAW,gBAAgB,CAAC,CAAC;IACjC,GAAG,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,CAAC,GAAG,SAAS,CAAA;IACpC,GAAG,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,KAAK,IAAI,CAAA;IACrC,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;CAC/B;AAED,MAAM,WAAW,iBAAiB,CAAC,CAAC;IAClC,GAAG,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC,CAAA;IAC7C,GAAG,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,KAAK,OAAO,CAAC,OAAO,CAAC,CAAA;IACjD,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAA;CAC3C;AAED,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI,gBAAgB,CAAC,CAAC,CAAC,GAAG,iBAAiB,CAAC,CAAC,CAAC,CAAA;AAExE,UAAU,cAAc,CAAC,CAAC,EAAE,CAAC,SAAS,OAAO,EAAE,CAAC,SAAS,MAAM;IAC7D,yFAAyF;IACzF,QAAQ,CAAC,EAAE,CAAC,CAAA;IACZ,aAAa,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,YAAY,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;IAC5D,KAAK,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,CAAA;IACvB,cAAc,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,CAAA;CAC/B;AAED,uFAAuF;AACvF,MAAM,WAAW,cAAc,CAAC,CAAC,SAAS,MAAM,CAAE,SAAQ,OAAO;IAC/D,OAAO,CAAC,EAAE,CAAC,CAAA;CACZ;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,OAAO,CACrB,CAAC,SAAS,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAC3B,CAAC,SAAS,OAAO,GAAG;KAAG,GAAG,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;CAAE,EACzC,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,GAAG,SAAS,GAAG,SAAS,EAGtE,OAAO,CAAC,EAAE,cAAc,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,GAAG,YAAY,CAAC,CAAC,CAAC,CA6GpD;AASD,4BAA4B;AAC5B,qBAAa,kBAAkB,CAAC,CAAC,CAAE,YAAW,gBAAgB,CAAC,CAAC,CAAC;IAGnD,OAAO,CAAC,QAAQ,CAAC,GAAG;IAFhC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAqD;gBAE9C,GAAG,SAAW;IAE3C,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,CAAC,GAAG,SAAS;IAWhC,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI;IAKjC,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;CAG3B;AAED,iGAAiG;AACjG,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,MAAM,EAC/C,GAAG,EAAE,OAAO,GACX,GAAG,IAAI,cAAc,CAAC,CAAC,CAAC,CAE1B"}
|
||||
117
node_modules/telegraf/typings/telegraf.d.ts
generated
vendored
Normal file
117
node_modules/telegraf/typings/telegraf.d.ts
generated
vendored
Normal file
@@ -0,0 +1,117 @@
|
||||
/// <reference types="node" />
|
||||
/// <reference types="node" />
|
||||
import * as http from 'http';
|
||||
import * as tg from './core/types/typegram';
|
||||
import * as tt from './telegram-types';
|
||||
import { Composer } from './composer';
|
||||
import { MaybePromise } from './core/helpers/util';
|
||||
import ApiClient from './core/network/client';
|
||||
import Context from './context';
|
||||
import Telegram from './telegram';
|
||||
import { TlsOptions } from 'tls';
|
||||
export declare namespace Telegraf {
|
||||
interface Options<TContext extends Context> {
|
||||
contextType: new (...args: ConstructorParameters<typeof Context>) => TContext;
|
||||
handlerTimeout: number;
|
||||
telegram?: Partial<ApiClient.Options>;
|
||||
}
|
||||
interface LaunchOptions {
|
||||
dropPendingUpdates?: boolean;
|
||||
/** List the types of updates you want your bot to receive */
|
||||
allowedUpdates?: tt.UpdateType[];
|
||||
/** Configuration options for when the bot is run via webhooks */
|
||||
webhook?: {
|
||||
/** Public domain for webhook. */
|
||||
domain: string;
|
||||
/**
|
||||
* Webhook url path; will be automatically generated if not specified
|
||||
* @deprecated Pass `path` instead
|
||||
* */
|
||||
hookPath?: string;
|
||||
/** Webhook url path; will be automatically generated if not specified */
|
||||
path?: string;
|
||||
host?: string;
|
||||
port?: number;
|
||||
/** The fixed IP address which will be used to send webhook requests instead of the IP address resolved through DNS */
|
||||
ipAddress?: string;
|
||||
/**
|
||||
* Maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery, 1-100. Defaults to 40.
|
||||
* Use lower values to limit the load on your bot's server, and higher values to increase your bot's throughput.
|
||||
*/
|
||||
maxConnections?: number;
|
||||
/** TLS server options. Omit to use http. */
|
||||
tlsOptions?: TlsOptions;
|
||||
/**
|
||||
* A secret token to be sent in a header `“X-Telegram-Bot-Api-Secret-Token”` in every webhook request.
|
||||
* 1-256 characters. Only characters `A-Z`, `a-z`, `0-9`, `_` and `-` are allowed.
|
||||
* The header is useful to ensure that the request comes from a webhook set by you.
|
||||
*/
|
||||
secretToken?: string;
|
||||
/**
|
||||
* Upload your public key certificate so that the root certificate in use can be checked.
|
||||
* See [self-signed guide](https://core.telegram.org/bots/self-signed) for details.
|
||||
*/
|
||||
certificate?: tg.InputFile;
|
||||
cb?: http.RequestListener;
|
||||
};
|
||||
}
|
||||
}
|
||||
export declare class Telegraf<C extends Context = Context> extends Composer<C> {
|
||||
private readonly options;
|
||||
private webhookServer?;
|
||||
private polling?;
|
||||
/** Set manually to avoid implicit `getMe` call in `launch` or `webhookCallback` */
|
||||
botInfo?: tg.UserFromGetMe;
|
||||
telegram: Telegram;
|
||||
readonly context: Partial<C>;
|
||||
/** Assign to this to customise the webhook filter middleware.
|
||||
* `{ path, secretToken }` will be bound to this rather than the Telegraf instance.
|
||||
* Remember to assign a regular function and not an arrow function so it's bindable.
|
||||
*/
|
||||
webhookFilter: (this: {
|
||||
/** @deprecated Use path instead */
|
||||
hookPath: string;
|
||||
path: string;
|
||||
secretToken?: string;
|
||||
}, req: http.IncomingMessage) => boolean;
|
||||
private handleError;
|
||||
constructor(token: string, options?: Partial<Telegraf.Options<C>>);
|
||||
private get token();
|
||||
/** @deprecated use `ctx.telegram.webhookReply` */
|
||||
set webhookReply(webhookReply: boolean);
|
||||
/** @deprecated use `ctx.telegram.webhookReply` */
|
||||
get webhookReply(): boolean;
|
||||
/**
|
||||
* _Override_ error handling
|
||||
*/
|
||||
catch(handler: (err: unknown, ctx: C) => MaybePromise<void>): this;
|
||||
/**
|
||||
* You must call `bot.telegram.setWebhook` for this to work.
|
||||
* You should probably use {@link Telegraf.createWebhook} instead.
|
||||
*/
|
||||
webhookCallback(path?: string, opts?: {
|
||||
secretToken?: string;
|
||||
}): (req: http.IncomingMessage & {
|
||||
body?: tg.Update | undefined;
|
||||
}, res: http.ServerResponse<http.IncomingMessage>, next?: () => void) => Promise<void>;
|
||||
private getDomainOpts;
|
||||
/**
|
||||
* Specify a url to receive incoming updates via webhook.
|
||||
* Returns an Express-style middleware you can pass to app.use()
|
||||
*/
|
||||
createWebhook(opts: {
|
||||
domain: string;
|
||||
path?: string;
|
||||
} & tt.ExtraSetWebhook): Promise<(req: http.IncomingMessage & {
|
||||
body?: tg.Update | undefined;
|
||||
}, res: http.ServerResponse<http.IncomingMessage>, next?: () => void) => Promise<void>>;
|
||||
private startPolling;
|
||||
private startWebhook;
|
||||
secretPathComponent(): string;
|
||||
launch(onLaunch?: () => void): Promise<void>;
|
||||
launch(config: Telegraf.LaunchOptions, onLaunch?: () => void): Promise<void>;
|
||||
stop(reason?: string): void;
|
||||
private botInfoCall?;
|
||||
handleUpdate(update: tg.Update, webhookResponse?: http.ServerResponse): Promise<void>;
|
||||
}
|
||||
//# sourceMappingURL=telegraf.d.ts.map
|
||||
1
node_modules/telegraf/typings/telegraf.d.ts.map
generated
vendored
Normal file
1
node_modules/telegraf/typings/telegraf.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"telegraf.d.ts","sourceRoot":"","sources":["../src/telegraf.ts"],"names":[],"mappings":";;AACA,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAE5B,OAAO,KAAK,EAAE,MAAM,uBAAuB,CAAA;AAC3C,OAAO,KAAK,EAAE,MAAM,kBAAkB,CAAA;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,SAAS,MAAM,uBAAuB,CAAA;AAE7C,OAAO,OAAO,MAAM,WAAW,CAAA;AAK/B,OAAO,QAAQ,MAAM,YAAY,CAAA;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAiBhC,yBAAiB,QAAQ,CAAC;IACxB,UAAiB,OAAO,CAAC,QAAQ,SAAS,OAAO;QAC/C,WAAW,EAAE,KACX,GAAG,IAAI,EAAE,qBAAqB,CAAC,OAAO,OAAO,CAAC,KAC3C,QAAQ,CAAA;QACb,cAAc,EAAE,MAAM,CAAA;QACtB,QAAQ,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,CAAA;KACtC;IAED,UAAiB,aAAa;QAC5B,kBAAkB,CAAC,EAAE,OAAO,CAAA;QAC5B,6DAA6D;QAC7D,cAAc,CAAC,EAAE,EAAE,CAAC,UAAU,EAAE,CAAA;QAChC,iEAAiE;QACjE,OAAO,CAAC,EAAE;YACR,iCAAiC;YACjC,MAAM,EAAE,MAAM,CAAA;YAEd;;;iBAGK;YACL,QAAQ,CAAC,EAAE,MAAM,CAAA;YAEjB,yEAAyE;YACzE,IAAI,CAAC,EAAE,MAAM,CAAA;YAEb,IAAI,CAAC,EAAE,MAAM,CAAA;YACb,IAAI,CAAC,EAAE,MAAM,CAAA;YAEb,sHAAsH;YACtH,SAAS,CAAC,EAAE,MAAM,CAAA;YAElB;;;eAGG;YACH,cAAc,CAAC,EAAE,MAAM,CAAA;YAEvB,4CAA4C;YAC5C,UAAU,CAAC,EAAE,UAAU,CAAA;YAEvB;;;;eAIG;YACH,WAAW,CAAC,EAAE,MAAM,CAAA;YAEpB;;;eAGG;YACH,WAAW,CAAC,EAAE,EAAE,CAAC,SAAS,CAAA;YAE1B,EAAE,CAAC,EAAE,IAAI,CAAC,eAAe,CAAA;SAC1B,CAAA;KACF;CACF;AAID,qBAAa,QAAQ,CAAC,CAAC,SAAS,OAAO,GAAG,OAAO,CAAE,SAAQ,QAAQ,CAAC,CAAC,CAAC;IACpE,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAqB;IAC7C,OAAO,CAAC,aAAa,CAAC,CAA4B;IAClD,OAAO,CAAC,OAAO,CAAC,CAAS;IACzB,mFAAmF;IAC5E,OAAO,CAAC,EAAE,EAAE,CAAC,aAAa,CAAA;IAC1B,QAAQ,EAAE,QAAQ,CAAA;IACzB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,CAAK;IAEjC;;;OAGG;IACI,aAAa,SAGZ;QACJ,mCAAmC;QACnC,QAAQ,EAAE,MAAM,CAAA;QAChB,IAAI,EAAE,MAAM,CAAA;QACZ,WAAW,CAAC,EAAE,MAAM,CAAA;KACrB,OACI,KAAK,eAAe,aAiB1B;IAED,OAAO,CAAC,WAAW,CAOlB;gBAEW,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAWjE,OAAO,KAAK,KAAK,GAEhB;IAED,kDAAkD;IAClD,IAAI,YAAY,CAAC,YAAY,EAAE,OAAO,EAErC;IAED,kDAAkD;IAClD,IAAI,YAAY,IALe,OAAO,CAOrC;IAED;;OAEG;IACH,KAAK,CAAC,OAAO,EAAE,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,YAAY,CAAC,IAAI,CAAC;IAK3D;;;OAGG;IACH,eAAe,CAAC,IAAI,SAAM,EAAE,IAAI,GAAE;QAAE,WAAW,CAAC,EAAE,MAAM,CAAA;KAAO;;;IAS/D,OAAO,CAAC,aAAa;IAiBrB;;;OAGG;IACG,aAAa,CACjB,IAAI,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,EAAE,CAAC,eAAe;;;IAc9D,OAAO,CAAC,YAAY;IAOpB,OAAO,CAAC,YAAY;IAuBpB,mBAAmB;IAQb,MAAM,CAAC,QAAQ,CAAC,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IAC5C,MAAM,CACV,MAAM,EAAE,QAAQ,CAAC,aAAa,EAC9B,QAAQ,CAAC,EAAE,MAAM,IAAI,GACpB,OAAO,CAAC,IAAI,CAAC;IAgDhB,IAAI,CAAC,MAAM,SAAgB;IAU3B,OAAO,CAAC,WAAW,CAAC,CAA2B;IACzC,YAAY,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,EAAE,eAAe,CAAC,EAAE,IAAI,CAAC,cAAc;CA0B5E"}
|
||||
117
node_modules/telegraf/typings/telegram-types.d.ts
generated
vendored
Normal file
117
node_modules/telegraf/typings/telegram-types.d.ts
generated
vendored
Normal file
@@ -0,0 +1,117 @@
|
||||
/** @format */
|
||||
import { Expand } from './core/helpers/util';
|
||||
import { Message, Opts, Telegram, Update, InputMediaAudio, InputMediaDocument, InputMediaPhoto, InputMediaVideo } from './core/types/typegram';
|
||||
import { UnionKeys } from './core/helpers/deunionize';
|
||||
import { FmtString } from './format';
|
||||
export { Markup } from './markup';
|
||||
export type ChatAction = Opts<'sendChatAction'>['action'];
|
||||
export type WrapCaption<T> = T extends {
|
||||
caption?: string;
|
||||
} ? Expand<Omit<T, 'caption'> & {
|
||||
caption?: string | FmtString;
|
||||
}> : T;
|
||||
/**
|
||||
* Create an `Extra*` type from the arguments of a given method `M extends keyof Telegram` but `Omit`ting fields with key `K` from it.
|
||||
*
|
||||
* Note that `chat_id` may not be specified in `K` because it is `Omit`ted by default.
|
||||
*/
|
||||
type MakeExtra<M extends keyof Telegram, K extends keyof Omit<Opts<M>, 'chat_id'> = never> = WrapCaption<Omit<Opts<M>, 'chat_id' | K>>;
|
||||
export type ExtraAddStickerToSet = MakeExtra<'addStickerToSet', 'name' | 'user_id'>;
|
||||
export type ExtraAnimation = MakeExtra<'sendAnimation', 'animation'>;
|
||||
export type ExtraAnswerCbQuery = MakeExtra<'answerCallbackQuery', 'text' | 'callback_query_id'>;
|
||||
export type ExtraAnswerInlineQuery = MakeExtra<'answerInlineQuery', 'inline_query_id' | 'results'>;
|
||||
export type ExtraSetChatPermissions = MakeExtra<'setChatPermissions', 'permissions'>;
|
||||
export type ExtraAudio = MakeExtra<'sendAudio', 'audio'>;
|
||||
export type ExtraContact = MakeExtra<'sendContact', 'phone_number' | 'first_name'>;
|
||||
export type ExtraCopyMessage = MakeExtra<'copyMessage', 'from_chat_id' | 'message_id'>;
|
||||
export type ExtraCopyMessages = MakeExtra<'copyMessages', 'from_chat_id' | 'message_ids'>;
|
||||
export type ExtraCreateChatInviteLink = MakeExtra<'createChatInviteLink'>;
|
||||
export type NewInvoiceLinkParameters = MakeExtra<'createInvoiceLink'>;
|
||||
export type ExtraCreateNewStickerSet = MakeExtra<'createNewStickerSet', 'name' | 'title' | 'user_id'>;
|
||||
export type ExtraDice = MakeExtra<'sendDice'>;
|
||||
export type ExtraDocument = MakeExtra<'sendDocument', 'document'>;
|
||||
export type ExtraEditChatInviteLink = MakeExtra<'editChatInviteLink', 'invite_link'>;
|
||||
export type ExtraEditMessageCaption = MakeExtra<'editMessageCaption', 'message_id' | 'inline_message_id' | 'caption'>;
|
||||
export type ExtraEditMessageLiveLocation = MakeExtra<'editMessageLiveLocation', 'message_id' | 'inline_message_id' | 'latitude' | 'longitude'>;
|
||||
export type ExtraEditMessageMedia = MakeExtra<'editMessageMedia', 'message_id' | 'inline_message_id' | 'media'>;
|
||||
export type ExtraEditMessageText = MakeExtra<'editMessageText', 'message_id' | 'inline_message_id' | 'text'>;
|
||||
export type ExtraGame = MakeExtra<'sendGame', 'game_short_name'>;
|
||||
export type NewInvoiceParameters = MakeExtra<'sendInvoice', 'disable_notification' | 'reply_parameters' | 'reply_markup' | 'message_thread_id'>;
|
||||
export type ExtraInvoice = MakeExtra<'sendInvoice', keyof NewInvoiceParameters>;
|
||||
export type ExtraBanChatMember = MakeExtra<'banChatMember', 'user_id' | 'until_date'>;
|
||||
export type ExtraKickChatMember = ExtraBanChatMember;
|
||||
export type ExtraLocation = MakeExtra<'sendLocation', 'latitude' | 'longitude'>;
|
||||
export type ExtraMediaGroup = MakeExtra<'sendMediaGroup', 'media'>;
|
||||
export type ExtraPhoto = MakeExtra<'sendPhoto', 'photo'>;
|
||||
export type ExtraPoll = MakeExtra<'sendPoll', 'question' | 'options' | 'type'>;
|
||||
export type ExtraPromoteChatMember = MakeExtra<'promoteChatMember', 'user_id'>;
|
||||
export type ExtraReplyMessage = MakeExtra<'sendMessage', 'text'>;
|
||||
export type ExtraForwardMessage = MakeExtra<'forwardMessage', 'from_chat_id' | 'message_id'>;
|
||||
export type ExtraForwardMessages = MakeExtra<'forwardMessages', 'from_chat_id' | 'message_ids'>;
|
||||
export type ExtraSendChatAction = MakeExtra<'sendChatAction', 'action'>;
|
||||
export type ExtraRestrictChatMember = MakeExtra<'restrictChatMember', 'user_id'>;
|
||||
export type ExtraSetMyCommands = MakeExtra<'setMyCommands', 'commands'>;
|
||||
export type ExtraSetWebhook = MakeExtra<'setWebhook', 'url'>;
|
||||
export type ExtraSticker = MakeExtra<'sendSticker', 'sticker'>;
|
||||
export type ExtraStopPoll = MakeExtra<'stopPoll', 'message_id'>;
|
||||
export type ExtraVenue = MakeExtra<'sendVenue', 'latitude' | 'longitude' | 'title' | 'address'>;
|
||||
export type ExtraVideo = MakeExtra<'sendVideo', 'video'>;
|
||||
export type ExtraVideoNote = MakeExtra<'sendVideoNote', 'video_note'>;
|
||||
export type ExtraVoice = MakeExtra<'sendVoice', 'voice'>;
|
||||
export type ExtraBanChatSenderChat = MakeExtra<'banChatSenderChat', 'sender_chat_id'>;
|
||||
export type ExtraCreateForumTopic = MakeExtra<'createForumTopic', 'name'>;
|
||||
export type ExtraEditForumTopic = MakeExtra<'editForumTopic', 'message_thread_id'>;
|
||||
export type MediaGroup = readonly (InputMediaPhoto | InputMediaVideo)[] | readonly InputMediaAudio[] | readonly InputMediaDocument[];
|
||||
/** Possible update types */
|
||||
export type UpdateType = Exclude<UnionKeys<Update>, keyof Update>;
|
||||
/** Possible message subtypes. Same as the properties on a message object */
|
||||
export type MessageSubType = 'forward_date' | Exclude<UnionKeys<Message>, keyof Message.CaptionableMessage | 'entities' | 'media_group_id'>;
|
||||
type ExtractPartial<T extends object, U extends object> = T extends unknown ? Required<T> extends U ? T : never : never;
|
||||
/**
|
||||
* Maps [[`Composer.on`]]'s `updateType` or `messageSubType` to a `tt.Update` subtype.
|
||||
* @deprecated
|
||||
*/
|
||||
export type MountMap = {
|
||||
[T in UpdateType]: Extract<Update, Record<T, object>>;
|
||||
} & {
|
||||
[T in MessageSubType]: {
|
||||
message: ExtractPartial<Update.MessageUpdate['message'], Record<T, unknown>>;
|
||||
update_id: number;
|
||||
};
|
||||
};
|
||||
export interface CommandContextExtn {
|
||||
match: RegExpExecArray;
|
||||
/**
|
||||
* Matched command. This will always be the actual command, excluding preceeding slash and `@botname`
|
||||
*
|
||||
* Examples:
|
||||
* ```
|
||||
* /command abc -> command
|
||||
* /command@xyzbot abc -> command
|
||||
* ```
|
||||
*/
|
||||
command: string;
|
||||
/**
|
||||
* The unparsed payload part of the command
|
||||
*
|
||||
* Examples:
|
||||
* ```
|
||||
* /command abc def -> "abc def"
|
||||
* /command "token1 token2" -> "\"token1 token2\""
|
||||
* ```
|
||||
*/
|
||||
payload: string;
|
||||
/**
|
||||
* Command args parsed into an array.
|
||||
*
|
||||
* Examples:
|
||||
* ```
|
||||
* /command token1 token2 -> [ "token1", "token2" ]
|
||||
* /command "token1 token2" -> [ "token1 token2" ]
|
||||
* /command token1 "token2 token3" -> [ "token1" "token2 token3" ]
|
||||
* ```
|
||||
* @unstable Parser implementation might vary until considered stable
|
||||
* */
|
||||
args: string[];
|
||||
}
|
||||
//# sourceMappingURL=telegram-types.d.ts.map
|
||||
1
node_modules/telegraf/typings/telegram-types.d.ts.map
generated
vendored
Normal file
1
node_modules/telegraf/typings/telegram-types.d.ts.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
681
node_modules/telegraf/typings/telegram.d.ts
generated
vendored
Normal file
681
node_modules/telegraf/typings/telegram.d.ts
generated
vendored
Normal file
@@ -0,0 +1,681 @@
|
||||
/// <reference types="node" />
|
||||
import * as tg from './core/types/typegram';
|
||||
import * as tt from './telegram-types';
|
||||
import ApiClient from './core/network/client';
|
||||
import { URL } from 'url';
|
||||
import { FmtString } from './format';
|
||||
export declare class Telegram extends ApiClient {
|
||||
/**
|
||||
* Get basic information about the bot
|
||||
*/
|
||||
getMe(): Promise<tg.UserFromGetMe>;
|
||||
/**
|
||||
* Get basic info about a file and prepare it for downloading.
|
||||
* @param fileId Id of file to get link to
|
||||
*/
|
||||
getFile(fileId: string): Promise<tg.File>;
|
||||
/**
|
||||
* Get download link to a file.
|
||||
*/
|
||||
getFileLink(fileId: string | tg.File): Promise<URL>;
|
||||
/**
|
||||
* Directly request incoming updates.
|
||||
* You should probably use `Telegraf::launch` instead.
|
||||
*/
|
||||
getUpdates(timeout: number, limit: number, offset: number, allowedUpdates: readonly tt.UpdateType[] | undefined): Promise<tg.Update[]>;
|
||||
getWebhookInfo(): Promise<tg.WebhookInfo>;
|
||||
getGameHighScores(userId: number, inlineMessageId: string | undefined, chatId: number | undefined, messageId: number | undefined): Promise<tg.GameHighScore[]>;
|
||||
setGameScore(userId: number, score: number, inlineMessageId: string | undefined, chatId: number | undefined, messageId: number | undefined, editMessage?: boolean, force?: boolean): Promise<true | (tg.Update.Edited & tg.Message.GameMessage)>;
|
||||
/**
|
||||
* Specify a url to receive incoming updates via an outgoing webhook.
|
||||
* @param url HTTPS url to send updates to. Use an empty string to remove webhook integration
|
||||
*/
|
||||
setWebhook(url: string, extra?: tt.ExtraSetWebhook): Promise<true>;
|
||||
/**
|
||||
* Remove webhook integration.
|
||||
*/
|
||||
deleteWebhook(extra?: {
|
||||
drop_pending_updates?: boolean;
|
||||
}): Promise<true>;
|
||||
/**
|
||||
* Send a text message.
|
||||
* @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
|
||||
* @param text Text of the message to be sent
|
||||
*/
|
||||
sendMessage(chatId: number | string, text: string | FmtString, extra?: tt.ExtraReplyMessage): Promise<tg.Message.TextMessage>;
|
||||
/**
|
||||
* Forward existing message.
|
||||
* @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
|
||||
* @param fromChatId Unique identifier for the chat where the original message was sent (or channel username in the format @channelusername)
|
||||
* @param messageId Message identifier in the chat specified in from_chat_id
|
||||
*/
|
||||
forwardMessage(chatId: number | string, fromChatId: number | string, messageId: number, extra?: tt.ExtraForwardMessage): Promise<tg.Message>;
|
||||
/**
|
||||
* Use this method to forward multiple messages of any kind. If some of the specified messages can't be found or forwarded, they are skipped. Service messages and messages with protected content can't be forwarded. Album grouping is kept for forwarded messages.
|
||||
* @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
|
||||
* @param fromChatId Unique identifier for the chat where the original messages were sent (or channel username in the format @channelusername)
|
||||
* @param messageIds Identifiers of 1-100 messages in the chat from_chat_id to forward. The identifiers must be specified in a strictly increasing order.
|
||||
*/
|
||||
forwardMessages(chatId: number | string, fromChatId: number | string, messageIds: number[], extra?: tt.ExtraForwardMessages): Promise<tg.MessageId[]>;
|
||||
/**
|
||||
* Use this method when you need to tell the user that something is happening on the bot's side.
|
||||
* The status is set for 5 seconds or less (when a message arrives from your bot, Telegram clients clear its typing status).
|
||||
* @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
|
||||
*/
|
||||
sendChatAction(chat_id: number | string, action: tt.ChatAction, extra?: tt.ExtraSendChatAction): Promise<true>;
|
||||
/**
|
||||
* Use this method to change the chosen reactions on a message. Service messages can't be reacted to.
|
||||
* Automatically forwarded messages from a channel to its discussion group have the same available
|
||||
* reactions as messages in the channel. In albums, bots must react to the first message.
|
||||
* @param chat_id Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
|
||||
* @param message_id Identifier of the target message
|
||||
* @param reaction New list of reaction types to set on the message. Currently, as non-premium users, bots can set up
|
||||
* to one reaction per message. A custom emoji reaction can be used if it is either already present on the message
|
||||
* or explicitly allowed by chat administrators.
|
||||
* @param is_big Pass True to set the reaction with a big animation
|
||||
* @returns
|
||||
*/
|
||||
setMessageReaction(chat_id: number | string, message_id: number, reaction?: tg.ReactionType[], is_big?: boolean): Promise<true>;
|
||||
getUserProfilePhotos(userId: number, offset?: number, limit?: number): Promise<tg.UserProfilePhotos>;
|
||||
/**
|
||||
* Send point on the map.
|
||||
* @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
|
||||
*/
|
||||
sendLocation(chatId: number | string, latitude: number, longitude: number, extra?: tt.ExtraLocation): Promise<tg.Message.LocationMessage>;
|
||||
sendVenue(chatId: number | string, latitude: number, longitude: number, title: string, address: string, extra?: tt.ExtraVenue): Promise<tg.Message.VenueMessage>;
|
||||
/**
|
||||
* @param chatId Unique identifier for the target private chat
|
||||
*/
|
||||
sendInvoice(chatId: number | string, invoice: tt.NewInvoiceParameters, extra?: tt.ExtraInvoice): Promise<tg.Message.InvoiceMessage>;
|
||||
sendContact(chatId: number | string, phoneNumber: string, firstName: string, extra?: tt.ExtraContact): Promise<tg.Message.ContactMessage>;
|
||||
/**
|
||||
* @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
|
||||
*/
|
||||
sendPhoto(chatId: number | string, photo: tg.Opts<'sendPhoto'>['photo'], extra?: tt.ExtraPhoto): Promise<tg.Message.PhotoMessage>;
|
||||
/**
|
||||
* Send a dice, which will have a random value from 1 to 6.
|
||||
* @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
|
||||
*/
|
||||
sendDice(chatId: number | string, extra?: tt.ExtraDice): Promise<tg.Message.DiceMessage>;
|
||||
/**
|
||||
* Send general files. Bots can currently send files of any type of up to 50 MB in size, this limit may be changed in the future.
|
||||
* @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
|
||||
*/
|
||||
sendDocument(chatId: number | string, document: tg.Opts<'sendDocument'>['document'], extra?: tt.ExtraDocument): Promise<tg.Message.DocumentMessage>;
|
||||
/**
|
||||
* Send audio files, if you want Telegram clients to display them in the music player.
|
||||
* Your audio must be in the .mp3 format.
|
||||
* Bots can currently send audio files of up to 50 MB in size, this limit may be changed in the future.
|
||||
* @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
|
||||
*/
|
||||
sendAudio(chatId: number | string, audio: tg.Opts<'sendAudio'>['audio'], extra?: tt.ExtraAudio): Promise<tg.Message.AudioMessage>;
|
||||
/**
|
||||
* Send .webp, animated .tgs, or video .webm stickers
|
||||
* @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
|
||||
*/
|
||||
sendSticker(chatId: number | string, sticker: tg.Opts<'sendSticker'>['sticker'], extra?: tt.ExtraSticker): Promise<tg.Message.StickerMessage>;
|
||||
/**
|
||||
* Send video files, Telegram clients support mp4 videos (other formats may be sent as Document).
|
||||
* Bots can currently send video files of up to 50 MB in size, this limit may be changed in the future.
|
||||
* @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
|
||||
*/
|
||||
sendVideo(chatId: number | string, video: tg.Opts<'sendVideo'>['video'], extra?: tt.ExtraVideo): Promise<tg.Message.VideoMessage>;
|
||||
/**
|
||||
* Send .gif animations.
|
||||
* @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
|
||||
*/
|
||||
sendAnimation(chatId: number | string, animation: tg.Opts<'sendAnimation'>['animation'], extra?: tt.ExtraAnimation): Promise<tg.Message.AnimationMessage>;
|
||||
/**
|
||||
* Send video messages.
|
||||
* @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
|
||||
*/
|
||||
sendVideoNote(chatId: number | string, videoNote: string | tg.InputFileVideoNote, extra?: tt.ExtraVideoNote): Promise<tg.Message.VideoNoteMessage>;
|
||||
/**
|
||||
* Send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .ogg file encoded with OPUS (other formats may be sent as Audio or Document). On success, the sent Message is returned. Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future.
|
||||
* @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
|
||||
*/
|
||||
sendVoice(chatId: number | string, voice: tg.Opts<'sendVoice'>['voice'], extra?: tt.ExtraVoice): Promise<tg.Message.VoiceMessage>;
|
||||
/**
|
||||
* @param chatId Unique identifier for the target chat
|
||||
* @param gameShortName Short name of the game, serves as the unique identifier for the game. Set up your games via Botfather.
|
||||
*/
|
||||
sendGame(chatId: number, gameName: string, extra?: tt.ExtraGame): Promise<tg.Message.GameMessage>;
|
||||
/**
|
||||
* Send a group of photos or videos as an album.
|
||||
* @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
|
||||
* @param media A JSON-serialized array describing photos and videos to be sent, must include 2–10 items
|
||||
*/
|
||||
sendMediaGroup(chatId: number | string, media: tt.MediaGroup, extra?: tt.ExtraMediaGroup): Promise<(tg.Message.DocumentMessage | tg.Message.AudioMessage | tg.Message.PhotoMessage | tg.Message.VideoMessage)[]>;
|
||||
/**
|
||||
* Send a native poll.
|
||||
* @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
|
||||
* @param question Poll question, 1-255 characters
|
||||
* @param options A JSON-serialized list of answer options, 2-10 strings 1-100 characters each
|
||||
*/
|
||||
sendPoll(chatId: number | string, question: string, options: readonly string[], extra?: tt.ExtraPoll): Promise<tg.Message.PollMessage>;
|
||||
/**
|
||||
* Send a native quiz.
|
||||
* @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
|
||||
* @param question Poll question, 1-255 characters
|
||||
* @param options A JSON-serialized list of answer options, 2-10 strings 1-100 characters each
|
||||
*/
|
||||
sendQuiz(chatId: number | string, question: string, options: readonly string[], extra?: tt.ExtraPoll): Promise<tg.Message.PollMessage>;
|
||||
/**
|
||||
* @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
|
||||
* @param messageId Identifier of the original message with the poll
|
||||
*/
|
||||
stopPoll(chatId: number | string, messageId: number, extra?: tt.ExtraStopPoll): Promise<tg.Poll>;
|
||||
/**
|
||||
* Get up to date information about the chat (current name of the user for one-on-one conversations, current username of a user, group or channel, etc.).
|
||||
* @param chatId Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername)
|
||||
*/
|
||||
getChat(chatId: number | string): Promise<tg.ChatFromGetChat>;
|
||||
/**
|
||||
* @param chatId Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername)
|
||||
*/
|
||||
getChatAdministrators(chatId: number | string): Promise<(tg.ChatMemberOwner | tg.ChatMemberAdministrator)[]>;
|
||||
/**
|
||||
* Get information about a member of a chat.
|
||||
* @param chatId Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername)
|
||||
* @param userId Unique identifier of the target user
|
||||
*/
|
||||
getChatMember(chatId: string | number, userId: number): Promise<tg.ChatMember>;
|
||||
/**
|
||||
* Get the number of members in a chat.
|
||||
* @param chatId Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername)
|
||||
*/
|
||||
getChatMembersCount(chatId: string | number): Promise<number>;
|
||||
/**
|
||||
* Send answers to an inline query.
|
||||
* No more than 50 results per query are allowed.
|
||||
*/
|
||||
answerInlineQuery(inlineQueryId: string, results: readonly tg.InlineQueryResult[], extra?: tt.ExtraAnswerInlineQuery): Promise<true>;
|
||||
setChatPermissions(chatId: number | string, permissions: tg.ChatPermissions, extra?: tt.ExtraSetChatPermissions): Promise<true>;
|
||||
/**
|
||||
* Kick a user from a group, a supergroup or a channel. In the case of supergroups and channels, the user will not be able to return to the group on their own using invite links, etc., unless unbanned first. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights.
|
||||
* @param chatId Unique identifier for the target group or username of the target supergroup or channel (in the format `@channelusername`)
|
||||
* @param untilDate Date when the user will be unbanned, unix time. If user is banned for more than 366 days or less than 30 seconds from the current time they are considered to be banned forever
|
||||
*/
|
||||
banChatMember(chatId: number | string, userId: number, untilDate?: number, extra?: tt.ExtraBanChatMember): Promise<true>;
|
||||
/**
|
||||
* Kick a user from a group, a supergroup or a channel. In the case of supergroups and channels, the user will not be able to return to the group on their own using invite links, etc., unless unbanned first. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights.
|
||||
* @param chatId Unique identifier for the target group or username of the target supergroup or channel (in the format `@channelusername`)
|
||||
* @param untilDate Date when the user will be unbanned, unix time. If user is banned for more than 366 days or less than 30 seconds from the current time they are considered to be banned forever
|
||||
* @deprecated since API 5.3. Use {@link Telegram.banChatMember}
|
||||
*/
|
||||
get kickChatMember(): (chatId: string | number, userId: number, untilDate?: number | undefined, extra?: Omit<{
|
||||
chat_id: string | number;
|
||||
user_id: number;
|
||||
until_date?: number | undefined;
|
||||
revoke_messages?: boolean | undefined;
|
||||
}, "chat_id" | "user_id" | "until_date"> | undefined) => Promise<true>;
|
||||
/**
|
||||
* Promote or demote a user in a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Pass False for all boolean parameters to demote a user.
|
||||
* @param chatId Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
|
||||
*/
|
||||
promoteChatMember(chatId: number | string, userId: number, extra: tt.ExtraPromoteChatMember): Promise<true>;
|
||||
/**
|
||||
* Restrict a user in a supergroup. The bot must be an administrator in the supergroup for this to work and must have the appropriate admin rights. Pass True for all boolean parameters to lift restrictions from a user.
|
||||
* @param chatId Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
|
||||
*/
|
||||
restrictChatMember(chatId: string | number, userId: number, extra: tt.ExtraRestrictChatMember): Promise<true>;
|
||||
setChatAdministratorCustomTitle(chatId: number | string, userId: number, title: string): Promise<true>;
|
||||
/**
|
||||
* Export an invite link to a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights.
|
||||
* @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
|
||||
*/
|
||||
exportChatInviteLink(chatId: number | string): Promise<string>;
|
||||
createChatInviteLink(chatId: number | string, extra?: tt.ExtraCreateChatInviteLink): Promise<tg.ChatInviteLink>;
|
||||
createInvoiceLink(invoice: tt.NewInvoiceLinkParameters): Promise<string>;
|
||||
editChatInviteLink(chatId: number | string, inviteLink: string, extra?: tt.ExtraEditChatInviteLink): Promise<tg.ChatInviteLink>;
|
||||
revokeChatInviteLink(chatId: number | string, inviteLink: string): Promise<tg.ChatInviteLink>;
|
||||
setChatPhoto(chatId: number | string, photo: tg.Opts<'setChatPhoto'>['photo']): Promise<true>;
|
||||
deleteChatPhoto(chatId: number | string): Promise<true>;
|
||||
/**
|
||||
* Change the title of a chat. Titles can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights.
|
||||
* @param chatId Unique identifier for the target group or username of the target supergroup or channel (in the format `@channelusername`)
|
||||
* @param title New chat title, 1-255 characters
|
||||
*/
|
||||
setChatTitle(chatId: number | string, title: string): Promise<true>;
|
||||
setChatDescription(chatId: number | string, description?: string): Promise<true>;
|
||||
/**
|
||||
* Pin a message in a group, a supergroup, or a channel. The bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' admin right in the supergroup or 'can_edit_messages' admin right in the channel.
|
||||
* @param chatId Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
|
||||
*/
|
||||
pinChatMessage(chatId: number | string, messageId: number, extra?: {
|
||||
disable_notification?: boolean;
|
||||
}): Promise<true>;
|
||||
/**
|
||||
* Unpin a message in a group, a supergroup, or a channel. The bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' admin right in the supergroup or 'can_edit_messages' admin right in the channel.
|
||||
* @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
|
||||
*/
|
||||
unpinChatMessage(chatId: number | string, messageId?: number): Promise<true>;
|
||||
/**
|
||||
* Clear the list of pinned messages in a chat.
|
||||
* @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
|
||||
*/
|
||||
unpinAllChatMessages(chatId: number | string): Promise<true>;
|
||||
/**
|
||||
* Use this method for your bot to leave a group, supergroup or channel.
|
||||
* @param chatId Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername)
|
||||
*/
|
||||
leaveChat(chatId: number | string): Promise<true>;
|
||||
/**
|
||||
* Unban a user from a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights.
|
||||
* @param chatId Unique identifier for the target group or username of the target supergroup or channel (in the format @username)
|
||||
* @param userId Unique identifier of the target user
|
||||
*/
|
||||
unbanChatMember(chatId: number | string, userId: number, extra?: {
|
||||
only_if_banned?: boolean;
|
||||
}): Promise<true>;
|
||||
answerCbQuery(callbackQueryId: string, text?: string, extra?: tt.ExtraAnswerCbQuery): Promise<true>;
|
||||
answerGameQuery(callbackQueryId: string, url: string): Promise<true>;
|
||||
/**
|
||||
* Use this method to get the list of boosts added to a chat by a user. Requires administrator rights in the chat. Returns a UserChatBoosts object.
|
||||
* @param chat_id Unique identifier for the chat or username of the channel (in the format `@channelusername`)
|
||||
* @param user_id Unique identifier of the target user
|
||||
*/
|
||||
getUserChatBoosts(chat_id: number | string, user_id: number): Promise<tg.UserChatBoosts[]>;
|
||||
/**
|
||||
* If you sent an invoice requesting a shipping address and the parameter is_flexible was specified,
|
||||
* the Bot API will send an Update with a shipping_query field to the bot.
|
||||
* Reply to shipping queries.
|
||||
* @param ok Specify True if delivery to the specified address is possible and False if there are any problems (for example, if delivery to the specified address is not possible)
|
||||
* @param shippingOptions Required if ok is True. A JSON-serialized array of available shipping options.
|
||||
* @param errorMessage Required if ok is False. Error message in human readable form that explains why it is impossible to complete the order (e.g. "Sorry, delivery to your desired address is unavailable'). Telegram will display this message to the user.
|
||||
*/
|
||||
answerShippingQuery(shippingQueryId: string, ok: boolean, shippingOptions: readonly tg.ShippingOption[] | undefined, errorMessage: string | undefined): Promise<true>;
|
||||
/**
|
||||
* Once the user has confirmed their payment and shipping details, the Bot API sends the final confirmation in the form of an Update with the field pre_checkout_query.
|
||||
* Respond to such pre-checkout queries. On success, True is returned.
|
||||
* Note: The Bot API must receive an answer within 10 seconds after the pre-checkout query was sent.
|
||||
* @param ok Specify True if everything is alright (goods are available, etc.) and the bot is ready to proceed with the order. Use False if there are any problems.
|
||||
* @param errorMessage Required if ok is False. Error message in human readable form that explains the reason for failure to proceed with the checkout (e.g. "Sorry, somebody just bought the last of our amazing black T-shirts while you were busy filling out your payment details. Please choose a different color or garment!"). Telegram will display this message to the user.
|
||||
*/
|
||||
answerPreCheckoutQuery(preCheckoutQueryId: string, ok: boolean, errorMessage?: string): Promise<true>;
|
||||
answerWebAppQuery(webAppQueryId: string, result: tg.InlineQueryResult): Promise<tg.SentWebAppMessage>;
|
||||
/**
|
||||
* Edit text and game messages sent by the bot or via the bot (for inline bots).
|
||||
* On success, if edited message is sent by the bot, the edited Message is returned, otherwise True is returned.
|
||||
* @param chatId Required if inlineMessageId is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername)
|
||||
* @param messageId Required if inlineMessageId is not specified. Identifier of the sent message
|
||||
* @param inlineMessageId Required if chatId and messageId are not specified. Identifier of the inline message
|
||||
* @param text New text of the message
|
||||
*/
|
||||
editMessageText(chatId: number | string | undefined, messageId: number | undefined, inlineMessageId: string | undefined, text: string | FmtString, extra?: tt.ExtraEditMessageText): Promise<true | (tg.Update.Edited & tg.Message.TextMessage)>;
|
||||
/**
|
||||
* Edit captions of messages sent by the bot or via the bot (for inline bots).
|
||||
* On success, if edited message is sent by the bot, the edited Message is returned, otherwise True is returned.
|
||||
* @param chatId Required if inlineMessageId is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername)
|
||||
* @param messageId Required if inlineMessageId is not specified. Identifier of the sent message
|
||||
* @param inlineMessageId Required if chatId and messageId are not specified. Identifier of the inline message
|
||||
* @param caption New caption of the message
|
||||
* @param markup A JSON-serialized object for an inline keyboard.
|
||||
*/
|
||||
editMessageCaption(chatId: number | string | undefined, messageId: number | undefined, inlineMessageId: string | undefined, caption: string | FmtString | undefined, extra?: tt.ExtraEditMessageCaption): Promise<true | (tg.Update.Edited & tg.Message.CaptionableMessage)>;
|
||||
/**
|
||||
* Edit animation, audio, document, photo, or video messages.
|
||||
* If a message is a part of a message album, then it can be edited only to a photo or a video.
|
||||
* Otherwise, message type can be changed arbitrarily.
|
||||
* When inline message is edited, new file can't be uploaded.
|
||||
* Use previously uploaded file via its file_id or specify a URL.
|
||||
* @param chatId Required if inlineMessageId is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername)
|
||||
* @param messageId Required if inlineMessageId is not specified. Identifier of the sent message
|
||||
* @param inlineMessageId Required if chatId and messageId are not specified. Identifier of the inline message
|
||||
* @param media New media of message
|
||||
* @param extra Additional parameters, such as reply_markup
|
||||
*/
|
||||
editMessageMedia(chatId: number | string | undefined, messageId: number | undefined, inlineMessageId: string | undefined, media: tt.WrapCaption<tg.InputMedia>, extra?: tt.ExtraEditMessageMedia): Promise<true | (tg.Update.Edited & tg.Message)>;
|
||||
/**
|
||||
* Edit only the reply markup of messages sent by the bot or via the bot (for inline bots).
|
||||
* @param chatId Required if inlineMessageId is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername)
|
||||
* @param messageId Required if inlineMessageId is not specified. Identifier of the sent message
|
||||
* @param inlineMessageId Required if chatId and messageId are not specified. Identifier of the inline message
|
||||
* @param markup A JSON-serialized object for an inline keyboard.
|
||||
* @returns If edited message is sent by the bot, the edited Message is returned, otherwise True is returned.
|
||||
*/
|
||||
editMessageReplyMarkup(chatId: number | string | undefined, messageId: number | undefined, inlineMessageId: string | undefined, markup: tg.InlineKeyboardMarkup | undefined): Promise<true | (tg.Update.Edited & tg.Message)>;
|
||||
editMessageLiveLocation(chatId: number | string | undefined, messageId: number | undefined, inlineMessageId: string | undefined, latitude: number, longitude: number, extra?: tt.ExtraEditMessageLiveLocation): Promise<true | (tg.Update.Edited & tg.Message.LocationMessage)>;
|
||||
stopMessageLiveLocation(chatId: number | string | undefined, messageId: number | undefined, inlineMessageId: string | undefined, markup?: tg.InlineKeyboardMarkup): Promise<true | (tg.Update.Edited & tg.Message.LocationMessage)>;
|
||||
/**
|
||||
* Delete a message, including service messages, with the following limitations:
|
||||
* - A message can only be deleted if it was sent less than 48 hours ago.
|
||||
* - Bots can delete outgoing messages in groups and supergroups.
|
||||
* - Bots granted can_post_messages permissions can delete outgoing messages in channels.
|
||||
* - If the bot is an administrator of a group, it can delete any message there.
|
||||
* - If the bot has can_delete_messages permission in a supergroup or a channel, it can delete any message there.
|
||||
* @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
|
||||
* @param messageId Identifier of the message to delete
|
||||
*/
|
||||
deleteMessage(chatId: number | string, messageId: number): Promise<true>;
|
||||
/**
|
||||
* Use this method to delete multiple messages simultaneously. If some of the specified messages can't be found, they are skipped.
|
||||
* @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
|
||||
* @param messageIds Identifiers of 1-100 messages to delete. See deleteMessage for limitations on which messages can be deleted
|
||||
*/
|
||||
deleteMessages(chatId: number | string, messageIds: number[]): Promise<true>;
|
||||
setChatStickerSet(chatId: number | string, setName: string): Promise<true>;
|
||||
deleteChatStickerSet(chatId: number | string): Promise<true>;
|
||||
/**
|
||||
* Use this method to get custom emoji stickers, which can be used as a forum topic icon by any user.
|
||||
* Requires no parameters. Returns an Array of Sticker objects.
|
||||
*
|
||||
* @see https://core.telegram.org/bots/api#getforumtopiciconstickers
|
||||
*/
|
||||
getForumTopicIconStickers(): Promise<tg.Sticker[]>;
|
||||
/**
|
||||
* Use this method to create a topic in a forum supergroup chat. The bot must be an administrator in the chat for this
|
||||
* to work and must have the can_manage_topics administrator rights. Returns information about the created topic as a
|
||||
* ForumTopic object.
|
||||
*
|
||||
* @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
|
||||
* @param name Topic name, 1-128 characters
|
||||
*
|
||||
* @see https://core.telegram.org/bots/api#createforumtopic
|
||||
*/
|
||||
createForumTopic(chat_id: number | string, name: string, extra?: tt.ExtraCreateForumTopic): Promise<tg.ForumTopic>;
|
||||
/**
|
||||
* Use this method to edit name and icon of a topic in a forum supergroup chat. The bot must be an administrator in
|
||||
* the chat for this to work and must have can_manage_topics administrator rights, unless it is the creator of the
|
||||
* topic. Returns True on success.
|
||||
*
|
||||
* @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
|
||||
* @param message_thread_id Unique identifier for the target message thread of the forum topic
|
||||
*
|
||||
* @see https://core.telegram.org/bots/api#editforumtopic
|
||||
*/
|
||||
editForumTopic(chat_id: number | string, message_thread_id: number, extra: tt.ExtraEditForumTopic): Promise<true>;
|
||||
/**
|
||||
* Use this method to close an open topic in a forum supergroup chat. The bot must be an administrator in the chat
|
||||
* for this to work and must have the can_manage_topics administrator rights, unless it is the creator of the topic.
|
||||
* Returns True on success.
|
||||
*
|
||||
* @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
|
||||
* @param message_thread_id Unique identifier for the target message thread of the forum topic
|
||||
*
|
||||
* @see https://core.telegram.org/bots/api#closeforumtopic
|
||||
*/
|
||||
closeForumTopic(chat_id: number | string, message_thread_id: number): Promise<true>;
|
||||
/**
|
||||
* Use this method to reopen a closed topic in a forum supergroup chat. The bot must be an administrator in the chat
|
||||
* for this to work and must have the can_manage_topics administrator rights, unless it is the creator of the topic.
|
||||
* Returns True on success.
|
||||
*
|
||||
* @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
|
||||
* @param message_thread_id Unique identifier for the target message thread of the forum topic
|
||||
*
|
||||
* @see https://core.telegram.org/bots/api#reopenforumtopic
|
||||
*/
|
||||
reopenForumTopic(chat_id: number | string, message_thread_id: number): Promise<true>;
|
||||
/**
|
||||
* Use this method to delete a forum topic along with all its messages in a forum supergroup chat. The bot must be an
|
||||
* administrator in the chat for this to work and must have the can_delete_messages administrator rights.
|
||||
* Returns True on success.
|
||||
*
|
||||
* @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
|
||||
* @param message_thread_id Unique identifier for the target message thread of the forum topic
|
||||
*
|
||||
* @see https://core.telegram.org/bots/api#deleteforumtopic
|
||||
*/
|
||||
deleteForumTopic(chat_id: number | string, message_thread_id: number): Promise<true>;
|
||||
/**
|
||||
* Use this method to clear the list of pinned messages in a forum topic. The bot must be an administrator in the chat
|
||||
* for this to work and must have the can_pin_messages administrator right in the supergroup. Returns True on success.
|
||||
*
|
||||
* @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
|
||||
* @param message_thread_id Unique identifier for the target message thread of the forum topic
|
||||
*
|
||||
* @see https://core.telegram.org/bots/api#unpinallforumtopicmessages
|
||||
*/
|
||||
unpinAllForumTopicMessages(chat_id: number | string, message_thread_id: number): Promise<true>;
|
||||
/**
|
||||
* Use this method to edit the name of the 'General' topic in a forum supergroup chat. The bot must be an administrator
|
||||
* in the chat for this to work and must have can_manage_topics administrator rights. Returns True on success.
|
||||
*
|
||||
* @param chat_id Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
|
||||
* @param name New topic name, 1-128 characters
|
||||
*
|
||||
* @see https://core.telegram.org/bots/api#editgeneralforumtopic
|
||||
*/
|
||||
editGeneralForumTopic(chat_id: number | string, name: string): Promise<true>;
|
||||
/**
|
||||
* Use this method to close an open 'General' topic in a forum supergroup chat. The bot must be an administrator in the
|
||||
* chat for this to work and must have the can_manage_topics administrator rights. Returns True on success.
|
||||
*
|
||||
* @param chat_id Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
|
||||
*
|
||||
* @see https://core.telegram.org/bots/api#closegeneralforumtopic
|
||||
*/
|
||||
closeGeneralForumTopic(chat_id: number | string): Promise<true>;
|
||||
/**
|
||||
* Use this method to reopen a closed 'General' topic in a forum supergroup chat. The bot must be an administrator in
|
||||
* the chat for this to work and must have the can_manage_topics administrator rights. The topic will be automatically
|
||||
* unhidden if it was hidden. Returns True on success.
|
||||
*
|
||||
* @param chat_id Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
|
||||
*
|
||||
* @see https://core.telegram.org/bots/api#reopengeneralforumtopic
|
||||
*/
|
||||
reopenGeneralForumTopic(chat_id: number | string): Promise<true>;
|
||||
/**
|
||||
* Use this method to hide the 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat
|
||||
* for this to work and must have the can_manage_topics administrator rights. The topic will be automatically closed
|
||||
* if it was open. Returns True on success.
|
||||
*
|
||||
* @param chat_id Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
|
||||
*
|
||||
* @see https://core.telegram.org/bots/api#hidegeneralforumtopic
|
||||
*/
|
||||
hideGeneralForumTopic(chat_id: number | string): Promise<true>;
|
||||
/**
|
||||
* Use this method to unhide the 'General' topic in a forum supergroup chat. The bot must be an administrator in the
|
||||
* chat for this to work and must have the can_manage_topics administrator rights. Returns True on success.
|
||||
*
|
||||
* @param chat_id Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
|
||||
*
|
||||
* @see https://core.telegram.org/bots/api#unhidegeneralforumtopic
|
||||
*/
|
||||
unhideGeneralForumTopic(chat_id: number | string): Promise<true>;
|
||||
/**
|
||||
* Use this method to clear the list of pinned messages in a General forum topic.
|
||||
* The bot must be an administrator in the chat for this to work and must have the can_pin_messages administrator
|
||||
* right in the supergroup.
|
||||
*
|
||||
* @param chat_id Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
|
||||
*/
|
||||
unpinAllGeneralForumTopicMessages(chat_id: number | string): Promise<true>;
|
||||
getStickerSet(name: string): Promise<tg.StickerSet>;
|
||||
/**
|
||||
* Upload a .png file with a sticker for later use in createNewStickerSet and addStickerToSet methods (can be used multiple times).
|
||||
* https://core.telegram.org/bots/api#sending-files
|
||||
* @param ownerId User identifier of sticker file owner
|
||||
* @param stickerFile Png image with the sticker, must be up to 512 kilobytes in size, dimensions must not exceed 512px, and either width or height must be exactly 512px.
|
||||
*/
|
||||
uploadStickerFile(ownerId: number, sticker: tg.Opts<'uploadStickerFile'>['sticker'], sticker_format: tg.Opts<'uploadStickerFile'>['sticker_format']): Promise<tg.File>;
|
||||
/**
|
||||
* Create new sticker set owned by a user. The bot will be able to edit the created sticker set.
|
||||
* @param ownerId User identifier of created sticker set owner
|
||||
* @param name Short name of sticker set, to be used in t.me/addstickers/ URLs (e.g., animals). Can contain only english letters, digits and underscores. Must begin with a letter, can't contain consecutive underscores and must end in “_by_<bot username>”. <bot_username> is case insensitive. 1-64 characters.
|
||||
* @param title Sticker set title, 1-64 characters
|
||||
*/
|
||||
createNewStickerSet(ownerId: number, name: string, title: string, stickerData: tt.ExtraCreateNewStickerSet): Promise<true>;
|
||||
/**
|
||||
* Add a new sticker to a set created by the bot.
|
||||
* @param ownerId User identifier of sticker set owner
|
||||
* @param name Sticker set name
|
||||
*/
|
||||
addStickerToSet(ownerId: number, name: string, stickerData: tt.ExtraAddStickerToSet): Promise<true>;
|
||||
/**
|
||||
* Move a sticker in a set created by the bot to a specific position.
|
||||
* @param sticker File identifier of the sticker
|
||||
* @param position New sticker position in the set, zero-based
|
||||
*/
|
||||
setStickerPositionInSet(sticker: string, position: number): Promise<true>;
|
||||
/**
|
||||
* @deprecated since API 6.8. Use {@link Telegram.setStickerSetThumbnail}
|
||||
*/
|
||||
get setStickerSetThumb(): (name: string, userId: number, thumbnail?: string | tg.InputFile | undefined) => Promise<true>;
|
||||
/**
|
||||
* Use this method to set the thumbnail of a regular or mask sticker set.
|
||||
* The format of the thumbnail file must match the format of the stickers in the set.
|
||||
* @param name Sticker set name
|
||||
* @param userId User identifier of the sticker set owner
|
||||
* @param thumbnail A .WEBP or .PNG image with the thumbnail, must be up to 128 kilobytes in size
|
||||
* and have a width and height of exactly 100px, or a .TGS animation with a thumbnail up to
|
||||
* 32 kilobytes in size (see
|
||||
* [animated sticker technical requirements](https://core.telegram.org/stickers#animated-sticker-requirements)),
|
||||
* or a WEBM video with the thumbnail up to 32 kilobytes in size; see
|
||||
* [video sticker technical requirements](https://core.telegram.org/stickers#video-sticker-requirements).
|
||||
* Pass a file_id as a String to send a file that already exists on the Telegram servers, pass a
|
||||
* HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using
|
||||
* Input helpers. Animated and video sticker set thumbnails can't be uploaded via HTTP URL.
|
||||
* If omitted, then the thumbnail is dropped and the first sticker is used as the thumbnail.
|
||||
*/
|
||||
setStickerSetThumbnail(name: string, userId: number, thumbnail?: tg.Opts<'setStickerSetThumbnail'>['thumbnail']): Promise<true>;
|
||||
setStickerMaskPosition(sticker: string, mask_position?: tg.MaskPosition): Promise<true>;
|
||||
setStickerKeywords(sticker: string, keywords?: string[]): Promise<true>;
|
||||
setStickerEmojiList(sticker: string, emoji_list: string[]): Promise<true>;
|
||||
deleteStickerSet(name: string): Promise<true>;
|
||||
setStickerSetTitle(name: string, title: string): Promise<true>;
|
||||
setCustomEmojiStickerSetThumbnail(name: string, custom_emoji_id: string): Promise<true>;
|
||||
/**
|
||||
* Delete a sticker from a set created by the bot.
|
||||
* @param sticker File identifier of the sticker
|
||||
*/
|
||||
deleteStickerFromSet(sticker: string): Promise<true>;
|
||||
getCustomEmojiStickers(custom_emoji_ids: string[]): Promise<tg.Sticker[]>;
|
||||
/**
|
||||
* Change the list of the bot's commands.
|
||||
* @param commands A list of bot commands to be set as the list of the bot's commands. At most 100 commands can be specified.
|
||||
*/
|
||||
setMyCommands(commands: readonly tg.BotCommand[], extra?: tt.ExtraSetMyCommands): Promise<true>;
|
||||
deleteMyCommands(extra?: tg.Opts<'deleteMyCommands'>): Promise<true>;
|
||||
/**
|
||||
* Get the current list of the bot's commands.
|
||||
*/
|
||||
getMyCommands(extra?: tg.Opts<'getMyCommands'>): Promise<tg.BotCommand[]>;
|
||||
/**
|
||||
* Use this method to change the bot's description, which is shown in the chat with the bot if the chat is empty.
|
||||
* @param description New bot description; 0-512 characters. Pass an empty string to remove the dedicated description for the given language.
|
||||
* @param language_code A two-letter ISO 639-1 language code. If empty, the description will be applied to all users for whose language there is no dedicated description.
|
||||
*/
|
||||
setMyDescription(description: string, language_code?: string): Promise<true>;
|
||||
/**
|
||||
* Use this method to change the bot's name.
|
||||
* @param name New bot name; 0-64 characters. Pass an empty string to remove the dedicated name for the given language.
|
||||
* @param language_code A two-letter ISO 639-1 language code. If empty, the name will be shown to all users for whose language there is no dedicated name.
|
||||
*/
|
||||
setMyName(name: string, language_code?: string): Promise<true>;
|
||||
/**
|
||||
* Use this method to get the current bot name for the given user language.
|
||||
* @param language_code A two-letter ISO 639-1 language code or an empty string
|
||||
*/
|
||||
getMyName(language_code?: string): Promise<tg.BotName>;
|
||||
/**
|
||||
* Use this method to get the current bot description for the given user language.
|
||||
* @param language_code A two-letter ISO 639-1 language code.
|
||||
*/
|
||||
getMyDescription(language_code?: string): Promise<tg.BotDescription>;
|
||||
/**
|
||||
* Use this method to change the bot's short description, which is shown on the bot's profile page and is sent together with the link when users share the bot.
|
||||
* @param description New short description for the bot; 0-120 characters. Pass an empty string to remove the dedicated short description for the given language.
|
||||
* @param language_code A two-letter ISO 639-1 language code. If empty, the short description will be applied to all users for whose language there is no dedicated short description.
|
||||
*/
|
||||
setMyShortDescription(short_description: string, language_code?: string): Promise<true>;
|
||||
/**
|
||||
* Use this method to get the current bot short description for the given user language.
|
||||
* @param language_code A two-letter ISO 639-1 language code or an empty string
|
||||
*/
|
||||
getMyShortDescription(language_code?: string): Promise<tg.BotShortDescription>;
|
||||
setPassportDataErrors(userId: number, errors: readonly tg.PassportElementError[]): Promise<true>;
|
||||
/**
|
||||
* Send copy of existing message.
|
||||
* @deprecated use `copyMessage` instead
|
||||
* @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
|
||||
* @param message Received message object
|
||||
*/
|
||||
sendCopy(chatId: number | string, message: tg.Message, extra?: tt.ExtraCopyMessage): Promise<tg.MessageId>;
|
||||
/**
|
||||
* Send copy of existing message.
|
||||
* @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
|
||||
* @param fromChatId Unique identifier for the chat where the original message was sent (or channel username in the format @channelusername)
|
||||
* @param messageId Message identifier in the chat specified in from_chat_id
|
||||
*/
|
||||
copyMessage(chatId: number | string, fromChatId: number | string, messageId: number, extra?: tt.ExtraCopyMessage): Promise<tg.MessageId>;
|
||||
/**
|
||||
* Use this method to copy messages of any kind. If some of the specified messages can't be found or copied, they are skipped. Service messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied. A quiz poll can be copied only if the value of the field correct_option_id is known to the bot. The method is analogous to the method forwardMessages, but the copied messages don't have a link to the original message. Album grouping is kept for copied messages.
|
||||
* @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
|
||||
* @param fromChatId Unique identifier for the chat where the original messages were sent (or channel username in the format @channelusername)
|
||||
* @param messageIds Identifiers of 1-100 messages in the chat from_chat_id to copy. The identifiers must be specified in a strictly increasing order.
|
||||
*/
|
||||
copyMessages(chatId: number | string, fromChatId: number | string, messageIds: number[], extra?: tt.ExtraCopyMessages): Promise<tg.MessageId[]>;
|
||||
/**
|
||||
* Approve a chat join request.
|
||||
* The bot must be an administrator in the chat for this to work and must have the can_invite_users administrator right.
|
||||
* @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
|
||||
* @param userId Unique identifier of the target user
|
||||
*/
|
||||
approveChatJoinRequest(chatId: number | string, userId: number): Promise<true>;
|
||||
/**
|
||||
* Decline a chat join request.
|
||||
* The bot must be an administrator in the chat for this to work and must have the can_invite_users administrator right.
|
||||
* @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
|
||||
* @param userId Unique identifier of the target user
|
||||
*/
|
||||
declineChatJoinRequest(chatId: number | string, userId: number): Promise<true>;
|
||||
/**
|
||||
* Ban a channel chat in a supergroup or a channel. The owner of the chat will not be able to send messages and join live streams on behalf of the chat, unless it is unbanned first.
|
||||
* The bot must be an administrator in the supergroup or channel for this to work and must have the appropriate administrator rights.
|
||||
* @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
|
||||
* @param senderChatId Unique identifier of the target sender chat
|
||||
*/
|
||||
banChatSenderChat(chatId: number | string, senderChatId: number, extra?: tt.ExtraBanChatSenderChat): Promise<true>;
|
||||
/**
|
||||
* Unban a previously banned channel chat in a supergroup or channel.
|
||||
* The bot must be an administrator for this to work and must have the appropriate administrator rights.
|
||||
* @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
|
||||
* @param senderChatId Unique identifier of the target sender chat
|
||||
*/
|
||||
unbanChatSenderChat(chatId: number | string, senderChatId: number): Promise<true>;
|
||||
/**
|
||||
* Use this method to change the bot's menu button in a private chat, or the default menu button. Returns true on success.
|
||||
* @param chatId Unique identifier for the target private chat. If not specified, default bot's menu button will be changed.
|
||||
* @param menuButton An object for the bot's new menu button.
|
||||
*/
|
||||
setChatMenuButton({ chatId, menuButton, }?: {
|
||||
chatId?: number | undefined;
|
||||
menuButton?: tg.MenuButton | undefined;
|
||||
}): Promise<true>;
|
||||
/**
|
||||
* Use this method to get the current value of the bot's menu button in a private chat, or the default menu button. Returns MenuButton on success.
|
||||
* @param chatId Unique identifier for the target private chat. If not specified, default bot's menu button will be returned.
|
||||
*/
|
||||
getChatMenuButton({ chatId }?: {
|
||||
chatId?: number;
|
||||
}): Promise<tg.MenuButton>;
|
||||
/**
|
||||
* Use this method to change the default administrator rights requested by the bot when it's added as an administrator to groups or channels.
|
||||
* These rights will be suggested to users, but they are are free to modify the list before adding the bot.
|
||||
*/
|
||||
setMyDefaultAdministratorRights({ rights, forChannels, }?: {
|
||||
rights?: tg.ChatAdministratorRights;
|
||||
forChannels?: boolean;
|
||||
}): Promise<true>;
|
||||
/**
|
||||
* Use this method to get the current default administrator rights of the bot. Returns ChatAdministratorRights on success.
|
||||
* @param forChannels Pass true to get default administrator rights of the bot in channels. Otherwise, default administrator rights of the bot for groups and supergroups will be returned.
|
||||
*/
|
||||
getMyDefaultAdministratorRights({ forChannels, }?: {
|
||||
forChannels?: boolean;
|
||||
}): Promise<tg.ChatAdministratorRights>;
|
||||
/**
|
||||
* Log out from the cloud Bot API server before launching the bot locally.
|
||||
*/
|
||||
logOut(): Promise<true>;
|
||||
/**
|
||||
* Close the bot instance before moving it from one local server to another.
|
||||
*/
|
||||
close(): Promise<true>;
|
||||
}
|
||||
export default Telegram;
|
||||
//# sourceMappingURL=telegram.d.ts.map
|
||||
1
node_modules/telegraf/typings/telegram.d.ts.map
generated
vendored
Normal file
1
node_modules/telegraf/typings/telegram.d.ts.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
3
node_modules/telegraf/typings/types.d.ts
generated
vendored
Normal file
3
node_modules/telegraf/typings/types.d.ts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
export type * from './core/types/typegram';
|
||||
export type * as Convenience from './telegram-types';
|
||||
//# sourceMappingURL=types.d.ts.map
|
||||
1
node_modules/telegraf/typings/types.d.ts.map
generated
vendored
Normal file
1
node_modules/telegraf/typings/types.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,mBAAmB,uBAAuB,CAAA;AAC1C,YAAY,KAAK,WAAW,MAAM,kBAAkB,CAAA"}
|
||||
2
node_modules/telegraf/typings/utils.d.ts
generated
vendored
Normal file
2
node_modules/telegraf/typings/utils.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
export { argsParser } from './core/helpers/args';
|
||||
//# sourceMappingURL=utils.d.ts.map
|
||||
1
node_modules/telegraf/typings/utils.d.ts.map
generated
vendored
Normal file
1
node_modules/telegraf/typings/utils.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA"}
|
||||
Reference in New Issue
Block a user