Skip to content

Commit

Permalink
Merge pull request #1 from rjacobs31/feature/botpress-initialise
Browse files Browse the repository at this point in the history
Feature/botpress initialise
  • Loading branch information
rjacobs31 authored Mar 24, 2017
2 parents 3a4c6d4 + 9e041ca commit ba11ab9
Show file tree
Hide file tree
Showing 7 changed files with 273 additions and 1 deletion.
13 changes: 12 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# Logs
logs
/logs
*.log
npm-debug.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
Expand All @@ -33,5 +34,15 @@ jspm_packages
# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# *** Botpress specifics ***
/data
/modules_config
1 change: 1 addition & 0 deletions .welcome
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Delete this file to get rid of the initial Guided Tour
143 changes: 143 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

45 changes: 45 additions & 0 deletions botfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
module.exports = {

/**
* where the content is stored
* you can access this property from `bp.dataLocation`
*/
dataDir: process.env.BOTPRESS_DATA_DIR || './data',

modulesConfigDir: process.env.BOTPRESS_CONFIG_DIR || './modules_config',
disableFileLogs: false,
port: process.env.BOTPRESS_PORT || process.env.PORT || 3000,
optOutStats: false,
notification: {
file: 'notifications.json',
maxLength: 50
},
log: {
file: 'bot.log',
maxSize: 1e6 // 1mb
},

/**
* Access control of admin panel
*/
login: {
enabled: process.env.NODE_ENV === 'production',
tokenExpiry: '6 hours',
password: process.env.BOTPRESS_PASSWORD || 'password',
maxAttempts: 3,
resetAfter: 5 * 60 * 10000 // 5 minutes
},

/**
* Postgres configuration
*/
postgres: {
enabled: process.env.DATABASE === 'postgres',
host: process.env.PG_HOST || '127.0.0.1',
port: process.env.PG_PORT || 5432,
user: process.env.PG_USER || '',
password: process.env.PG_PASSWORD || '',
database: process.env.PG_DB || '',
ssl: process.env.PG_SSL || false
}
}
7 changes: 7 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = function(bp) {
bp.middlewares.load()

bp.hear({platform: "discord", type: "text", text: /^pandora:/i}, event => {
bp.discord.sendText(event.channel.id, "Bananas!")
})
}
16 changes: 16 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "node-pandora",
"version": "0.0.1",
"description": "",
"main": "index.js",
"dependencies": {
"botpress": "0.x",
"botpress-discord": "^2.0.9"
},
"scripts": {
"start": "botpress start",
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "AGPL-3.0"
}
49 changes: 49 additions & 0 deletions theme.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
.bp-sidebar-header {
.bp-logo {}
}

.bp-sidebar {
.bp-sidebar-active {}
.bp-sidebar-footer {
.bp-name {}
.bp-production {}
}
}

.bp-page-header {}
.bp-navbar {
.bp-slack {}
}

.bp-notifications-dropdown {
.bp-hub-message {}
.bp-top-menu {
.bp-item {}
.bp-level-success {}
.bp-level-info {}
.bp-level-error {}
.bp-item-unread {}
}
}

.bp-content-wrapper {}

.bp-middleware-list {
.bp-header {}
.bp-middleware {
.bp-circle {}
.bp-help-icon {}
}
}

.bp-module-panel {
.bp-module-title {}
.bp-module-description {}
.bp-module-author {}
.bp-module-license {}
}

.bp-login {
.bp-loading {}
.bp-header {}
}

0 comments on commit ba11ab9

Please sign in to comment.