import { addReplyParam } from "https://deno.land/x/grammy_autoquote@v2.0.8/mod.ts";
Adds reply_to_message_id
and chat_id
to outgoing message payloads if not present.
Use this when you want to enable auto-quoting for a single scope.
Examples
Example 1
Example 1
import { Bot } from "grammy";
import { addReplyParam } from "@roz/grammy-autoquote";
const bot = new Bot("");
bot.command("demo", async (ctx) => {
ctx.api.config.use(addReplyParam(ctx));
// OR:
// ctx.api.config.use(addReplyParam(ctx, { allowSendingWithoutReply: true }));
ctx.reply("Demo command!"); // This will quote the user's message
});
bot.start();
Type Parameters
C extends Context
Parameters
ctx: C
- The context object.
optional
options: AutoQuoteOptions- Optional configuration options.
Returns
A transformer function.