BotConfigurationBase class
Constructors
Bot |
Creates a new BotConfigurationBase instance. |
Properties
description | |
name | |
padlock | |
services | |
version |
Methods
connect |
Connect a service to the bot file. |
disconnect |
Remove service by id. |
disconnect |
Remove service by name or id. |
find |
Find service by id. |
find |
Find service by name or id. |
fromJSON(Partial<IBot |
Loads a new BotConfigurationBase instance given a JSON based configuration. |
service |
Loads a ConnectedService instance given a JSON based service configuration. |
toJSON() | Creates a JSON based version of the current bot. |
Constructor Details
BotConfigurationBase()
Creates a new BotConfigurationBase instance.
new BotConfigurationBase()
Property Details
description
description: string
Property Value
string
name
name: string
Property Value
string
padlock
padlock: string
Property Value
string
services
version
version: string
Property Value
string
Method Details
connectService(IConnectedService)
Connect a service to the bot file.
function connectService(newService: IConnectedService): string
Parameters
- newService
- IConnectedService
Service to add.
Returns
string
Assigned ID for the service.
disconnectService(string)
Remove service by id.
function disconnectService(id: string)
Parameters
- id
-
string
ID of the service to remove.
disconnectServiceByNameOrId(string)
Remove service by name or id.
function disconnectServiceByNameOrId(nameOrId: string): IConnectedService
Parameters
- nameOrId
-
string
Name or ID of the service to remove.
Returns
The removed IConnectedService based on the provided name or id.
findService(string)
Find service by id.
function findService(id: string): IConnectedService
Parameters
- id
-
string
ID of the service to find.
Returns
The IConnectedService based on the provided id.
findServiceByNameOrId(string)
Find service by name or id.
function findServiceByNameOrId(nameOrId: string): IConnectedService
Parameters
- nameOrId
-
string
Name or ID of the service to find.
Returns
The IConnectedService based on the provided name or id.
fromJSON(Partial<IBotConfiguration>)
Loads a new BotConfigurationBase instance given a JSON based configuration.
static function fromJSON(source?: Partial<IBotConfiguration>): BotConfigurationBase
Parameters
- source
-
Partial<IBotConfiguration>
JSON based configuration.
Returns
A new BotConfigurationBase instance.
serviceFromJSON(IConnectedService)
Loads a ConnectedService instance given a JSON based service configuration.
static function serviceFromJSON(service: IConnectedService): ConnectedService
Parameters
- service
- IConnectedService
JSON based service configuration.
Returns
A new ConnectedService instance.
toJSON()
Creates a JSON based version of the current bot.
function toJSON(): IBotConfiguration
Returns
An IBotConfiguration JSON.