Create a bot alias.
Examples
Create and register an alias
bot.use(new Bot.Alias({
name: 'DiceBot',
avatar: 'game_die' // An emoji name or image URL
}));
Use an alias as part of a Responder
bot.use(new Bot.Listener.Command({
name: 'dice roller',
trigger: 'roll a die',
handler: new Bot.Responder.RandomMessage({
alias: 'DiceBot',
messages: [
'1', '2', '3', '4', '5', '6'
]
})
}));
Use an alias as part of a handler function
bot.use(new Bot.Listener.Ambient({
name: 'hunger listener',
trigger: /i'?m hungry/i,
handler: async message => {
await bot
.replyTo(message)
.as('HungerBot')
.with(`Hello hungry, I'm ${bot.name}`);
}
}));