import { autoQuote } from "https://deno.land/x/grammy_autoquote@v2.0.8/mod.ts";
Applies the addReplyParam middleware to the bot's API configuration.
Use this when you want to enable auto-quoting for all scopes.
Examples
Example 1
Example 1
import { Bot } from "grammy";
import { autoQuote } from "jsr:@roz/grammy-autoquote";
const bot = new Bot("");
bot.use(autoQuote());
// OR:
// bot.use(autoQuote({ allowSendingWithoutReply: true })
bot.command("demo", async (ctx) => {
ctx.reply("Demo command!"); // This will quote the user's message
});
bot.command("hello", async (ctx) => {
ctx.reply("Hi there :)"); // Also quotes the user's message
});
bot.start();
Parameters
optional
options: AutoQuoteOptions- Optional configuration options for autoQuote.
Returns
A middleware function.