Classcore/pluginv0.11.0
Plugin
Base class for a seedcord plugin. Extend it and implement init(). this.core is the running
bot.
Your constructor takes the host first and passes it to super(). Add your own parameters after
it. attach() types them at the call site.
A plugin that narrows transport or runtime in Opts passes the same values to super().
attach() throws when either one differs from the bot's.
abstract class Plugin<
Opts extends PluginOptions = {},
TCore extends CoreBase = CoreBase,
Fixed extends ScopeAxis = never
>
implements Initializeable, HmrAwareMember visibility
Filter class members by access level.
Plugin(
host: CoreBase,
[spec],
input: PluginSpecArgs<Opts, Fixed>
)Showing members with Protected visibility and higher.
Opts
Where this plugin may attach.
Opts extends PluginOptions = {}TCore
The Core each transport binds this.core to.
Fixed
The transport and runtime values a transport's own Plugin base sets. Leave it out.
protected core: TCoreprotected readonly logger: LoggerRuns in StartupPhase.Configuration by default.
Move it to a different phase with the PluginLifecycleSpec.
public async onHmr(_event: HmrUpdateEvent): Promise<void>