Plugin
Base class for a seedcord plugin. Extend it and implement init(). this.core is the running
bot.
Take the host as your constructor's first parameter and pass 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.
Returns data that seedcord codegen writes into the bot's seedcord-gen.ts as a type.
Read it back with Generated<typeof YourPlugin>. Return plain data, or classes and objects
that a project file or your plugin's package exports. The class needs a static readonly id.
seedcord codegen calls this without running init(). Read only what the constructor stored
and the bot's files.
public dispose?(): Promisable<void>Runs in StartupPhase.Configuration by default.
Move it to a different phase with the PluginLifecycleSpec.
public abstract init(): Promisable<void>public onHmr(_event: HmrUpdateEvent): Promisable<void>public ready?(): Promisable<void>