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

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

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

Registers some middleware that receives all updates. It is installed by concatenating it to the end of all previously installed middleware.

Often, this method is used to install middleware that behaves like a plugin, for example session middleware.

bot.use(session())

This method returns a new instance of composer. The returned instance can be further extended, and all changes will be regarded here. Confer the documentation on the website if you want to know more about how the middleware system in grammY works, especially when it comes to chaining the method calls (use( ... ).use( ... ).use( ... )).

Parameters

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

The middleware to register