fix(sample): remove relation path import

This commit is contained in:
Morb0
2021-01-06 17:55:40 +03:00
parent c32f2c72d9
commit 31008b04c9
10 changed files with 13 additions and 14 deletions

View File

@@ -1,7 +1,7 @@
import { Module } from '@nestjs/common';
import { EchoUpdate } from './echo.update';
import { EchoService } from './echo.service';
import { HelloScene } from './scenes/hello.scene';
import { HelloScene } from '../greeter/scenes/hello.scene';
@Module({
providers: [EchoUpdate, EchoService, HelloScene],

View File

@@ -1,7 +1,7 @@
import { Telegraf } from 'telegraf';
import { Command, Help, InjectBot, On, Start, Update } from 'nestjs-telegraf';
import { Help, InjectBot, On, Start, Update } from 'nestjs-telegraf';
import { EchoService } from './echo.service';
import { GreeterBotName, HELLO_SCENE_ID } from '../app.constants';
import { GreeterBotName } from '../app.constants';
import { Context } from '../interfaces/context.interface';
@Update()
@@ -23,11 +23,6 @@ export class EchoUpdate {
await ctx.reply('Send me any text');
}
@Command('scene')
async onSceneCommand(ctx: Context): Promise<void> {
await ctx.scene.enter(HELLO_SCENE_ID);
}
@On('message')
async onMessage(ctx: Context): Promise<void> {
console.log('New message received');

View File

@@ -1,29 +0,0 @@
import { Scene, SceneEnter, SceneLeave, Command } from 'nestjs-telegraf';
import { HELLO_SCENE_ID } from '../../app.constants';
import { Context } from '../../interfaces/context.interface';
@Scene(HELLO_SCENE_ID)
export class HelloScene {
@SceneEnter()
async onSceneEnter(ctx: Context): Promise<void> {
console.log('Enter to scene');
await ctx.reply('Welcome on scene ✋');
}
@SceneLeave()
async onSceneLeave(ctx: Context): Promise<void> {
console.log('Leave from scene');
await ctx.reply('Bye Bye 👋');
}
@Command('hello')
async onHelloCommand(ctx: Context): Promise<void> {
console.log('Use say hello');
await ctx.reply('Hi');
}
@Command('leave')
async onLeaveCommand(ctx: Context): Promise<void> {
await ctx.scene.leave();
}
}