SQL Session Store for Bottender.
npm install bottender-session-sql
Publish migrations:
npx bottender-session-sql migrations:publish
Code example:
const { ConsoleBot } = require('bottender');
const SQLSessionStore = require('bottender-session-sql');
const bot = new ConsoleBot({
sessionStore: new SQLSessionStore({
client: 'pg',
connection: {
host: '127.0.0.1',
user: 'your_database_user',
password: 'your_database_password',
database: 'myapp_test',
},
migrations: {
tableName: 'migrations',
},
}),
});
Knex config.
Default: 365 * 24 * 60
.
See examples folder.
MIT © Yoctol