Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/grammy_autoquote/mod.ts>addReplyParam

grammY plugin that forces all sent messages to quote the last received one
Latest
function addReplyParam
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

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();

Parameters

ctx: C
  • The context object.
optional
options: AutoQuoteOptions
  • Optional configuration options.

Returns

A transformer function.