Skip to main content

Function: isBaleybot()

isBaleybot(bot): bot is Processable<unknown, unknown> & { config: BaleybotConfig; getName: any }

Defined in: packages/core/src/utils/type-guards.ts:24

Type guard to check if a value is a Baleybot instance (v2)

Checks for Processable interface, config property, and validates config is BaleybotConfig

Parameters

bot

unknown

Value to check

Returns

bot is Processable<unknown, unknown> & { config: BaleybotConfig; getName: any }

True if the value is a Baleybot instance

Example

if (isBaleybot(someValue)) {
const name = someValue.getName();
const config = someValue.config; // TypeScript knows this is BaleybotConfig
}