# Core

`interface` in `gateway` · v0.4.1

<https://docs.seedcord.org/packages/gateway/0.4.1/interfaces/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`](/packages/gateway/0.4.1/classes/plugin) to this

```ts
interface Core extends CoreBase
```

## Examples

```ts
declare module '@seedcord/gateway' {
  interface Core {
    db: Mongoose;
  }
}
```

## Properties

### applicationId

```ts
readonly applicationId: string
```

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

### bot

```ts
readonly bot: Bot
```

### bus

```ts
readonly bus: Bus
```

Publish and subscribe to framework and application events.

### config

```ts
readonly config: GatewayConfig
```

### rateLimiter

```ts
readonly rateLimiter: IRateLimiter
```

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

### rest

```ts
readonly rest: REST
```

Discord REST client. On gateway this is the discord.js client's own, and it carries no token until the Login phase. On http the token is set by `start()`.

### shutdown

```ts
readonly shutdown: Pick<CoordinatedShutdown, 'addTask'>
```

### startup

```ts
readonly startup: Pick<CoordinatedStartup, 'addTask'>
```
