Skip to content

Make bot conversational #4

@roerohan

Description

@roerohan

Sam-Bot/index.js

Lines 65 to 88 in 423a5b3

} else if (message.reply_to_message.text === customStrings.askNameTransaction) {
// input
api.sendMessage({
chat_id: message.chat.id,
text: customStrings.askDescription,
reply_markup: JSON.stringify({
force_reply: true
})
});
} else if (message.reply_to_message.text === customStrings.askDescription) {
// input
api.sendMessage({
chat_id: message.chat.id,
text: customStrings.transactionAdded,
});
}
} else {

The Transaction model needs the name of the person, amount transacted and description of the transaction. The bot thus needs to remember the answers of the questions answered and then finally pass them all to the addTransaction() function.

E.G

Add Transaction
- Who did you make the transaction with?
David
- What was the transaction for?
Doritos
- What was the amount spent?
20
- Your transaction has been added

The result of this conversation should be that David, Doritos and 20 are added to the transactions database.

Make the PR on branch dev

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions