feat: customizable message for required params #36

Merged
amovah merged 4 commits from master into master 2017-09-12 16:04:27 +00:00
Showing only changes of commit 9c7adddb0a - Show all commits

View File

@ -215,13 +215,9 @@ export default class Bot extends EventEmitter {
const customMessage = ev.customMessage;
for (const param of requiredParams) {
let ga;
if (customMessage[param]) {
ga = new Message().to(msg.chat.id).text(customMessage[param]);
} else {
ga = new Message().to(msg.chat.id)
.text(`Enter value for ${param}`);
}
const ga = new Message()
.to(msg.chat.id)
.text(customMessage[param] || `Enter value for ${param}`);
yield bot.send(ga).then(answer => {
args[param] = answer.text;
});