Bot

extendsEmitter<BotEvents<M, C>>

Description

Starting point for your Gears app. Contains the ServiceManager and the root CommandGroup

Example

const bot = new Bot({ adapter, commands: [sum, multiply] })

Generics

M
Message
C
Client

Constructor

new Bot(options)

Parameters

options:
BotOptions<M, C>

Properties

group:
CommandGroup<M, C>
manager:
ServiceManager<M, C>
client:
C

Get the client from the adapter

Methods

processMessage(message)Promise<undefined | unknown type>

Manually run a message through the command chain. This method gets called automatically by the ClientAdapter.

Parameters
message:
M
start()Promise<void>

Asynchronously starts the bot