Core
Main interface for Seedcord core functionality
This interface can be augmented via declaration merging to add
type-safe plugin definitions when using this.core# in handlers.
Only add classes that extend Plugin to this
interface Core extends CoreBasedeclare module '@seedcord/gateway' {
interface Core {
db: Mongoose;
}
}applicationId
The bot's Discord application id. Throws if you read it before the host resolves it.
readonly bot: Botbus
Publish and subscribe to framework and application events.
readonly config: GatewayConfigkv
Your handlers' records in config.kv, under the app: prefix.
rateLimiter
Sliding-window rate limiting, the Cooldown gate's backend and a public direct-use API.
readonly rateLimiter: IRateLimiterInherited from:CoreBase
rest
Discord REST client. On gateway this is the discord.js client's own, and it doesn't carry a token
until the Login phase. On http the token is set by start().
readonly shutdown: ShutdownTasksreadonly startup: StartupTasksurl
The address people reach your bot at, from server.url in your config. Its path always ends in
a slash.
Under seedcord dev, a bot without server.url gets its localhost address, and an http bot
whose dev.tunnel is a URL gets that URL.
readonly url: URL// with server.url set to 'https://example.com/bot'
new URL('callback', core.url).href; // 'https://example.com/bot/callback'Inherited from:CoreBase
Throws:
A SeedcordError when you read it and you haven't set
server.urlunlessseedcord devgave the bot an address.A SeedcordTypeError when you read it and
server.urlisn't an http or https address.