mirror of
https://github.com/cheveguerra/bot-whatsapp.git
synced 2026-04-20 20:49:15 +00:00
23 lines
421 B
JavaScript
23 lines
421 B
JavaScript
/**
|
|
* Si necesitas saber que trae el "ctx"
|
|
* Puedes ver el README.md dentro packages/database
|
|
*/
|
|
|
|
class MockDatabase {
|
|
db
|
|
listHistory = []
|
|
|
|
constructor() {}
|
|
|
|
getPrevByNumber = (from) => {
|
|
const history = this.listHistory.slice().reverse()
|
|
return history.find((a) => a.from === from)
|
|
}
|
|
|
|
save = (ctx) => {
|
|
this.listHistory.push(ctx)
|
|
}
|
|
}
|
|
|
|
module.exports = MockDatabase
|