Basic response filtering
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user