Skip to content

@lunibee/types

The @lunibee/types package contains the TypeScript types, enums, flags, event payloads, and constants used throughout Lunibee.

Terminal window
bun add @lunibee/types

Most applications can import these from lunibee instead of installing this package directly.

import {
IntentBits,
ChannelType,
MessageFlags,
ApplicationCommandType,
ApplicationCommandOptionType,
InteractionType,
} from "@lunibee/types";
const intents = IntentBits.guilds | IntentBits.guildMessages;
const channelType = ChannelType.GuildText;
const flags = MessageFlags.Ephemeral;

Gateway intents control which events and data your bot receives. Only request the intents your bot needs.

import { Client } from "lunibee";
import { IntentBits } from "@lunibee/types";
const client = new Client({
token: process.env.DISCORD_TOKEN!,
intents: IntentBits.guilds | IntentBits.guildMessages,
});

Some intents are privileged and must also be enabled for your bot in the Discord Developer Portal.

Use ChannelType when an API expects a Discord channel type rather than a string.

if (channel.type === ChannelType.GuildText) {
console.log("Text channel");
}

Flags describe special message behavior.

if ((message.flags & MessageFlags.Ephemeral) !== 0) {
console.log("Ephemeral message");
}

InteractionType identifies the kind of Discord interaction being handled, while application-command option types describe command arguments.

Use the types package when you are writing lower-level integrations or need precise payload typing. For everyday bot code, Lunibee’s structures, builders, and interaction classes are usually easier to work with.