
Security News
AGENTS.md Gains Traction as an Open Format for AI Coding Agents
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
@grammyjs/conversations
Advanced tools
The grammY conversations plugin lets you create powerful conversational interfaces with ease.
This is version 2 of the plugin. Version 2 is a complete rewrite from scratch. If you are still using version 1.x, check out the migration guide. (The old docs are no longer be updated but they can still be found here.)
You should check out the official documentation of the plugin, but here is a quickstart for you to get up and running.
Run npm i @grammyjs/conversations
and paste the following code:
import { Bot, type Context } from "grammy";
import {
type Conversation,
type ConversationFlavor,
conversations,
createConversation,
} from "@grammyjs/conversations";
type MyContext = ConversationFlavor<Context>;
type MyConversationContext = Context;
type MyConversation = Conversation<MyContext, MyConversationContext>;
const bot = new Bot<MyContext>("");
/** Defines the conversation */
async function greeting(
conversation: MyConversation,
ctx: MyConversationContext,
) {
await ctx.reply("Hi there! What is your name?");
const { message } = await conversation.wait();
await ctx.reply(`Welcome to the chat, ${message.text}!`);
}
bot.use(conversations());
bot.use(createConversation(greeting));
bot.command("enter", async (ctx) => {
await ctx.reply("Entering conversation!");
// enter the function "greeting" you declared
await ctx.conversation.enter("greeting");
});
bot.command("start", (ctx) => ctx.reply("Hi! Send /enter"));
bot.use((ctx) => ctx.reply("What a nice update."));
bot.start();
Nifty!
FAQs
Conversational interfaces for grammY
The npm package @grammyjs/conversations receives a total of 4,559 weekly downloads. As such, @grammyjs/conversations popularity was classified as popular.
We found that @grammyjs/conversations demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.