cletus/bot/core/context.js
roberts 46a76dcfe6
All checks were successful
Deploy Cletus Bot / deploy (push) Successful in 13s
minor fixes for DB and AI access.
2025-05-10 12:40:17 -05:00

23 lines
483 B
JavaScript

// core/context.js
let bot = null;
let stateMachine = null;
let lastChat = null;
module.exports = {
setBot: (instance) => { bot = instance; },
getBot: () => bot,
setStateMachine: (machine) => { stateMachine = machine; },
getStateMachine: () => stateMachine,
setLastChat: (chat) => { lastChat = chat; },
getLastChat: () => lastChat,
setDB: (dbInstance) => { db = dbInstance; },
getDB: () => db,
getContextSnapshot: () => ({
bot,
lastChat
})
};