Classcore/nodev0.7.0
Member visibility
Filter class members by access level.
Pluggable(shutdown: CoordinatedShutdown, startup: CoordinatedStartup)Showing members with Protected visibility and higher.
public readonly abstract applicationId: stringpublic readonly abstract bus: Buspublic readonly abstract config: Configprotected isInitialized: booleanprotected readonly plugins: PluginLike[]public readonly abstract rateLimiter: IRateLimiterpublic readonly abstract rest: RESTpublic readonly shutdown: Pick<CoordinatedShutdown, 'addTask'>protected startFailed: booleanpublic readonly startup: Pick<CoordinatedStartup, 'addTask'>Attaches a plugin under key. Read the instance back as core[key]. seedcord codegen writes the Core augmentation that types it there.
Startup runs each plugin's init() in attach order within its phase.
Attaching a plugin whose transport or runtime differs from this host fails to compile. Your constructor takes CoreBase as its first parameter (you don't need to pass it though). A narrower one fails to compile here.
public attach<Key, Ctor>(
this: this,
key: ChannelKeyAssert<Key>,
Plugin: Ctor &
TransportAssert<InstanceType<Ctor>, BotT> &
RuntimeAssert<InstanceType<Ctor>, BotRt> &
CoreParamAssert<Ctor>,
args: PluginArgs<Ctor>
): this & Record<Key, InstanceType<Ctor>>Parameter:
keyAlso the channel the plugin logs on. Reserved channel names throw.
Parameter:
argsWhatever your constructor takes after the host.
Throws:
A SeedcordError if you attach after the bot has started. A taken or reserved key throws too.