SystemBusMessage

SystemBusMessage

Global System Bus Message names

Constructor

new SystemBusMessage()

Properties:
Name Type Description
AUDIO_MUTE_CHANGED string

Emitted from audio systems extended from AbstractAudioSystem on mute state change.

SET_MUTE_AUDIO string

Mutes or unmutes audio systems extended from AbstractAudioSystem when emitted.

LEX_RESPONSE string

Event basename emitted from LexProcessingAction on responses from a Lex chat bot. Please see
https://docs.aws.amazon.com/lex/latest/dg/API_runtime_PostContent.html#API_runtime_PostContent_ResponseElements
for the data object keys and their contents passed with this event

Examples
SystemBus.addListener(SystemBusMessage.AUDIO_MUTE_CHANGED, ({muted, type}) => {
    console.log(`${type} is ${muted ? 'muted' : 'unmuted'}.`);
});
// > 'SpeechSystem is unmuted'.
// mutes all audio systems
SystemBus.emit(SystemBusMessage.SET_MUTE_AUDIO, {mute: true});
// unmutes just SpeechSystem
SystemBus.emit(SystemBusMessage.SET_MUTE_AUDIO, {mute: false, type: 'SpeechSystem'});
// print the data object returned from a Lex Response
SystemBus.addListener(`${SystemBusMessage.LEX_RESPONSE}.${entity.id}`, (data) => {
    console.dir(data);
});