Skip to content
Interfacecorev0.14.0

CoreBase

The transport-agnostic slice of the running framework, what core code (gates, notices, plugins' agnostic surface) accesses through ctx.core. Each transport's Core extends it with its own members.

interface CoreBase

applicationId

The bot's Discord application id. Throws if you read it before the host resolves it.

readonly applicationId: string

bus

Publish and subscribe to framework and application events.

readonly bus: Bus

config

Transports narrow this to their own config type.

readonly config: Config

kv

Your handlers' records in config.kv, under the app: prefix.

readonly kv: Kv

rateLimiter

Sliding-window rate limiting, the Cooldown gate's backend and a public direct-use API.

readonly rateLimiter: IRateLimiter

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 rest: REST

url

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'

Throws:

  • A SeedcordError when you read it and you haven't set server.url unless seedcord dev gave the bot an address.

  • A SeedcordTypeError when you read it and server.url isn't an http or https address.