# Seedcord

`class` in `gateway` · v0.1.0-next.3

<https://docs.seedcord.org/packages/gateway/0.1.0-next.3/classes/seedcord>

Main Seedcord bot framework class

Primary entry point for creating Discord bots with Seedcord. Manages component lifecycle and provides plugin support.

```ts
class Seedcord extends Pluggable implements Core
```

## Constructors

### constructor

```ts
Seedcord(config: GatewayConfig)
```

Creates a new Seedcord instance

## Properties

### bot

```ts
public readonly bot: Bot
```

### bus

```ts
public readonly bus: Bus
```

### config

```ts
public readonly config: GatewayConfig
```

### isInitialized

```ts
protected isInitialized: boolean
```

### plugins

```ts
protected readonly plugins: Plugin[]
```

### rateLimiter

```ts
public readonly rateLimiter: IRateLimiter
```

### shutdown

```ts
public readonly shutdown: CoordinatedShutdown
```

### startup

```ts
public readonly startup: CoordinatedStartup
```

### username

```ts
public get username(): string | undefined
```

The bot's discord username, populated after login.

## Methods

### attach

```ts
attach<Key, Ctor>(
    this: this,
    key: Key,
    Plugin: Ctor,
    startupPhase: StartupPhase,
    args: PluginArgs<Ctor>
): this & Record<Key, InstanceType<Ctor>>
```

Attaches a plugin to this instance

Plugins provide external functionality and are initialized during the specified startup phase. The plugin instance becomes available as a property in `core` wherever it's available.

Make sure to augment the [`Core`](/packages/gateway/0.1.0-next.3/interfaces/core) interface with the plugin type to ensure TypeScript recognizes it and provides intellisense.

### start

```ts
public async start(): Promise<this>
```

Starts the bot and runs all initialization tasks
