![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
nestjs-telegraf
Advanced tools
NestJS Telegraf – powerful solution for creating Telegram bots.
This package uses the best of the NodeJS world under the hood. Telegraf is the most powerful library for creating bots and NestJS is a progressive framework for creating well-architectured applications. This module provides fast and easy way for creating Telegram bots and deep integration with your NestJS application.
Features
If you want to dive fully into NestJS Telegraf then don't waste your time in this dump, check out the documentation site.
$ npm i nestjs-telegraf telegraf
Once the installation process is complete, we can import the TelegrafModule
into the root AppModule
:
import { Module } from '@nestjs/common';
import { TelegrafModule } from 'nestjs-telegraf';
@Module({
imports: [
TelegrafModule.forRoot({
token: 'TELEGRAM_BOT_TOKEN',
})
],
})
export class AppModule {}
Then create app.update.ts
file and add some decorators for handling Telegram bot API updates:
import {
Update,
Start,
Help,
On,
Hears,
Context,
} from 'nestjs-telegraf';
import { AppService } from './app.service';
import { Context } from './context.interface';
@Update()
export class AppUpdate {
constructor(private readonly appService: AppService)
@Start()
async startCommand(ctx: Context) {
await ctx.reply('Welcome');
}
@Help()
async helpCommand(ctx: Context) {
await ctx.reply('Send me a sticker');
}
@On('sticker')
async onSticker(ctx: Context) {
await ctx.reply('👍');
}
@Hears('hi')
async hearsHi(ctx: Context) {
await ctx.reply('Hey there');
}
}
FAQs
Telegraf module for NestJS
The npm package nestjs-telegraf receives a total of 3,276 weekly downloads. As such, nestjs-telegraf popularity was classified as popular.
We found that nestjs-telegraf demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.