- Source:
Manages local connected hooks, allowing device/server code execution
Examples
See 'hooks/examples/helloworld.js' for a basic local hook definition
See 'hooks/examples/beep.js' for a regex local hook definition
See 'hooks/examples/systat.js' for a system local hook definition
See 'hooks/examples/blink.js' for a GPIO local hook definition
See 'hooks/examples/mawkish.js' for a local hook with confirmation and custom keyboard
Members
(private, static) api
- Source:
Properties:
Name | Type | Description |
---|---|---|
api |
TelegramService | Link to TelegramService |
(private, static) initialized
- Source:
Properties:
Name | Type | Description |
---|---|---|
initialized |
Boolean | If initialized |
Methods
(static) connect_hook(hook_def) → {Promise}
- Source:
Connect local hook
Parameters:
Name | Type | Description |
---|---|---|
hook_def |
Object | Hook reference |
Returns:
- Type
- Promise
(static) init(tapi) → {Promise}
- Source:
Initialize local hooks manager
Parameters:
Name | Type | Description |
---|---|---|
tapi |
TelegramService | Link to Telegram service |
Returns:
- Type
- Promise
(private, static) manage_response(message, hook_def, error, output, plain) → {Promise}
- Source:
Check if call is authorized
Parameters:
Name | Type | Description |
---|---|---|
message |
Object | Received message |
hook_def |
Object | Hook reference |
error |
Error | String | Contains Exception or error message |
output |
String | Contains output string to be sent to user |
plain |
Boolean | Disable markdown/html parse mode |
Returns:
- Type
- Promise