new Cli(opts)
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
opts |
Object | CLI options
Properties
|
- Source:
Methods
getConfig() → (nullable) {Object}
Get the loaded and parsed bridge config. Only set after run() has been called.
- Source:
Returns:
The config
- Type
- Object
run()
Run the app from the command line. Will parse sys args.
- Source:
Type Definitions
generateRegistration(reg, callback)
Invoked when you should generate a registration.
Parameters:
Name | Type | Description |
---|---|---|
reg |
AppServiceRegistration | A new registration object with the app
service url provided by --url set. |
callback |
function | The callback that you should invoke when the
registration has been generated. It should be called with the
AppServiceRegistration provided in this function. |
- Source:
Example
generateRegistration: function(reg, callback) {
reg.setHomeserverToken(AppServiceRegistration.generateToken());
reg.setAppServiceToken(AppServiceRegistration.generateToken());
reg.setSenderLocalpart("my_first_bot");
callback(reg);
}