Build basic Process code
This commit is contained in:
6
index.js
6
index.js
@@ -36,17 +36,17 @@ setInterval(()=>{
|
||||
}
|
||||
// contents - Now work on response
|
||||
if(contents.result.length>0){
|
||||
console.log(`Update:${JSON.stringify(contents.result)}`)
|
||||
//console.log(`Update:${JSON.stringify(contents.result)}`)
|
||||
// Ready to work on
|
||||
if(parameters.offset===null){
|
||||
parameters.offset = contents[0].update_id + 1
|
||||
parameters.offset = contents.result[0].update_id + 1
|
||||
}
|
||||
contents.result.forEach(e=>{
|
||||
if(e.update_id + 1 > parameters.offset)
|
||||
{
|
||||
parameters.offset = e.update_id + 1
|
||||
}
|
||||
console.log(e.update_id)
|
||||
//console.log(e.update_id)
|
||||
respond.call(e)
|
||||
})
|
||||
|
||||
|
3
scripts/process.js
Normal file
3
scripts/process.js
Normal file
@@ -0,0 +1,3 @@
|
||||
module.exports.process = (updateObject)=>{
|
||||
return updateObject.message.text
|
||||
}
|
@@ -1,3 +1,6 @@
|
||||
module.exports.call = (updateObject)=>{
|
||||
|
||||
if('message' in updateObject){
|
||||
console.log(updateObject.message.text)
|
||||
//console.log("New Message")
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user