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

x/grammy_menu/deps.deno.ts>Composer#drop

Interactive menus for grammY.
Latest
method Composer.prototype.drop
import { Composer } from "https://deno.land/x/grammy_menu@v1.3.0/deps.deno.ts";

This is an advanced method of grammY.

Registers middleware behind a custom filter function that operates on the context object and decides whether or not to execute the middleware. In other words, the middleware will only be executed if the given predicate returns false for the given context object. Otherwise, it will be skipped and the next middleware will be executed. Note that the predicate may be asynchronous, i.e. it can return a Promise of a boolean.

This method is the same using filter (normal usage) with a negated predicate.

Parameters

predicate: (ctx: C) => MaybePromise<boolean>

The predicate to check

...middleware: Array<Middleware<C>>

The middleware to register