Skip to content

Commit

Permalink
fix: decorator name
Browse files Browse the repository at this point in the history
  • Loading branch information
RozmarinUS committed Jul 9, 2024
1 parent 85fa3eb commit 1e18811
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/content/text-commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions examples/app/src/app.service.ts
Original file line number Diff line number Diff line change
@@ -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';

Expand All @@ -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');
}
}
2 changes: 1 addition & 1 deletion examples/inline-keyboard/src/app.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/context/nestgram-context.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<Update>;

export type ContextOf<K extends keyof E, E = NestGramEvents> = [Context, E[K]];

0 comments on commit 1e18811

Please sign in to comment.