Skip to content
Interfacecore/pluginv0.14.0

PluginOptions

Declares where a plugin may attach. Pass it as the Plugin<Opts> type argument. Pass every field you narrow to super() as well. attach() fails to compile when the host does not match.

interface PluginOptions
// attaching this to an http bot fails to compile
class Voice extends Plugin<{ transport: 'gateway' }> {
    constructor(host: CoreBase) {
        super(host, { transport: 'gateway' });
    }

    public async init(): Promise<void> {}
}

runtime

Which runtime the plugin runs on. 'any' attaches to either one.

runtime?: 'server' | 'edge' | 'any'

Default:'any'

transport

Which transport the plugin runs on. 'any' attaches to either one.

transport?: 'gateway' | 'http' | 'any'

Default:'any'