Skip to main content
Module

x/grammy_autoquote/mod.ts>addReplyParam

grammY plugin that forces all sent messages to quote the last received one
Go to Latest
function addReplyParam
import { addReplyParam } from "https://deno.land/x/grammy_autoquote@v2.0.4/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 "jsr:@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, { allow_send_without_reply: true }));

  ctx.reply("Demo command!"); // This will quote the user's message
});

bot.start();

Parameters

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

Returns

A transformer function.