chore: remove legacy decorators

This commit is contained in:
Aleksandr Bukhalo 2020-08-31 12:16:40 +03:00
parent 6dd856876c
commit e999698fef
15 changed files with 0 additions and 120 deletions

View File

@ -17,11 +17,3 @@ export interface ActionOptions {
export const Action = (triggers: TelegrafActionTriggers): MethodDecorator => {
return SetMetadata(DECORATORS.ACTION, { triggers });
};
/**
* Registers middleware for handling callback_data actions with regular expressions.
*
* @see https://telegraf.js.org/#/?id=action
* @deprecated since v2, use Action decorator instead.
*/
export const TelegrafAction = Action;

View File

@ -15,11 +15,3 @@ export interface CashtagOptions {
export const Cashtag = (cashtag: TelegrafCashtagCashtag): MethodDecorator => {
return SetMetadata(DECORATORS.CASHTAG, { cashtag });
};
/**
* Cashtag handling.
*
* @see https://telegraf.js.org/#/?id=cashtag
* @deprecated since v2, use Cashtag decorator instead.
*/
export const TelegrafCashtag = Cashtag;

View File

@ -15,11 +15,3 @@ export interface CommandOptions {
export const Command = (commands: TelegrafCommandCommands): MethodDecorator => {
return SetMetadata(DECORATORS.COMMAND, { commands });
};
/**
* Command handling.
*
* @see https://telegraf.js.org/#/?id=command
* @deprecated since v2, use Command decorator instead.
*/
export const TelegrafCommand = Command;

View File

@ -20,11 +20,3 @@ export interface EntityOptions {
export const Entity = (entity: TelegrafEntityEntity): MethodDecorator => {
return SetMetadata(DECORATORS.ENTITY, { entity });
};
/**
* Entity handling.
*
* @see https://telegraf.js.org/#/?id=entity
* @deprecated since v2, use Entity decorator instead.
*/
export const TelegrafEntity = Entity;

View File

@ -9,11 +9,3 @@ import { DECORATORS } from '../telegraf.constants';
export const GameQuery = (): MethodDecorator => {
return SetMetadata(DECORATORS.GAME_QUERY, {});
};
/**
* Registers middleware for handling callback_data actions with game query.
*
* @see https://telegraf.js.org/#/?id=inlinequery
* @deprecated since v2, use Action decorator instead.
*/
export const TelegrafGameQuery = GameQuery;

View File

@ -15,11 +15,3 @@ export interface HashtagOptions {
export const Hashtag = (hashtag: TelegrafHashtagHashtag): MethodDecorator => {
return SetMetadata(DECORATORS.HASHTAG, { hashtag });
};
/**
* Hashtag handling.
*
* @see https://telegraf.js.org/#/?id=hashtag
* @deprecated since v2, use Hashtag decorator instead.
*/
export const TelegrafHashtag = Hashtag;

View File

@ -17,11 +17,3 @@ export interface HearsOptions {
export const Hears = (triggers: TelegrafHearsTriggers): MethodDecorator => {
return SetMetadata(DECORATORS.HEARS, { triggers: triggers });
};
/**
* Registers middleware for handling text messages.
*
* @see https://telegraf.js.org/#/?id=hears
* @deprecated since v2, use Hears decorator instead.
*/
export const TelegrafHears = Hears;

View File

@ -9,11 +9,3 @@ import { DECORATORS } from '../telegraf.constants';
export const Help = (): MethodDecorator => {
return SetMetadata(DECORATORS.HELP, {});
};
/**
* Handler for /help command.
*
* @see https://telegraf.js.org/#/?id=help
* @deprecated since v2, use Help decorator instead.
*/
export const TelegrafHelp = Help;

View File

@ -17,11 +17,3 @@ export const InlineQuery = (
): MethodDecorator => {
return SetMetadata(DECORATORS.INLINE_QUERY, { triggers });
};
/**
* Registers middleware for handling inline_query actions with regular expressions.
*
* @see https://telegraf.js.org/#/?id=inlinequery
* @deprecated since v2, use InlineQuery decorator instead.
*/
export const TelegrafInlineQuery = InlineQuery;

View File

@ -15,11 +15,3 @@ export interface MentionOptions {
export const Mention = (username: TelegrafMentionUsername): MethodDecorator => {
return SetMetadata(DECORATORS.MENTION, { username });
};
/**
* Mention handling.
*
* @see https://telegraf.js.org/#/?id=mention
* @deprecated since v2, use Mention decorator instead.
*/
export const TelegrafMention = Mention;

View File

@ -20,11 +20,3 @@ export interface OnOptions {
export const On = (updateTypes: TelegrafOnUpdateTypes): MethodDecorator => {
return SetMetadata(DECORATORS.ON, { updateTypes: updateTypes });
};
/**
* Registers middleware for provided update type.
*
* @see https://telegraf.js.org/#/?id=on
* @deprecated since v2, use On decorator instead.
*/
export const TelegrafOn = On;

View File

@ -15,11 +15,3 @@ export interface PhoneOptions {
export const Phone = (phone: TelegrafPhonePhone): MethodDecorator => {
return SetMetadata(DECORATORS.PHONE, { phone });
};
/**
* Phone number handling.
*
* @see https://telegraf.js.org/#/?id=phone
* @deprecated since v2, use Phone decorator instead.
*/
export const TelegrafPhone = Phone;

View File

@ -9,11 +9,3 @@ import { DECORATORS } from '../telegraf.constants';
export const Settings = (): MethodDecorator => {
return SetMetadata(DECORATORS.SETTINGS, {});
};
/**
* Handler for /settings command.
*
* @see https://telegraf.js.org/#/?id=settings
* @deprecated since v2, use Settings decorator instead.
*/
export const TelegrafSettings = Settings;

View File

@ -9,11 +9,3 @@ import { DECORATORS } from '../telegraf.constants';
export const Start = (): MethodDecorator => {
return SetMetadata(DECORATORS.START, {});
};
/**
* Handler for /start command.
*
* @see https://telegraf.js.org/#/?id=start
* @deprecated since v2, use Start decorator instead.
*/
export const TelegrafStart = Start;

View File

@ -9,11 +9,3 @@ import { DECORATORS } from '../telegraf.constants';
export const Use = (): MethodDecorator => {
return SetMetadata(DECORATORS.USE, {});
};
/**
* Registers a middleware.
*
* @see https://telegraf.js.org/#/?id=use
* @deprecated since v2, use Use decorator instead.
*/
export const TelegrafUse = Use;