Giter VIP home page Giter VIP logo

Comments (8)

evilsprut avatar evilsprut commented on May 16, 2024 1

@Sedjj Okay, now I get it. I'll release the update in a little while.

from nestjs-telegraf.

evilsprut avatar evilsprut commented on May 16, 2024 1

Thank you, this will really save me from a problem that I’ve been tormenting for a long time.

It's done. Update the package to v0.7.0 and close the issue if everything works properly. I also updated the repository with an example. https://github.com/bukhalo/nestjs-telegraf-sample/commit/300c268fa33cbb1aabd0be0436161e22dfc2e703

from nestjs-telegraf.

Sedjj avatar Sedjj commented on May 16, 2024 1

Yes, it worked! Thanks for the quick decision. I really like your lib and will continue to use it.

from nestjs-telegraf.

evilsprut avatar evilsprut commented on May 16, 2024

@Sedjj I tried your code and it's working as expected.

I made an example for you of using a module with your code in a separate repository. Your code can be found in bot.service.ts the file.

from nestjs-telegraf.

Sedjj avatar Sedjj commented on May 16, 2024

Thank you for the quick answer to my question, but unfortunately I did not convey the right thought.
If you replace the contents of bot.service.ts

import {Injectable} from '@nestjs/common';
import {TelegrafTelegramService, TelegramActionHandler,} from 'nestjs-telegraf';
import {ContextMessageUpdate} from 'telegraf';

@Injectable()
export class BotService {
	constructor(
		private readonly telegrafTelegramService: TelegrafTelegramService,
	) {
	}

	@TelegramActionHandler({onStart: true})
	async start(ctx: ContextMessageUpdate) {
		const me = await this.telegrafTelegramService.getMe();
		console.log(me);
		await ctx.replyWithMarkdown('test', {
			reply_markup: {
				inline_keyboard: [
					[
						{
							text: 'test',
							callback_data: 'test_callback',
						},
					],
				]
			},
			parse_mode: 'Markdown',
		});
	}

	@TelegramActionHandler({message: 'test_callback'})
	protected async debugLogs(ctx: ContextMessageUpdate) {
		console.log('1');
	}
}

Then the debugLogs function will not be called on the test_callback response.

I'm interested in the ability to build logic for the answer with inline_keyboard.

from nestjs-telegraf.

Sedjj avatar Sedjj commented on May 16, 2024

Thank you, this will really save me from a problem that I’ve been tormenting for a long time.

from nestjs-telegraf.

evilsprut avatar evilsprut commented on May 16, 2024

@all-contributors please add @Sedjj for bug, ideas

from nestjs-telegraf.

allcontributors avatar allcontributors commented on May 16, 2024

@bukhalo

I've put up a pull request to add @Sedjj! 🎉

from nestjs-telegraf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.