Basic response filtering

This commit is contained in:
2019-08-05 21:59:54 +05:30
parent bf9353a5cc
commit 2e72d1bd8e
3 changed files with 47 additions and 14 deletions

View File

@@ -1,10 +1,18 @@
// Obtain a sendMessage Object
const makeResponse = require('./makeResponse')
module.exports = (messageObject)=>{
if(makeResponse.canRespond(messageObject.text)){
console.log(makeResponse.getCommand(messageObject.text))
return {
"chat_id": messageObject.from.id,
"text": makeResponse.getPredicate(messageObject.text),
"parse_mode": "Markdown",
"reply_to_message_id": messageObject.message_id
}
module.exports = (updateObject)=>{
return {
"chat_id": updateObject.from.id,
"text":updateObject.text,
"reply_to_message_id": updateObject.message_id
}
//return JSON.stringify(updateObject)
else{
return null
}
}