Skip to content

popiiClient()

Popii


Popii / popiiClient

popiiClient<TState>(config): PopiiClient<TState>

Defined in: client.ts:216

Creates and returns a new Popii client instance.

Call client.start() after configuring it to connect to Discord and begin loading commands, events, snaps, middlewares, and tasks from their directories.

TState = any

PopiiClientConfig<TState>

PopiiClient<TState>

import { popiiClient } from "popii";
const client = popiiClient({ token: process.env.DISCORD_TOKEN! });
client.start();
import { popiiClient, sqlitePlugin, webPlugin, errorHandlerPlugin } from "popii";
const client = popiiClient({
token: process.env.DISCORD_TOKEN!,
devGuildId: process.env.DEV_GUILD_ID,
owners: [process.env.OWNER_ID!],
state: { totalCommands: 0 },
plugins: [
sqlitePlugin(),
webPlugin({
publicUrl: "https://bot.example.com",
oauth: { clientId: process.env.DISCORD_CLIENT_ID!, clientSecret: process.env.DISCORD_CLIENT_SECRET! },
}),
errorHandlerPlugin(),
]
});
client.start();