From 1e188118418635fc18731d61c0e7b62a78fb3424 Mon Sep 17 00:00:00 2001 From: Roman Khabarov Date: Tue, 9 Jul 2024 19:49:04 +0200 Subject: [PATCH] fix: decorator name --- docs/content/text-commands.md | 2 +- examples/app/src/app.service.ts | 4 ++-- examples/inline-keyboard/src/app.service.ts | 2 +- packages/core/src/context/nestgram-context.interface.ts | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/content/text-commands.md b/docs/content/text-commands.md index 1b879cd..9fb4337 100644 --- a/docs/content/text-commands.md +++ b/docs/content/text-commands.md @@ -14,7 +14,7 @@ Create a simple command handler for messages using `@TextCommand`. ```typescript title="src/app.service.ts" import { Injectable } from '@nestjs/common'; -import { Context, TextCommand, CommandContext } from '@nestgramjs/core'; +import { Context, TextCommand, TextCommandContext } from '@nestgramjs/core'; @Injectable() export class AppService { diff --git a/examples/app/src/app.service.ts b/examples/app/src/app.service.ts index 2dafd8e..c560825 100755 --- a/examples/app/src/app.service.ts +++ b/examples/app/src/app.service.ts @@ -1,5 +1,5 @@ import { Injectable } from '@nestjs/common'; -import { CommandContext, Context, ContextOf } from '../../../packages/core/src/context'; +import { TextCommandContext, Context, ContextOf } from '../../../packages/core/src/context'; import { Telegraf } from 'telegraf'; import { TextCommand } from '../../../packages/core'; @@ -16,7 +16,7 @@ export class AppService { name: 'start', description: 'Displays this help message.', }) - onStart(@Context() [ctx]: CommandContext) { + onStart(@Context() [ctx]: TextCommandContext) { ctx.reply('Start message triggered'); } } diff --git a/examples/inline-keyboard/src/app.service.ts b/examples/inline-keyboard/src/app.service.ts index ae17395..ee62d16 100755 --- a/examples/inline-keyboard/src/app.service.ts +++ b/examples/inline-keyboard/src/app.service.ts @@ -17,7 +17,7 @@ export class AppService { name: 'start', description: 'Displays this help message.', }) - onStart(@Context() [ctx]: CommandContext) { + onStart(@Context() [ctx]: TextCommandContext) { const inlineKeyboard = Markup.inlineKeyboard([ { text: 'Button 1', diff --git a/packages/core/src/context/nestgram-context.interface.ts b/packages/core/src/context/nestgram-context.interface.ts index b9a51f7..0d328d9 100644 --- a/packages/core/src/context/nestgram-context.interface.ts +++ b/packages/core/src/context/nestgram-context.interface.ts @@ -2,7 +2,7 @@ import { Context } from 'telegraf'; import { NestGramEvents } from '../listeners'; import { Update } from 'telegraf/typings/core/types/typegram'; -export type CommandContext = [Context]; +export type TextCommandContext = [Context]; export type ButtonContext = Context; export type ContextOf = [Context, E[K]];