Optional ReadonlydependsNames of plugins that must be installed before this one.
If a dependency is not installed yet, installation is deferred until it is (plugins are
flushed automatically on every usePlugin call). Dependencies still missing when the
application starts cause runPolling / runWebhook to throw.
ReadonlynameUnique identifier of the plugin. Installing two plugins with the same name throws, so pick a
namespaced name (e.g. "telebot-plugin-i18n").
Optional ReadonlypriorityRelative installation order among plugins whose dependencies are simultaneously satisfied: lower values install first. Installation order determines middleware execution order.
Optional ReadonlyuninstallOptional teardown invoked by Application.removePlugin before the plugin's
middleware, handlers, and hooks are deregistered. Use it to cancel timers or release
resources the plugin owns outside of onShutdown hooks.
The Application the plugin is being removed from.
Synchronously wires the plugin into the application.
The Application the plugin is being installed into.
A telebot-ts plugin: a named, self-contained bundle of bot behavior.
installruns synchronously while the application is being configured — wire up middleware, handlers, and lifecycle hooks there. Reserve asynchronous setup (opening connections, loading data) foronInithooks, which run right before the bot starts serving updates.Example