Constructor
new AmbientListener(options)
Create a bot ambient listener.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
options |
Object
|
The ambient listener options. See Listener. |
Examples
bot.use(new Bot.Listener.Ambient({
name: 'hunger listener',
trigger: /i'?m hungry/i,
handler: new Bot.Responder.Message({
message: `Hello hungry, I'm ${bot.name}`
})
}));
bot.use(new Bot.Listener.Ambient({
name: 'help listener',
trigger: 'HELP!',
handler: async message => {
await bot.replyTo(message).with('What do you need help with?');
}
}));
Extends
Methods
(static) create() → {AmbientListener}
Create a bot ambient listener (see AmbientListener for parameters).
- Source: