Enabling renaming event params from camelCase to snake_case and vice versa
bridge
.disableRenameParams()
Enabling logs.
bridge
.enableLogs()
Enabling renaming event params from camelCase to snake_case and vice versa
bridge
.enableRenameParams()
Set callback function to handle events without ref (notifications for example).
bridge.onReceive(({ type, handler, payload }) => {
// Handle event data
console.log('event', type, handler, payload)
})
Callback function.
Send event and wait response from express client.
bridge
.sendBotEvent(
{
method: 'get_weather',
params: {
city: 'Moscow',
},
files: []
}
)
.then(data => {
// Handle response
console.log('response', data)
})
boolean.
Event type.
Timeout in ms.
Promise.
Send event and wait response from express client.
bridge
.sendClientEvent(
{
type: 'get_weather',
handler: 'express',
payload: {
city: 'Moscow',
},
}
)
.then(data => {
// Handle response
console.log('response', data)
})
Event type.
Timeout in ms.
Promise.
Generated using TypeDoc
Disabling logs.